接口 EnchantmentStorageMeta
EnchantmentMeta 特定于专门存储附魔的物品, 而非被附魔的物品.
附魔书
就是一个可存储附魔的物品的例子.-
方法概要
修饰符和类型方法说明boolean
addStoredEnchant
(@NotNull Enchantment ench, int level, boolean ignoreLevelRestriction) 向本物品存放一个指定的附魔.clone()
int
检测指定附魔的等级.获取在ItemMeta存储的附魔的副本.boolean
检测指定的附魔是否与任何 ItemMeta 里的附魔冲突.boolean
检测是否存储特定的附魔.boolean
检测是否存在任何附魔.boolean
移除物品上指定的附魔.从接口继承的方法 org.bukkit.configuration.serialization.ConfigurationSerializable
serialize
从接口继承的方法 org.bukkit.inventory.meta.ItemMeta
addAttributeModifier, addEnchant, addItemFlags, getAsComponentString, getAsString, getAttributeModifiers, getAttributeModifiers, getAttributeModifiers, getCustomModelData, getCustomTagContainer, getDisplayName, getEnchantLevel, getEnchantmentGlintOverride, getEnchants, getFood, getItemFlags, getItemName, getJukeboxPlayable, getLocalizedName, getLore, getMaxStackSize, getRarity, getTool, hasAttributeModifiers, hasConflictingEnchant, hasCustomModelData, hasDisplayName, hasEnchant, hasEnchantmentGlintOverride, hasEnchants, hasFood, hasItemFlag, hasItemName, hasJukeboxPlayable, hasLocalizedName, hasLore, hasMaxStackSize, hasRarity, hasTool, isFireResistant, isHideTooltip, isUnbreakable, removeAttributeModifier, removeAttributeModifier, removeAttributeModifier, removeEnchant, removeEnchantments, removeItemFlags, setAttributeModifiers, setCustomModelData, setDisplayName, setEnchantmentGlintOverride, setFireResistant, setFood, setHideTooltip, setItemName, setJukeboxPlayable, setLocalizedName, setLore, setMaxStackSize, setRarity, setTool, setUnbreakable, setVersion
从接口继承的方法 org.bukkit.persistence.PersistentDataHolder
getPersistentDataContainer
-
方法详细资料
-
hasStoredEnchants
boolean hasStoredEnchants()检测是否存在任何附魔.原文:Checks for the existence of any stored enchantments.
- 返回:
- 这个meta是否存在一个附魔
-
hasStoredEnchant
检测是否存储特定的附魔.原文:Checks for storage of the specified enchantment.
- 参数:
ench
- 要检测的附魔- 返回:
- 若此附魔存放于本 meta 中返回 true
-
getStoredEnchantLevel
检测指定附魔的等级.原文:Checks for the level of the stored enchantment.
- 参数:
ench
- 要检测的附魔- 返回:
- 附魔等级, 0 代表不存在此附魔
-
getStoredEnchants
获取在ItemMeta存储的附魔的副本.原文:Gets a copy the stored enchantments in this ItemMeta.
- 返回:
- 一个不可变的存储的附魔的副本
-
addStoredEnchant
boolean addStoredEnchant(@NotNull @NotNull Enchantment ench, int level, boolean ignoreLevelRestriction) 向本物品存放一个指定的附魔.原文:Stores the specified enchantment in this item meta.
- 参数:
ench
- 要存储的附魔level
- 附魔等级ignoreLevelRestriction
- 是否忽略附魔的等级限制- 返回:
- 添加附魔成功返回 true, false反之
- 抛出:
IllegalArgumentException
- 若指定附魔为 null
-
removeStoredEnchant
移除物品上指定的附魔.原文:Remove the specified stored enchantment from this item meta.
- 参数:
ench
- 要移除的附魔- 返回:
- 移除附魔成功返回 true, false反之
- 抛出:
IllegalArgumentException
- 若指定附魔为 null
-
hasConflictingStoredEnchant
检测指定的附魔是否与任何 ItemMeta 里的附魔冲突.原文:Checks if the specified enchantment conflicts with any enchantments in this ItemMeta.
- 参数:
ench
- 要检测的附魔- 返回:
- 有冲突的附魔返回 true, false 反之
-
clone
-