Class LeatherArmorBuilder
java.lang.Object
io.github.lucfr1746.llibrary.itemstack.ItemBuilder
io.github.lucfr1746.llibrary.itemstack.LeatherArmorBuilder
The
LeatherArmorBuilder
class extends ItemBuilder
to provide
additional functionality for modifying LeatherArmorMeta
of an ItemStack
.
This class allows setting leather armor colors.-
Constructor Summary
ConstructorsConstructorDescriptionLeatherArmorBuilder
(@NotNull org.bukkit.Material material, int amount) Constructs aLeatherArmorBuilder
with the specifiedMaterial
and amount.LeatherArmorBuilder
(@NotNull org.bukkit.inventory.ItemStack itemStack) Constructs aLeatherArmorBuilder
using an existingItemStack
. -
Method Summary
Methods inherited from class io.github.lucfr1746.llibrary.itemstack.ItemBuilder
addAttributeModifier, addEnchant, addEnchant, addEnchant, addItemFlags, addLore, build, getAmount, getAttributeModifiers, getAttributeModifiers, getAttributeModifiers, getCustomModelData, getDamageResistant, getDisplayName, getEnchantable, getEnchantLevel, getEnchantmentGlintOverride, getEnchants, getEquippableComponent, getFoodComponent, getItemFlags, getItemMeta, getItemModel, getJukeboxPlayableComponent, getMaxStackSize, getRarity, getToolComponent, getTooltipStyle, getTranslationKey, getType, getUseCooldownComponent, getUseRemainder, hasAttributeModifiers, hasConflictingEnchant, hasCustomModelData, hasDamageResistant, hasEnchant, hasEnchantable, hasEnchantmentGlintOverride, hasEnchants, hasEquippableComponent, hasFoodComponent, hasItemFlag, hasItemModel, hasJukeboxPlayableComponent, hasMaxStackSize, hasRarity, hasToolComponent, hasTooltipStyle, hasUseCooldownComponent, hasUseRemainder, hideAllItemFlags, insertLore, isGlider, isHideTooltip, isUnbreakable, removeAttributeModifier, removeAttributeModifier, removeAttributeModifier, removeEnchant, removeEnchants, removeItemFlags, replaceLore, setAmount, setAttributeModifiers, setCustomModelData, setDamageResistant, setDisplayName, setEnchantable, setEnchantmentGlintOverride, setEquippableComponent, setEquippableComponent, setFood, setFoodComponent, setGlider, setHideTooltip, setItemModel, setItemModel, setJukeboxPlayableComponent, setJukeboxPlayableComponent, setJukeboxPlayableComponent, setLores, setLores, setMaxStackSize, setRarity, setToolComponent, setToolComponent, setTooltipStyle, setTooltipStyle, setType, setUnbreakable, setUseCooldownComponent, setUseCooldownComponent, setUseCooldownComponent, setUseRemainder
-
Constructor Details
-
LeatherArmorBuilder
public LeatherArmorBuilder(@NotNull @NotNull org.bukkit.inventory.ItemStack itemStack) Constructs aLeatherArmorBuilder
using an existingItemStack
.- Parameters:
itemStack
- the item stack to modify- Throws:
IllegalArgumentException
- if the item's meta is not an instance ofLeatherArmorMeta
-
LeatherArmorBuilder
public LeatherArmorBuilder(@NotNull @NotNull org.bukkit.Material material, int amount) Constructs aLeatherArmorBuilder
with the specifiedMaterial
and amount.- Parameters:
material
- the leather armor materialamount
- the quantity of items in the stack- Throws:
IllegalArgumentException
- if the material is not a leather armor piece
-
-
Method Details
-
setColor
Sets the color of the leather armor.- Parameters:
color
- theColor
to set- Returns:
- this
LeatherArmorBuilder
instance for chaining
-
setColor
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
-