Class FireworkEffectBuilder

java.lang.Object
io.github.lucfr1746.llibrary.itemstack.ItemBuilder
io.github.lucfr1746.llibrary.itemstack.FireworkEffectBuilder

public class FireworkEffectBuilder extends ItemBuilder
The FireworkEffectBuilder class extends ItemBuilder to provide additional functionality for modifying FireworkEffectMeta of an ItemStack. This class allows setting firework effects, including colors, fade colors, flicker, and trail.
  • Constructor Details

    • FireworkEffectBuilder

      public FireworkEffectBuilder()
      Constructs a FireworkEffectBuilder with a new Material.FIREWORK_STAR.
    • FireworkEffectBuilder

      public FireworkEffectBuilder(@NotNull @NotNull org.bukkit.inventory.ItemStack itemStack)
      Constructs a FireworkEffectBuilder using an existing ItemStack.
      Parameters:
      itemStack - the item stack to modify
      Throws:
      IllegalArgumentException - if the item's meta is not an instance of FireworkEffectMeta
  • Method Details

    • setEffect

      public FireworkEffectBuilder setEffect(@NotNull @NotNull org.bukkit.FireworkEffect effect)
      Sets the firework effect.
      Parameters:
      effect - the firework effect
      Returns:
      this FireworkEffectBuilder instance for method chaining
      Throws:
      IllegalArgumentException - if the effect is null
    • getEffect

      public org.bukkit.FireworkEffect getEffect()
      Gets the firework effect.
      Returns:
      the firework effect, or null if not set
    • hasEffect

      public boolean hasEffect()
      Checks if the firework effect exists.
      Returns:
      true if there is a firework effect, false otherwise