接口 EnchantmentStorageMeta
- 所有超级接口:
Cloneable
,ConfigurationSerializable
,ItemMeta
EnchantmentMeta is specific to items that can store enchantments, as
opposed to being enchanted.
Material.ENCHANTED_BOOK
is an example
of an item with enchantment storage.-
方法概要
修饰符和类型方法说明boolean
addStoredEnchant
(Enchantment ench, int level, boolean ignoreLevelRestriction) Stores the specified enchantment in this item meta.clone()
int
Checks for the level of the stored enchantment.获取在ItemMeta存储的附魔的副本.boolean
检测指定的附魔是否与任何ItemMeta里的附魔冲突.boolean
hasStoredEnchant
(Enchantment ench) Checks for storage of the specified enchantment.boolean
检测是否存在任何附魔.boolean
Remove the specified stored enchantment from this item meta.从接口继承的方法 org.bukkit.configuration.serialization.ConfigurationSerializable
serialize
从接口继承的方法 org.bukkit.inventory.meta.ItemMeta
addEnchant, addItemFlags, getDisplayName, getEnchantLevel, getEnchants, getItemFlags, getLocalizedName, getLore, hasConflictingEnchant, hasDisplayName, hasEnchant, hasEnchants, hasItemFlag, hasLocalizedName, hasLore, isUnbreakable, removeEnchant, removeItemFlags, setDisplayName, setLocalizedName, setLore, setUnbreakable
-
方法详细资料
-
hasStoredEnchants
boolean hasStoredEnchants()检测是否存在任何附魔.原文:Checks for the existence of any stored enchantments.
- 返回:
- 这个meta是否存在一个附魔
-
hasStoredEnchant
Checks for storage of the specified enchantment.- 参数:
ench
- enchantment to check- 返回:
- true if this enchantment is stored in this meta
-
getStoredEnchantLevel
Checks for the level of the stored enchantment.- 参数:
ench
- enchantment to check- 返回:
- The level that the specified stored enchantment has, or 0 if none
-
getStoredEnchants
Map<Enchantment,Integer> getStoredEnchants()获取在ItemMeta存储的附魔的副本.原文:Gets a copy the stored enchantments in this ItemMeta.
- 返回:
- 一个不可变的存储的附魔的副本
-
addStoredEnchant
Stores the specified enchantment in this item meta.- 参数:
ench
- Enchantment to storelevel
- Level for the enchantmentignoreLevelRestriction
- this indicates the enchantment should be applied, ignoring the level limit- 返回:
- true if the item meta changed as a result of this call, false otherwise
- 抛出:
IllegalArgumentException
- if enchantment is null
-
removeStoredEnchant
Remove the specified stored enchantment from this item meta.- 参数:
ench
- Enchantment to remove- 返回:
- true if the item meta changed as a result of this call, false otherwise
- 抛出:
IllegalArgumentException
- if enchantment is null
-
hasConflictingStoredEnchant
检测指定的附魔是否与任何ItemMeta里的附魔冲突.原文:Checks if the specified enchantment conflicts with any enchantments in this ItemMeta.
- 参数:
ench
- 要检测的附魔- 返回:
- 附魔是否与任何ItemMeta里的附魔冲突
-
clone
EnchantmentStorageMeta clone()
-