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 TypeMethodDescriptionbooleanaddAttributeModifier(@NotNull org.bukkit.attribute.Attribute attribute, @NotNull org.bukkit.attribute.AttributeModifier modifier) booleanaddEnchant(@NotNull org.bukkit.enchantments.Enchantment ench, int level, boolean ignoreLevelRestriction) voidaddItemFlags(org.bukkit.inventory.ItemFlag... itemFlags) @NotNull org.bukkit.inventory.meta.ItemMetaclone()@Nullable net.kyori.adventure.text.ComponentvoiddisplayName(@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[]intgetEnchantLevel(@NotNull org.bukkit.enchantments.Enchantment ench) @NotNull Set<org.bukkit.inventory.ItemFlag>@NotNull StringgetLore()@Nullable List<net.md_5.bungee.api.chat.BaseComponent[]>@NotNull org.bukkit.persistence.PersistentDataContainer@NotNull Set<com.destroystokyo.paper.Namespaced>booleanbooleanhasConflictingEnchant(@NotNull org.bukkit.enchantments.Enchantment ench) booleanbooleanbooleanbooleanhasEnchant(@NotNull org.bukkit.enchantments.Enchantment ench) booleanbooleanhasItemFlag(@NotNull org.bukkit.inventory.ItemFlag itemFlag) booleanbooleanhasLore()booleanbooleanisApplicable(org.bukkit.Material material) Check whether this ItemMeta can be applied to the given material.boolean@Nullable List<net.kyori.adventure.text.Component>lore()voidreadNbtEnchants(String name, CompoundTag tag) booleanremoveAttributeModifier(@NotNull org.bukkit.attribute.Attribute attribute) booleanremoveAttributeModifier(@NotNull org.bukkit.attribute.Attribute attribute, @NotNull org.bukkit.attribute.AttributeModifier modifier) booleanremoveAttributeModifier(@NotNull org.bukkit.inventory.EquipmentSlot slot) booleanremoveEnchant(@NotNull org.bukkit.enchantments.Enchantment ench) voidremoveItemFlags(org.bukkit.inventory.ItemFlag... itemFlags) protected static voidserializeEnchants(String name, Map<String, Object> map, Map<org.bukkit.enchantments.Enchantment, Integer> enchants) voidsetAttributeModifiers(@Nullable com.google.common.collect.Multimap<org.bukkit.attribute.Attribute, org.bukkit.attribute.AttributeModifier> attributeModifiers) voidsetCanDestroy(Set<org.bukkit.Material> canDestroy) voidsetCanPlaceOn(Set<org.bukkit.Material> canPlaceOn) voidsetCustomModelData(@Nullable Integer integer) voidsetDestroyableKeys(@NotNull Collection<com.destroystokyo.paper.Namespaced> canDestroy) voidsetDisplayName(String displayName) voidsetDisplayNameComponent(@Nullable net.md_5.bungee.api.chat.BaseComponent[] baseComponents) voidsetLocalizedName(String name) voidvoidsetLoreComponents(@Nullable List<net.md_5.bungee.api.chat.BaseComponent[]> list) voidsetPlaceableKeys(@NotNull Collection<com.destroystokyo.paper.Namespaced> canPlaceOn) voidsetUnbreakable(boolean unbreakable) voidsetVersion(int version) toString()protected static voidwriteNbtEnchants(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:
getCanDestroyin interfaceorg.bukkit.inventory.meta.ItemMeta
-
setCanDestroy
- Specified by:
setCanDestroyin interfaceorg.bukkit.inventory.meta.ItemMeta
-
getCanPlaceOn
- Specified by:
getCanPlaceOnin interfaceorg.bukkit.inventory.meta.ItemMeta
-
setCanPlaceOn
- Specified by:
setCanPlaceOnin interfaceorg.bukkit.inventory.meta.ItemMeta
-
getDestroyableKeys
- Specified by:
getDestroyableKeysin interfaceorg.bukkit.inventory.meta.ItemMeta
-
setDestroyableKeys
public void setDestroyableKeys(@NotNull @NotNull Collection<com.destroystokyo.paper.Namespaced> canDestroy) - Specified by:
setDestroyableKeysin interfaceorg.bukkit.inventory.meta.ItemMeta
-
getPlaceableKeys
- Specified by:
getPlaceableKeysin interfaceorg.bukkit.inventory.meta.ItemMeta
-
setPlaceableKeys
public void setPlaceableKeys(@NotNull @NotNull Collection<com.destroystokyo.paper.Namespaced> canPlaceOn) - Specified by:
setPlaceableKeysin interfaceorg.bukkit.inventory.meta.ItemMeta
-
hasPlaceableKeys
public boolean hasPlaceableKeys()- Specified by:
hasPlaceableKeysin interfaceorg.bukkit.inventory.meta.ItemMeta
-
hasDestroyableKeys
public boolean hasDestroyableKeys()- Specified by:
hasDestroyableKeysin interfaceorg.bukkit.inventory.meta.ItemMeta
-
serialize
- Specified by:
serializein interfaceorg.bukkit.configuration.serialization.ConfigurationSerializable
-
toString
-
hasDisplayName
public boolean hasDisplayName()- Specified by:
hasDisplayNamein interfaceorg.bukkit.inventory.meta.ItemMeta
-
displayName
@Nullable public @Nullable net.kyori.adventure.text.Component displayName()- Specified by:
displayNamein interfaceorg.bukkit.inventory.meta.ItemMeta
-
displayName
public void displayName(@Nullable @Nullable net.kyori.adventure.text.Component component) - Specified by:
displayNamein interfaceorg.bukkit.inventory.meta.ItemMeta
-
getDisplayNameComponent
@NotNull public @NotNull net.md_5.bungee.api.chat.BaseComponent[] getDisplayNameComponent()- Specified by:
getDisplayNameComponentin interfaceorg.bukkit.inventory.meta.ItemMeta
-
setDisplayNameComponent
public void setDisplayNameComponent(@Nullable @Nullable net.md_5.bungee.api.chat.BaseComponent[] baseComponents) - Specified by:
setDisplayNameComponentin interfaceorg.bukkit.inventory.meta.ItemMeta
-
hasLocalizedName
public boolean hasLocalizedName()- Specified by:
hasLocalizedNamein interfaceorg.bukkit.inventory.meta.ItemMeta
-
getLocalizedName
- Specified by:
getLocalizedNamein interfaceorg.bukkit.inventory.meta.ItemMeta
-
setLocalizedName
- Specified by:
setLocalizedNamein interfaceorg.bukkit.inventory.meta.ItemMeta
-
hasLore
public boolean hasLore()- Specified by:
hasLorein interfaceorg.bukkit.inventory.meta.ItemMeta
-
lore
- Specified by:
lorein interfaceorg.bukkit.inventory.meta.ItemMeta
-
lore
- Specified by:
lorein interfaceorg.bukkit.inventory.meta.ItemMeta
-
getLore
- Specified by:
getLorein interfaceorg.bukkit.inventory.meta.ItemMeta
-
getLoreComponents
- Specified by:
getLoreComponentsin interfaceorg.bukkit.inventory.meta.ItemMeta
-
setLore
- Specified by:
setLorein interfaceorg.bukkit.inventory.meta.ItemMeta
-
setLoreComponents
public void setLoreComponents(@Nullable @Nullable List<net.md_5.bungee.api.chat.BaseComponent[]> list) - Specified by:
setLoreComponentsin interfaceorg.bukkit.inventory.meta.ItemMeta
-
hasCustomModelData
public boolean hasCustomModelData()- Specified by:
hasCustomModelDatain interfaceorg.bukkit.inventory.meta.ItemMeta
-
getCustomModelData
public int getCustomModelData()- Specified by:
getCustomModelDatain interfaceorg.bukkit.inventory.meta.ItemMeta
-
setCustomModelData
- Specified by:
setCustomModelDatain interfaceorg.bukkit.inventory.meta.ItemMeta
-
hasEnchants
public boolean hasEnchants()- Specified by:
hasEnchantsin interfaceorg.bukkit.inventory.meta.ItemMeta
-
hasEnchant
public boolean hasEnchant(@NotNull @NotNull org.bukkit.enchantments.Enchantment ench) - Specified by:
hasEnchantin interfaceorg.bukkit.inventory.meta.ItemMeta
-
getEnchantLevel
public int getEnchantLevel(@NotNull @NotNull org.bukkit.enchantments.Enchantment ench) - Specified by:
getEnchantLevelin interfaceorg.bukkit.inventory.meta.ItemMeta
-
getEnchants
- Specified by:
getEnchantsin interfaceorg.bukkit.inventory.meta.ItemMeta
-
addEnchant
public boolean addEnchant(@NotNull @NotNull org.bukkit.enchantments.Enchantment ench, int level, boolean ignoreLevelRestriction) - Specified by:
addEnchantin interfaceorg.bukkit.inventory.meta.ItemMeta
-
removeEnchant
public boolean removeEnchant(@NotNull @NotNull org.bukkit.enchantments.Enchantment ench) - Specified by:
removeEnchantin interfaceorg.bukkit.inventory.meta.ItemMeta
-
hasConflictingEnchant
public boolean hasConflictingEnchant(@NotNull @NotNull org.bukkit.enchantments.Enchantment ench) - Specified by:
hasConflictingEnchantin 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:
addItemFlagsin interfaceorg.bukkit.inventory.meta.ItemMeta
-
removeItemFlags
public void removeItemFlags(org.bukkit.inventory.ItemFlag... itemFlags) - Specified by:
removeItemFlagsin interfaceorg.bukkit.inventory.meta.ItemMeta
-
getItemFlags
- Specified by:
getItemFlagsin interfaceorg.bukkit.inventory.meta.ItemMeta
-
hasItemFlag
public boolean hasItemFlag(@NotNull @NotNull org.bukkit.inventory.ItemFlag itemFlag) - Specified by:
hasItemFlagin interfaceorg.bukkit.inventory.meta.ItemMeta
-
hasAttributeModifiers
public boolean hasAttributeModifiers()- Specified by:
hasAttributeModifiersin 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:
getAttributeModifiersin 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:
getAttributeModifiersin interfaceorg.bukkit.inventory.meta.ItemMeta
-
getAttributeModifiers
@Nullable public @Nullable Collection<org.bukkit.attribute.AttributeModifier> getAttributeModifiers(@NotNull @NotNull org.bukkit.attribute.Attribute attribute) - Specified by:
getAttributeModifiersin 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:
addAttributeModifierin 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:
setAttributeModifiersin interfaceorg.bukkit.inventory.meta.ItemMeta
-
removeAttributeModifier
public boolean removeAttributeModifier(@NotNull @NotNull org.bukkit.attribute.Attribute attribute) - Specified by:
removeAttributeModifierin interfaceorg.bukkit.inventory.meta.ItemMeta
-
removeAttributeModifier
public boolean removeAttributeModifier(@NotNull @NotNull org.bukkit.inventory.EquipmentSlot slot) - Specified by:
removeAttributeModifierin 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:
removeAttributeModifierin interfaceorg.bukkit.inventory.meta.ItemMeta
-
getCustomTagContainer
@NotNull public @NotNull org.bukkit.inventory.meta.tags.CustomItemTagContainer getCustomTagContainer()- Specified by:
getCustomTagContainerin interfaceorg.bukkit.inventory.meta.ItemMeta
-
setVersion
public void setVersion(int version) - Specified by:
setVersionin interfaceorg.bukkit.inventory.meta.ItemMeta
-
getPersistentDataContainer
@NotNull public @NotNull org.bukkit.persistence.PersistentDataContainer getPersistentDataContainer()- Specified by:
getPersistentDataContainerin interfaceorg.bukkit.persistence.PersistentDataHolder
-
getDisplayName
- Specified by:
getDisplayNamein interfaceorg.bukkit.inventory.meta.ItemMeta
-
setDisplayName
- Specified by:
setDisplayNamein interfaceorg.bukkit.inventory.meta.ItemMeta
-
isUnbreakable
public boolean isUnbreakable()- Specified by:
isUnbreakablein interfaceorg.bukkit.inventory.meta.ItemMeta
-
setUnbreakable
public void setUnbreakable(boolean unbreakable) - Specified by:
setUnbreakablein interfaceorg.bukkit.inventory.meta.ItemMeta
-