public interface EnchantmentStorageMeta extends ItemMeta
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.
|
EnchantmentStorageMeta |
clone() |
int |
getStoredEnchantLevel(Enchantment ench)
Checks for the level of the stored enchantment.
|
java.util.Map<Enchantment,java.lang.Integer> |
getStoredEnchants()
获取在ItemMeta存储的附魔的副本.
|
boolean |
hasConflictingStoredEnchant(Enchantment ench)
检测指定的附魔是否与任何ItemMeta里的附魔冲突.
|
boolean |
hasStoredEnchant(Enchantment ench)
Checks for storage of the specified enchantment.
|
boolean |
hasStoredEnchants()
检测是否存在任何附魔.
|
boolean |
removeStoredEnchant(Enchantment ench)
Remove the specified stored enchantment from this item meta.
|
addEnchant, addItemFlags, getDisplayName, getEnchantLevel, getEnchants, getItemFlags, getLocalizedName, getLore, hasConflictingEnchant, hasDisplayName, hasEnchant, hasEnchants, hasItemFlag, hasLocalizedName, hasLore, isUnbreakable, removeEnchant, removeItemFlags, setDisplayName, setLocalizedName, setLore, setUnbreakable
serialize
boolean hasStoredEnchants()
原文:Checks for the existence of any stored enchantments.
boolean hasStoredEnchant(Enchantment ench)
ench
- enchantment to checkint getStoredEnchantLevel(Enchantment ench)
ench
- enchantment to checkjava.util.Map<Enchantment,java.lang.Integer> getStoredEnchants()
原文:Gets a copy the stored enchantments in this ItemMeta.
boolean addStoredEnchant(Enchantment ench, int level, boolean ignoreLevelRestriction)
ench
- Enchantment to storelevel
- Level for the enchantmentignoreLevelRestriction
- this indicates the enchantment should be
applied, ignoring the level limitjava.lang.IllegalArgumentException
- if enchantment is nullboolean removeStoredEnchant(Enchantment ench) throws java.lang.IllegalArgumentException
ench
- Enchantment to removejava.lang.IllegalArgumentException
- if enchantment is nullboolean hasConflictingStoredEnchant(Enchantment ench)
原文:Checks if the specified enchantment conflicts with any enchantments in this ItemMeta.
ench
- 要检测的附魔EnchantmentStorageMeta clone()