Package net.glowstone.inventory
Class GlowMetaItem
java.lang.Object
net.glowstone.inventory.GlowMetaItem
- All Implemented Interfaces:
Cloneable
,org.bukkit.configuration.serialization.ConfigurationSerializable
,org.bukkit.inventory.meta.ItemMeta
,org.bukkit.persistence.PersistentDataHolder
- Direct Known Subclasses:
GlowMetaBanner
,GlowMetaEnchantedBook
,GlowMetaFirework
,GlowMetaFireworkEffect
,GlowMetaKnowledgeBook
,GlowMetaLeatherArmor
,GlowMetaPotion
,GlowMetaSkull
,GlowMetaSpawn
An implementation of
ItemMeta
, created through GlowItemFactory
.-
Constructor Summary
ConstructorsConstructorDescriptionGlowMetaItem
(org.bukkit.inventory.meta.ItemMeta meta) Create a GlowMetaItem, copying from another if possible. -
Method Summary
Modifier and TypeMethodDescriptionboolean
addAttributeModifier
(@NotNull org.bukkit.attribute.Attribute attribute, @NotNull org.bukkit.attribute.AttributeModifier modifier) boolean
addEnchant
(@NotNull org.bukkit.enchantments.Enchantment ench, int level, boolean ignoreLevelRestriction) void
addItemFlags
(org.bukkit.inventory.ItemFlag... itemFlags) @NotNull org.bukkit.inventory.meta.ItemMeta
clone()
@Nullable net.kyori.adventure.text.Component
void
displayName
(@Nullable net.kyori.adventure.text.Component component) @Nullable com.google.common.collect.Multimap<org.bukkit.attribute.Attribute,
org.bukkit.attribute.AttributeModifier> @Nullable Collection<org.bukkit.attribute.AttributeModifier>
getAttributeModifiers
(@NotNull org.bukkit.attribute.Attribute attribute) @NotNull com.google.common.collect.Multimap<org.bukkit.attribute.Attribute,
org.bukkit.attribute.AttributeModifier> getAttributeModifiers
(@NotNull org.bukkit.inventory.EquipmentSlot slot) Set<org.bukkit.Material>
Set<org.bukkit.Material>
int
@NotNull org.bukkit.inventory.meta.tags.CustomItemTagContainer
@NotNull Set<com.destroystokyo.paper.Namespaced>
@NotNull net.md_5.bungee.api.chat.BaseComponent[]
int
getEnchantLevel
(@NotNull org.bukkit.enchantments.Enchantment ench) @NotNull Set<org.bukkit.inventory.ItemFlag>
@NotNull String
getLore()
@Nullable List<net.md_5.bungee.api.chat.BaseComponent[]>
@NotNull org.bukkit.persistence.PersistentDataContainer
@NotNull Set<com.destroystokyo.paper.Namespaced>
boolean
boolean
hasConflictingEnchant
(@NotNull org.bukkit.enchantments.Enchantment ench) boolean
boolean
boolean
boolean
hasEnchant
(@NotNull org.bukkit.enchantments.Enchantment ench) boolean
boolean
hasItemFlag
(@NotNull org.bukkit.inventory.ItemFlag itemFlag) boolean
boolean
hasLore()
boolean
boolean
isApplicable
(org.bukkit.Material material) Check whether this ItemMeta can be applied to the given material.boolean
@Nullable List<net.kyori.adventure.text.Component>
lore()
void
readNbtEnchants
(String name, CompoundTag tag) boolean
removeAttributeModifier
(@NotNull org.bukkit.attribute.Attribute attribute) boolean
removeAttributeModifier
(@NotNull org.bukkit.attribute.Attribute attribute, @NotNull org.bukkit.attribute.AttributeModifier modifier) boolean
removeAttributeModifier
(@NotNull org.bukkit.inventory.EquipmentSlot slot) boolean
removeEnchant
(@NotNull org.bukkit.enchantments.Enchantment ench) void
removeItemFlags
(org.bukkit.inventory.ItemFlag... itemFlags) protected static void
serializeEnchants
(String name, Map<String, Object> map, Map<org.bukkit.enchantments.Enchantment, Integer> enchants) void
setAttributeModifiers
(@Nullable com.google.common.collect.Multimap<org.bukkit.attribute.Attribute, org.bukkit.attribute.AttributeModifier> attributeModifiers) void
setCanDestroy
(Set<org.bukkit.Material> canDestroy) void
setCanPlaceOn
(Set<org.bukkit.Material> canPlaceOn) void
setCustomModelData
(@Nullable Integer integer) void
setDestroyableKeys
(@NotNull Collection<com.destroystokyo.paper.Namespaced> canDestroy) void
setDisplayName
(String displayName) void
setDisplayNameComponent
(@Nullable net.md_5.bungee.api.chat.BaseComponent[] baseComponents) void
setLocalizedName
(String name) void
void
setLoreComponents
(@Nullable List<net.md_5.bungee.api.chat.BaseComponent[]> list) void
setPlaceableKeys
(@NotNull Collection<com.destroystokyo.paper.Namespaced> canPlaceOn) void
setUnbreakable
(boolean unbreakable) void
setVersion
(int version) toString()
protected static void
writeNbtEnchants
(String name, CompoundTag to, Map<org.bukkit.enchantments.Enchantment, Integer> enchants)
-
Constructor Details
-
GlowMetaItem
public GlowMetaItem(org.bukkit.inventory.meta.ItemMeta meta) Create a GlowMetaItem, copying from another if possible.- Parameters:
meta
- The meta to copy from, or null.
-
-
Method Details
-
serializeEnchants
-
writeNbtEnchants
protected static void writeNbtEnchants(String name, CompoundTag to, Map<org.bukkit.enchantments.Enchantment, Integer> enchants) -
readNbtEnchants
protected static Map<org.bukkit.enchantments.Enchantment,Integer> readNbtEnchants(String name, CompoundTag tag) -
isApplicable
public boolean isApplicable(org.bukkit.Material material) Check whether this ItemMeta can be applied to the given material.- Parameters:
material
- The Material.- Returns:
- True if this ItemMeta is applicable.
-
getCanDestroy
- Specified by:
getCanDestroy
in interfaceorg.bukkit.inventory.meta.ItemMeta
-
setCanDestroy
- Specified by:
setCanDestroy
in interfaceorg.bukkit.inventory.meta.ItemMeta
-
getCanPlaceOn
- Specified by:
getCanPlaceOn
in interfaceorg.bukkit.inventory.meta.ItemMeta
-
setCanPlaceOn
- Specified by:
setCanPlaceOn
in interfaceorg.bukkit.inventory.meta.ItemMeta
-
getDestroyableKeys
- Specified by:
getDestroyableKeys
in interfaceorg.bukkit.inventory.meta.ItemMeta
-
setDestroyableKeys
public void setDestroyableKeys(@NotNull @NotNull Collection<com.destroystokyo.paper.Namespaced> canDestroy) - Specified by:
setDestroyableKeys
in interfaceorg.bukkit.inventory.meta.ItemMeta
-
getPlaceableKeys
- Specified by:
getPlaceableKeys
in interfaceorg.bukkit.inventory.meta.ItemMeta
-
setPlaceableKeys
public void setPlaceableKeys(@NotNull @NotNull Collection<com.destroystokyo.paper.Namespaced> canPlaceOn) - Specified by:
setPlaceableKeys
in interfaceorg.bukkit.inventory.meta.ItemMeta
-
hasPlaceableKeys
public boolean hasPlaceableKeys()- Specified by:
hasPlaceableKeys
in interfaceorg.bukkit.inventory.meta.ItemMeta
-
hasDestroyableKeys
public boolean hasDestroyableKeys()- Specified by:
hasDestroyableKeys
in interfaceorg.bukkit.inventory.meta.ItemMeta
-
serialize
- Specified by:
serialize
in interfaceorg.bukkit.configuration.serialization.ConfigurationSerializable
-
toString
-
hasDisplayName
public boolean hasDisplayName()- Specified by:
hasDisplayName
in interfaceorg.bukkit.inventory.meta.ItemMeta
-
displayName
@Nullable public @Nullable net.kyori.adventure.text.Component displayName()- Specified by:
displayName
in interfaceorg.bukkit.inventory.meta.ItemMeta
-
displayName
public void displayName(@Nullable @Nullable net.kyori.adventure.text.Component component) - Specified by:
displayName
in interfaceorg.bukkit.inventory.meta.ItemMeta
-
getDisplayNameComponent
@NotNull public @NotNull net.md_5.bungee.api.chat.BaseComponent[] getDisplayNameComponent()- Specified by:
getDisplayNameComponent
in interfaceorg.bukkit.inventory.meta.ItemMeta
-
setDisplayNameComponent
public void setDisplayNameComponent(@Nullable @Nullable net.md_5.bungee.api.chat.BaseComponent[] baseComponents) - Specified by:
setDisplayNameComponent
in interfaceorg.bukkit.inventory.meta.ItemMeta
-
hasLocalizedName
public boolean hasLocalizedName()- Specified by:
hasLocalizedName
in interfaceorg.bukkit.inventory.meta.ItemMeta
-
getLocalizedName
- Specified by:
getLocalizedName
in interfaceorg.bukkit.inventory.meta.ItemMeta
-
setLocalizedName
- Specified by:
setLocalizedName
in interfaceorg.bukkit.inventory.meta.ItemMeta
-
hasLore
public boolean hasLore()- Specified by:
hasLore
in interfaceorg.bukkit.inventory.meta.ItemMeta
-
lore
- Specified by:
lore
in interfaceorg.bukkit.inventory.meta.ItemMeta
-
lore
- Specified by:
lore
in interfaceorg.bukkit.inventory.meta.ItemMeta
-
getLore
- Specified by:
getLore
in interfaceorg.bukkit.inventory.meta.ItemMeta
-
getLoreComponents
- Specified by:
getLoreComponents
in interfaceorg.bukkit.inventory.meta.ItemMeta
-
setLore
- Specified by:
setLore
in interfaceorg.bukkit.inventory.meta.ItemMeta
-
setLoreComponents
public void setLoreComponents(@Nullable @Nullable List<net.md_5.bungee.api.chat.BaseComponent[]> list) - Specified by:
setLoreComponents
in interfaceorg.bukkit.inventory.meta.ItemMeta
-
hasCustomModelData
public boolean hasCustomModelData()- Specified by:
hasCustomModelData
in interfaceorg.bukkit.inventory.meta.ItemMeta
-
getCustomModelData
public int getCustomModelData()- Specified by:
getCustomModelData
in interfaceorg.bukkit.inventory.meta.ItemMeta
-
setCustomModelData
- Specified by:
setCustomModelData
in interfaceorg.bukkit.inventory.meta.ItemMeta
-
hasEnchants
public boolean hasEnchants()- Specified by:
hasEnchants
in interfaceorg.bukkit.inventory.meta.ItemMeta
-
hasEnchant
public boolean hasEnchant(@NotNull @NotNull org.bukkit.enchantments.Enchantment ench) - Specified by:
hasEnchant
in interfaceorg.bukkit.inventory.meta.ItemMeta
-
getEnchantLevel
public int getEnchantLevel(@NotNull @NotNull org.bukkit.enchantments.Enchantment ench) - Specified by:
getEnchantLevel
in interfaceorg.bukkit.inventory.meta.ItemMeta
-
getEnchants
- Specified by:
getEnchants
in interfaceorg.bukkit.inventory.meta.ItemMeta
-
addEnchant
public boolean addEnchant(@NotNull @NotNull org.bukkit.enchantments.Enchantment ench, int level, boolean ignoreLevelRestriction) - Specified by:
addEnchant
in interfaceorg.bukkit.inventory.meta.ItemMeta
-
removeEnchant
public boolean removeEnchant(@NotNull @NotNull org.bukkit.enchantments.Enchantment ench) - Specified by:
removeEnchant
in interfaceorg.bukkit.inventory.meta.ItemMeta
-
hasConflictingEnchant
public boolean hasConflictingEnchant(@NotNull @NotNull org.bukkit.enchantments.Enchantment ench) - Specified by:
hasConflictingEnchant
in interfaceorg.bukkit.inventory.meta.ItemMeta
-
clone
@NotNull public @NotNull org.bukkit.inventory.meta.ItemMeta clone() -
addItemFlags
public void addItemFlags(org.bukkit.inventory.ItemFlag... itemFlags) - Specified by:
addItemFlags
in interfaceorg.bukkit.inventory.meta.ItemMeta
-
removeItemFlags
public void removeItemFlags(org.bukkit.inventory.ItemFlag... itemFlags) - Specified by:
removeItemFlags
in interfaceorg.bukkit.inventory.meta.ItemMeta
-
getItemFlags
- Specified by:
getItemFlags
in interfaceorg.bukkit.inventory.meta.ItemMeta
-
hasItemFlag
public boolean hasItemFlag(@NotNull @NotNull org.bukkit.inventory.ItemFlag itemFlag) - Specified by:
hasItemFlag
in interfaceorg.bukkit.inventory.meta.ItemMeta
-
hasAttributeModifiers
public boolean hasAttributeModifiers()- Specified by:
hasAttributeModifiers
in interfaceorg.bukkit.inventory.meta.ItemMeta
-
getAttributeModifiers
@Nullable public @Nullable com.google.common.collect.Multimap<org.bukkit.attribute.Attribute,org.bukkit.attribute.AttributeModifier> getAttributeModifiers()- Specified by:
getAttributeModifiers
in interfaceorg.bukkit.inventory.meta.ItemMeta
-
getAttributeModifiers
@NotNull public @NotNull com.google.common.collect.Multimap<org.bukkit.attribute.Attribute,org.bukkit.attribute.AttributeModifier> getAttributeModifiers(@NotNull @NotNull org.bukkit.inventory.EquipmentSlot slot) - Specified by:
getAttributeModifiers
in interfaceorg.bukkit.inventory.meta.ItemMeta
-
getAttributeModifiers
@Nullable public @Nullable Collection<org.bukkit.attribute.AttributeModifier> getAttributeModifiers(@NotNull @NotNull org.bukkit.attribute.Attribute attribute) - Specified by:
getAttributeModifiers
in interfaceorg.bukkit.inventory.meta.ItemMeta
-
addAttributeModifier
public boolean addAttributeModifier(@NotNull @NotNull org.bukkit.attribute.Attribute attribute, @NotNull @NotNull org.bukkit.attribute.AttributeModifier modifier) - Specified by:
addAttributeModifier
in interfaceorg.bukkit.inventory.meta.ItemMeta
-
setAttributeModifiers
public void setAttributeModifiers(@Nullable @Nullable com.google.common.collect.Multimap<org.bukkit.attribute.Attribute, org.bukkit.attribute.AttributeModifier> attributeModifiers) - Specified by:
setAttributeModifiers
in interfaceorg.bukkit.inventory.meta.ItemMeta
-
removeAttributeModifier
public boolean removeAttributeModifier(@NotNull @NotNull org.bukkit.attribute.Attribute attribute) - Specified by:
removeAttributeModifier
in interfaceorg.bukkit.inventory.meta.ItemMeta
-
removeAttributeModifier
public boolean removeAttributeModifier(@NotNull @NotNull org.bukkit.inventory.EquipmentSlot slot) - Specified by:
removeAttributeModifier
in interfaceorg.bukkit.inventory.meta.ItemMeta
-
removeAttributeModifier
public boolean removeAttributeModifier(@NotNull @NotNull org.bukkit.attribute.Attribute attribute, @NotNull @NotNull org.bukkit.attribute.AttributeModifier modifier) - Specified by:
removeAttributeModifier
in interfaceorg.bukkit.inventory.meta.ItemMeta
-
getCustomTagContainer
@NotNull public @NotNull org.bukkit.inventory.meta.tags.CustomItemTagContainer getCustomTagContainer()- Specified by:
getCustomTagContainer
in interfaceorg.bukkit.inventory.meta.ItemMeta
-
setVersion
public void setVersion(int version) - Specified by:
setVersion
in interfaceorg.bukkit.inventory.meta.ItemMeta
-
getPersistentDataContainer
@NotNull public @NotNull org.bukkit.persistence.PersistentDataContainer getPersistentDataContainer()- Specified by:
getPersistentDataContainer
in interfaceorg.bukkit.persistence.PersistentDataHolder
-
getDisplayName
- Specified by:
getDisplayName
in interfaceorg.bukkit.inventory.meta.ItemMeta
-
setDisplayName
- Specified by:
setDisplayName
in interfaceorg.bukkit.inventory.meta.ItemMeta
-
isUnbreakable
public boolean isUnbreakable()- Specified by:
isUnbreakable
in interfaceorg.bukkit.inventory.meta.ItemMeta
-
setUnbreakable
public void setUnbreakable(boolean unbreakable) - Specified by:
setUnbreakable
in interfaceorg.bukkit.inventory.meta.ItemMeta
-