Class ShieldBuilder
java.lang.Object
io.github.lucfr1746.llibrary.itemstack.ItemBuilder
io.github.lucfr1746.llibrary.itemstack.ShieldBuilder
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 Summary
ConstructorsConstructorDescriptionConstructs aShieldBuilder
with a newMaterial.SHIELD
.ShieldBuilder
(@NotNull org.bukkit.inventory.ItemStack itemStack) Constructs aShieldBuilder
using an existingItemStack
. -
Method Summary
Modifier and TypeMethodDescriptionorg.bukkit.DyeColor
Gets the base color of the shield.boolean
Checks if the shield has a base color set.setBaseColor
(@NotNull org.bukkit.DyeColor color) Sets the base color of the shield.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
-
ShieldBuilder
public ShieldBuilder()Constructs aShieldBuilder
with a newMaterial.SHIELD
. -
ShieldBuilder
public ShieldBuilder(@NotNull @NotNull org.bukkit.inventory.ItemStack itemStack) Constructs aShieldBuilder
using an existingItemStack
.- Parameters:
itemStack
- the item stack to modify- Throws:
IllegalArgumentException
- if the item's meta is not an instance ofShieldMeta
-
-
Method Details
-
setBaseColor
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
-