Class ArmorBuilder

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

public class ArmorBuilder extends ItemBuilder
The ArmorMetaBuilder class extends ItemBuilder to provide additional functionality for modifying ArmorMeta of an ItemStack. This class allows setting and retrieving armor trims for supported armor items.
  • Constructor Details

    • ArmorBuilder

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

      public ArmorBuilder(@NotNull @NotNull org.bukkit.Material material, int amount)
      Constructs an ArmorMetaBuilder with the specified Material and amount.
      Parameters:
      material - the material for the item stack
      amount - the quantity of items in the stack
      Throws:
      IllegalArgumentException - if the item's meta is not an instance of ArmorMeta
    • ArmorBuilder

      public ArmorBuilder(@NotNull @NotNull org.bukkit.Material material)
      Constructs an ArmorMetaBuilder with the specified Material.
      Parameters:
      material - the material for the item stack
      Throws:
      IllegalArgumentException - if the item's meta is not an instance of ArmorMeta
  • Method Details

    • getTrim

      public org.bukkit.inventory.meta.trim.ArmorTrim getTrim()
      Retrieves the ArmorTrim applied to the armor item.
      Returns:
      the armor trim, or null if none is set
    • hasTrim

      public boolean hasTrim()
      Checks whether the armor item has an ArmorTrim applied.
      Returns:
      true if the item has trim, false otherwise
    • setTrim

      public ArmorBuilder setTrim(org.bukkit.inventory.meta.trim.ArmorTrim trim)
      Sets the ArmorTrim for the armor item.
      Parameters:
      trim - the armor trim to apply
      Returns:
      this ArmorMetaBuilder instance for method chaining