java.lang.Cloneable
, ConfigurationSerializable
, ItemMeta
public interface EnchantmentStorageMeta extends ItemMeta
Material.ENCHANTED_BOOK
is an example
of an item with enchantment storage.ItemMeta.Spigot
Modifier and Type | Method | Description |
---|---|---|
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() |
Gets a copy the stored enchantments in this ItemMeta.
|
boolean |
hasConflictingStoredEnchant(Enchantment ench) |
Checks if the specified enchantment conflicts with any enchantments in
this ItemMeta.
|
boolean |
hasStoredEnchant(Enchantment ench) |
Checks for storage of the specified enchantment.
|
boolean |
hasStoredEnchants() |
Checks for the existence of any stored enchantments.
|
boolean |
removeStoredEnchant(Enchantment ench) |
Remove the specified stored enchantment from this item meta.
|
serialize
addEnchant, addItemFlags, getDisplayName, getEnchantLevel, getEnchants, getItemFlags, getLocalizedName, getLore, hasConflictingEnchant, hasDisplayName, hasEnchant, hasEnchants, hasItemFlag, hasLocalizedName, hasLore, isUnbreakable, removeEnchant, removeItemFlags, setDisplayName, setLocalizedName, setLore, setUnbreakable, spigot
boolean hasStoredEnchants()
boolean hasStoredEnchant(Enchantment ench)
ench
- enchantment to checkint getStoredEnchantLevel(Enchantment ench)
ench
- enchantment to checkjava.util.Map<Enchantment,java.lang.Integer> getStoredEnchants()
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)
ench
- enchantment to testEnchantmentStorageMeta clone()
Copyright © 2018. All rights reserved.