类 EnchantmentWrapper

java.lang.Object
org.bukkit.enchantments.Enchantment
org.bukkit.enchantments.EnchantmentWrapper

public class EnchantmentWrapper extends Enchantment
方便选择Enchantments的一个简单的封装类。

大多数方法于Enchantment

  • 构造器详细资料

    • EnchantmentWrapper

      public EnchantmentWrapper(int id)
  • 方法详细资料

    • getEnchantment

      public Enchantment getEnchantment()
      得到这个包装类所对应的的附魔.

      原文:Gets the enchantment bound to this wrapper

      返回:
      附魔
    • getMaxLevel

      public int getMaxLevel()
      从类复制的说明: Enchantment
      得到这个附魔所支持的最大等级.

      原文: Gets the maximum level that this Enchantment may become.

      指定者:
      getMaxLevel 在类中 Enchantment
      返回:
      这个附魔的最大等级
    • getStartLevel

      public int getStartLevel()
      从类复制的说明: Enchantment
      得到这个附魔的最小等级.

      原文: Gets the level that this Enchantment should start at

      指定者:
      getStartLevel 在类中 Enchantment
      返回:
      这个附魔最小等级
    • getItemTarget

      public EnchantmentTarget getItemTarget()
      从类复制的说明: Enchantment
      得到这个附魔所支持的 物品 ItemStack.

      原文: Gets the type of ItemStack that may fit this Enchantment.

      指定者:
      getItemTarget 在类中 Enchantment
      返回:
      这个附魔的目标物品.
    • canEnchantItem

      public boolean canEnchantItem(ItemStack item)
      从类复制的说明: Enchantment
      检查该附魔支不支持某物品.

      这并不检查任何物品上与它冲突的附魔。

      原文:Checks if this Enchantment may be applied to the given ItemStack.

      This does not check if it conflicts with any enchantments already applied to the item.

      指定者:
      canEnchantItem 在类中 Enchantment
      参数:
      item - 物品
      返回:
      True 如果该附魔适用该物品,则返回true。
    • getName

      public String getName()
      从类复制的说明: Enchantment
      得到这个附魔的名称.

      原文: Gets the unique name of this enchantment

      指定者:
      getName 在类中 Enchantment
      返回:
      独一无二的名称
    • isTreasure

      public boolean isTreasure()
      从类复制的说明: Enchantment
      Checks if this enchantment is a treasure enchantment.
      Treasure enchantments can only be received via looting, trading, or fishing.
      指定者:
      isTreasure 在类中 Enchantment
      返回:
      true if the enchantment is a treasure enchantment
    • isCursed

      public boolean isCursed()
      从类复制的说明: Enchantment
      Checks if this enchantment is a cursed enchantment
      Cursed enchantments are found the same way treasure enchantments are
      指定者:
      isCursed 在类中 Enchantment
      返回:
      true if the enchantment is cursed
    • conflictsWith

      public boolean conflictsWith(Enchantment other)
      从类复制的说明: Enchantment
      检查这个附魔是否与另外的附魔冲突.

      原文: Check if this enchantment conflicts with another enchantment.

      指定者:
      conflictsWith 在类中 Enchantment
      参数:
      other - 另外一个附魔
      返回:
      如果这两个附魔是冲突的则返回true