Class ArmorBuilder
java.lang.Object
io.github.lucfr1746.llibrary.itemstack.ItemBuilder
io.github.lucfr1746.llibrary.itemstack.ArmorBuilder
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 Summary
ConstructorsConstructorDescriptionArmorBuilder(@NotNull org.bukkit.Material material) Constructs anArmorMetaBuilderwith the specifiedMaterial.ArmorBuilder(@NotNull org.bukkit.Material material, int amount) Constructs anArmorMetaBuilderwith the specifiedMaterialand amount.ArmorBuilder(@NotNull org.bukkit.inventory.ItemStack itemStack) Constructs anArmorMetaBuilderusing an existingItemStack. -
Method Summary
Modifier and TypeMethodDescriptionorg.bukkit.inventory.meta.trim.ArmorTrimgetTrim()Retrieves theArmorTrimapplied to the armor item.booleanhasTrim()Checks whether the armor item has anArmorTrimapplied.setTrim(org.bukkit.inventory.meta.trim.ArmorTrim trim) Sets theArmorTrimfor the armor item.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
-
ArmorBuilder
public ArmorBuilder(@NotNull @NotNull org.bukkit.inventory.ItemStack itemStack) Constructs anArmorMetaBuilderusing an existingItemStack.- Parameters:
itemStack- the item stack to modify- Throws:
IllegalArgumentException- if the item's meta is not an instance ofArmorMeta
-
ArmorBuilder
public ArmorBuilder(@NotNull @NotNull org.bukkit.Material material, int amount) Constructs anArmorMetaBuilderwith the specifiedMaterialand amount.- Parameters:
material- the material for the item stackamount- the quantity of items in the stack- Throws:
IllegalArgumentException- if the item's meta is not an instance ofArmorMeta
-
ArmorBuilder
public ArmorBuilder(@NotNull @NotNull org.bukkit.Material material) Constructs anArmorMetaBuilderwith the specifiedMaterial.- Parameters:
material- the material for the item stack- Throws:
IllegalArgumentException- if the item's meta is not an instance ofArmorMeta
-
-
Method Details
-
getTrim
public org.bukkit.inventory.meta.trim.ArmorTrim getTrim()Retrieves theArmorTrimapplied to the armor item.- Returns:
- the armor trim, or
nullif none is set
-
hasTrim
public boolean hasTrim()Checks whether the armor item has anArmorTrimapplied.- Returns:
trueif the item has trim,falseotherwise
-
setTrim
Sets theArmorTrimfor the armor item.- Parameters:
trim- the armor trim to apply- Returns:
- this
ArmorMetaBuilderinstance for method chaining
-