Skip to content

Commit

Permalink
feat: Add flight duration to the fireworks
Browse files Browse the repository at this point in the history
  • Loading branch information
heyxmirko committed May 5, 2024
1 parent cf7fcf6 commit f04a729
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>me.lukyn76</groupId>
<artifactId>ImageFireworksPro</artifactId>
<version>1.1.1</version>
<version>1.1.2</version>
<packaging>jar</packaging>

<name>ImageFireworksPro</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import org.bukkit.command.TabCompleter;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.FireworkMeta;
import org.bukkit.inventory.meta.ItemMeta;

import java.util.ArrayList;
Expand Down Expand Up @@ -50,10 +51,11 @@ public boolean onCommand(CommandSender sender, Command command, String s, String
amount = Integer.parseInt(args[3]);
}
ItemStack firework = new ItemStack(Material.FIREWORK_ROCKET, amount);
ItemMeta fireworkMeta = firework.getItemMeta();
FireworkMeta fireworkMeta = (FireworkMeta) firework.getItemMeta();

fireworkMeta.setDisplayName(imageFirework.getName());
fireworkMeta.setCustomModelData(imageFirework.getCustomModelData());
fireworkMeta.setPower(1);
firework.setItemMeta(fireworkMeta);

player.getInventory().addItem(firework);
Expand Down

0 comments on commit f04a729

Please sign in to comment.