程序包 org.bukkit.inventory.meta

# 接口 EnchantmentStorageMeta

所有超级接口:
  `Cloneable`, `ConfigurationSerializable`, `ItemMeta`, `PersistentDataHolder`

public interface EnchantmentStorageMeta extends ItemMeta
EnchantmentMeta 特定于专门存储附魔的物品, 而非被附魔的物品. `附魔书` 就是一个可存储附魔的物品的例子.

- ## 方法概要

  修饰符和类型
  方法
  说明
  `boolean`
  `addStoredEnchant(@NotNull Enchantment ench, int level, boolean ignoreLevelRestriction)`
  向本物品存放一个指定的附魔.
  `@NotNull EnchantmentStorageMeta`
  `clone()`
  `int`
  `getStoredEnchantLevel(@NotNull Enchantment ench)`
  检测指定附魔的等级.
  `@NotNull Map<Enchantment,Integer>`
  `getStoredEnchants()`
  获取在ItemMeta存储的附魔的副本.
  `boolean`
  `hasConflictingStoredEnchant(@NotNull Enchantment ench)`
  检测指定的附魔是否与任何 ItemMeta 里的附魔冲突.
  `boolean`
  `hasStoredEnchant(@NotNull Enchantment ench)`
  检测是否存储特定的附魔.
  `boolean`
  `hasStoredEnchants()`
  检测是否存在任何附魔.
  `boolean`
  `removeStoredEnchant(@NotNull Enchantment ench)`
  移除物品上指定的附魔.

  ### 从接口继承的方法 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

    boolean hasStoredEnchant(@NotNull @NotNull Enchantment ench)
    检测是否存储特定的附魔.

    原文:Checks for storage of the specified enchantment.

    参数:
      `ench` - 要检测的附魔
    返回:
      若此附魔存放于本 meta 中返回 true

  - ### getStoredEnchantLevel

    int getStoredEnchantLevel(@NotNull @NotNull Enchantment ench)
    检测指定附魔的等级.

    原文:Checks for the level of the stored enchantment.

    参数:
      `ench` - 要检测的附魔
    返回:
      附魔等级, 0 代表不存在此附魔

  - ### getStoredEnchants

    @NotNull @NotNull Map<Enchantment,Integer> 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

    boolean removeStoredEnchant(@NotNull @NotNull Enchantment ench) throws IllegalArgumentException
    移除物品上指定的附魔.

    原文:Remove the specified stored enchantment from this item meta.

    参数:
      `ench` - 要移除的附魔
    返回:
      移除附魔成功返回 true, false反之
    抛出:
      `IllegalArgumentException` - 若指定附魔为 null

  - ### hasConflictingStoredEnchant

    boolean hasConflictingStoredEnchant(@NotNull @NotNull Enchantment ench)
    检测指定的附魔是否与任何 ItemMeta 里的附魔冲突.

    原文:Checks if the specified enchantment conflicts with any enchantments in this ItemMeta.

    参数:
      `ench` - 要检测的附魔
    返回:
      有冲突的附魔返回 true, false 反之

  - ### clone

    @NotNull @NotNull EnchantmentStorageMeta clone()
    指定者:
      `clone` 在接口中 `ItemMeta`