类 Potion

java.lang.Object
org.bukkit.potion.Potion

@Deprecated public class Potion extends Object
已过时。
用于1.9版本之前的数据值的药水适配器. 1.9+版本见PotionMeta.
  • 构造器详细资料

    • Potion

      public Potion(@NotNull @NotNull PotionType type)
      已过时。
      根据指定药水种类创建新药水. 除非此药水种类为药水瓶, 级别将被设置为 1, 无持续时间的延长. 除了药水瓶, 不要使用此构造器创建无效果的药水.

      原文:Construct a new potion of the given type. Unless the type is PotionType.WATER, it will be level one, without extended duration. Don't use this constructor to create a no-effect potion other than water bottle.

      参数:
      type - The potion type
    • Potion

      public Potion(@NotNull @NotNull PotionType type, int level)
      已过时。
      根据指定药水种类和级别创建新药水.

      原文:Create a new potion of the given type and level.

      参数:
      type - 药水种类
      level - 药水级别
    • Potion

      @Deprecated public Potion(@NotNull @NotNull PotionType type, int level, boolean splash)
      已过时。
      赞成使用 Potion(PotionType) 并调用 splash().
      根据指定药水种类和级别创建新药水.

      原文:Create a new potion of the given type and level.

      参数:
      type - 药水种类
      level - 药水级别
      splash - 是否为喷溅型药水
    • Potion

      @Deprecated public Potion(@NotNull @NotNull PotionType type, int level, boolean splash, boolean extended)
      已过时。
      赞成使用 Potion(PotionType) 并调用 extend()splash() (若需要).
      根据指定药水种类和级别创建新药水.

      原文:Create a new potion of the given type and level.

      参数:
      type - 药水种类
      level - 药水级别
      splash - 是否为喷溅型药水
      extended - 是否为延长版药水
  • 方法详细资料

    • splash

      @NotNull public @NotNull Potion splash()
      已过时。
      将药水改为喷溅型, 并返回自身用于链式调用.

      原文:Chain this to the constructor to make the potion a splash potion.

      返回:
      药水对象
    • extend

      @NotNull public @NotNull Potion extend()
      已过时。
      延长药水持续时间, 并返回自身用于链式调用.

      原文:Chain this to the constructor to extend the potion's duration.

      返回:
      药水对象
    • apply

      public void apply(@NotNull @NotNull ItemStack to)
      已过时。
      将此药水的状态效果应用于指定物品堆. 此物品堆必须为药水.

      原文:Applies the effects of this potion to the given ItemStack. The ItemStack must be a potion.

      参数:
      to - 物品堆
    • apply

      public void apply(@NotNull @NotNull LivingEntity to)
      已过时。
      将此药水的状态效果应用于指定实体.

      原文:Applies the effects that would be applied by this potion to the given LivingEntity.

      参数:
      to - 应用于哪个实体
      另请参阅:
    • equals

      public boolean equals(Object obj)
      已过时。
      覆盖:
      equals 在类中 Object
    • getEffects

      @NotNull public @NotNull Collection<PotionEffect> getEffects()
      已过时。
      返回此药水应用于实体后的效果的列表.

      原文:Returns a collection of PotionEffects that this Potion would confer upon a LivingEntity.

      返回:
      此药水应用后的效果
      另请参阅:
    • getLevel

      public int getLevel()
      已过时。
      返回此药水的级别.

      原文:Returns the level of this potion.

      返回:
      药水级别
    • getType

      @NotNull public @NotNull PotionType getType()
      已过时。
      返回此药水的种类.

      原文:Returns the PotionType of this potion.

      返回:
      药水的种类
    • hasExtendedDuration

      public boolean hasExtendedDuration()
      已过时。
      返回此药水的时长是否可延长.

      原文:Returns whether this potion has an extended duration.

      返回:
      是否有延长版本的药水
    • hashCode

      public int hashCode()
      已过时。
      覆盖:
      hashCode 在类中 Object
    • isSplash

      public boolean isSplash()
      已过时。
      返回是否为喷溅型药水.

      原文:Returns whether this potion is a splash potion.

      返回:
      是否为喷溅型药水
    • setHasExtendedDuration

      public void setHasExtendedDuration(boolean isExtended)
      已过时。
      设置此药水是否延长持续时间. 这将导致此药水相比常规版本有约3/8倍的持续时间.

      原文:Set whether this potion has extended duration. This will cause the potion to have roughly 8/3 more duration than a regular potion.

      参数:
      isExtended - 是否延长持续时间
    • setSplash

      public void setSplash(boolean isSplash)
      已过时。
      设置此药水是否为喷溅型药水. 喷溅型药水可作用于一定的范围.

      原文:Sets whether this potion is a splash potion. Splash potions can be thrown for a radius effect.

      参数:
      isSplash - 是否为喷溅型药水
    • setType

      public void setType(@NotNull @NotNull PotionType type)
      已过时。
      设置药水的种类.

      原文:Sets the PotionType of this potion.

      参数:
      type - 药水的种类
    • setLevel

      public void setLevel(int level)
      已过时。
      设置药水的级别.

      原文:Sets the level of this potion.

      参数:
      level - 药水级别
    • toDamageValue

      @Deprecated public short toDamageValue()
      已过时。
      无任何作用
      将此药水转化为合适的 damage 值, 对药水物品堆有用.

      原文:Converts this potion to a valid potion damage short, usable for potion item stacks.

      返回:
      药水的 damage 值
    • toItemStack

      @NotNull public @NotNull ItemStack toItemStack(int amount)
      已过时。
      将此药水转为一个指定堆叠数的物品堆.

      原文:Converts this potion to an ItemStack with the specified amount and a correct damage value.

      参数:
      amount - 物品堆叠数
      返回:
      物品堆
    • fromDamage

      @NotNull public static @NotNull Potion fromDamage(int damage)
      已过时。
      根据 damage 值获取药水.

      原文:Gets the potion from its damage value.

      参数:
      damage - damage 值
      返回:
      创建的药水
    • fromItemStack

      @NotNull public static @NotNull Potion fromItemStack(@NotNull @NotNull ItemStack item)
      已过时。
    • getBrewer

      @NotNull public static @NotNull PotionBrewer getBrewer()
      已过时。
      返回一个PotionBrewer实例.

      原文:Returns an instance of PotionBrewer.

      返回:
      一个PotionBrewer实例
    • setPotionBrewer

      public static void setPotionBrewer(@NotNull @NotNull PotionBrewer other)
      已过时。
      设置当前的 PotionBrewer 实例. 通常不由插件使用.

      原文:Sets the current instance of PotionBrewer. Generally not to be used from within a plugin.

      参数:
      other - 新 PotionBrewer 实例
    • getNameId

      @Deprecated public int getNameId()
      已过时。
      无任何作用
      根据 name id 获取药水对象.

      原文:Gets the potion from its name id.

      返回:
      the name id