类 EnchantmentWrapper

java.lang.Object
org.bukkit.enchantments.Enchantment
org.bukkit.enchantments.EnchantmentWrapper
所有已实现的接口:
Keyed

public class EnchantmentWrapper extends Enchantment
方便选择Enchantment的一个简单的封装类.
  • 构造器详细资料

  • 方法详细资料

    • getEnchantment

      @NotNull public @NotNull 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

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

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

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

      public boolean canEnchantItem(@NotNull @NotNull 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。
    • getName

      @NotNull public @NotNull 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
      返回:
      是否为宝藏附魔
    • 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
      返回:
      是否为诅咒附魔
    • conflictsWith

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

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

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