Class ShieldBuilder

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

public class ShieldBuilder extends ItemBuilder
The ShieldBuilder class extends ItemBuilder to provide additional functionality for modifying ShieldMeta of an ItemStack. This class allows setting the base color of shields.
  • Constructor Details

    • ShieldBuilder

      public ShieldBuilder()
      Constructs a ShieldBuilder with a new Material.SHIELD.
    • ShieldBuilder

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

    • setBaseColor

      public ShieldBuilder setBaseColor(@NotNull @NotNull org.bukkit.DyeColor color)
      Sets the base color of the shield.
      Parameters:
      color - the base color to set
      Returns:
      this ShieldBuilder instance for chaining
    • getBaseColor

      public org.bukkit.DyeColor getBaseColor()
      Gets the base color of the shield.
      Returns:
      the base color, or null if not set
    • hasBaseColor

      public boolean hasBaseColor()
      Checks if the shield has a base color set.
      Returns:
      true if a base color is set, false otherwise