Class LeatherArmorBuilder

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

public class LeatherArmorBuilder extends ItemBuilder
The LeatherArmorBuilder class extends ItemBuilder to provide additional functionality for modifying LeatherArmorMeta of an ItemStack. This class allows setting leather armor colors.
  • Constructor Details

    • LeatherArmorBuilder

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

      public LeatherArmorBuilder(@NotNull @NotNull org.bukkit.Material material, int amount)
      Constructs a LeatherArmorBuilder with the specified Material and amount.
      Parameters:
      material - the leather armor material
      amount - the quantity of items in the stack
      Throws:
      IllegalArgumentException - if the material is not a leather armor piece
  • Method Details

    • setColor

      public LeatherArmorBuilder setColor(@NotNull @NotNull org.bukkit.Color color)
      Sets the color of the leather armor.
      Parameters:
      color - the Color to set
      Returns:
      this LeatherArmorBuilder instance for chaining
    • setColor

      public LeatherArmorBuilder setColor(@NotNull @NotNull String hex)
      Sets the color of the leather armor using a HEX color code.
      Parameters:
      hex - the HEX color code (e.g., "#FF5733")
      Returns:
      this LeatherArmorBuilder instance for chaining
      Throws:
      IllegalArgumentException - if the HEX code is invalid
    • getColor

      public org.bukkit.Color getColor()
      Gets the color of the leather armor.
      Returns:
      the current Color of the armor