类 Potion

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

@Deprecated public class Potion extends Object
已过时。
Potion Adapter for pre-1.9 data values see @PotionMeta for 1.9+
  • 构造器详细资料

    • Potion

      public Potion(PotionType type)
      已过时。
      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(PotionType type, int level)
      已过时。
      Create a new potion of the given type and level.
      参数:
      type - The type of potion.
      level - The potion's level.
    • Potion

      @Deprecated public Potion(PotionType type, int level, boolean splash)
      已过时。
      In favour of using Potion(PotionType) with splash().
      Create a new potion of the given type and level.
      参数:
      type - The type of potion.
      level - The potion's level.
      splash - Whether it is a splash potion.
    • Potion

      @Deprecated public Potion(PotionType type, int level, boolean splash, boolean extended)
      已过时。
      In favour of using Potion(PotionType) with extend() and possibly splash().
      Create a new potion of the given type and level.
      参数:
      type - The type of potion.
      level - The potion's level.
      splash - Whether it is a splash potion.
      extended - Whether it has an extended duration.
    • Potion

      @Deprecated public Potion(int name)
      已过时。
  • 方法详细资料

    • splash

      public Potion splash()
      已过时。
      Chain this to the constructor to make the potion a splash potion.
      返回:
      The potion.
    • extend

      public Potion extend()
      已过时。
      Chain this to the constructor to extend the potion's duration.
      返回:
      The potion.
    • apply

      public void apply(ItemStack to)
      已过时。
      Applies the effects of this potion to the given ItemStack. The ItemStack must be a potion.
      参数:
      to - The itemstack to apply to
    • apply

      public void apply(LivingEntity to)
      已过时。
      Applies the effects that would be applied by this potion to the given LivingEntity.
      参数:
      to - The entity to apply the effects to
      另请参阅:
    • equals

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

      public Collection<PotionEffect> getEffects()
      已过时。
      Returns a collection of PotionEffects that this Potion would confer upon a LivingEntity.
      返回:
      The effects that this potion applies
      另请参阅:
    • getLevel

      public int getLevel()
      已过时。
      Returns the level of this potion.
      返回:
      The level of this potion
    • getType

      public PotionType getType()
      已过时。
      Returns the PotionType of this potion.
      返回:
      The type of this potion
    • hasExtendedDuration

      public boolean hasExtendedDuration()
      已过时。
      Returns whether this potion has an extended duration.
      返回:
      Whether this potion has extended duration
    • hashCode

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

      public boolean isSplash()
      已过时。
      Returns whether this potion is a splash potion.
      返回:
      Whether this is a splash potion
    • setHasExtendedDuration

      public void setHasExtendedDuration(boolean isExtended)
      已过时。
      Set whether this potion has extended duration. This will cause the potion to have roughly 8/3 more duration than a regular potion.
      参数:
      isExtended - Whether the potion should have extended duration
    • setSplash

      public void setSplash(boolean isSplash)
      已过时。
      Sets whether this potion is a splash potion. Splash potions can be thrown for a radius effect.
      参数:
      isSplash - Whether this is a splash potion
    • setType

      public void setType(PotionType type)
      已过时。
      Sets the PotionType of this potion.
      参数:
      type - The new type of this potion
    • setLevel

      public void setLevel(int level)
      已过时。
      Sets the level of this potion.
      参数:
      level - The new level of this potion
    • toDamageValue

      @Deprecated public short toDamageValue()
      已过时。
      Non-functional
      Converts this potion to a valid potion damage short, usable for potion item stacks.
      返回:
      The damage value of this potion
    • toItemStack

      public ItemStack toItemStack(int amount)
      已过时。
      Converts this potion to an ItemStack with the specified amount and a correct damage value.
      参数:
      amount - The amount of the ItemStack
      返回:
      The created ItemStack
    • fromDamage

      public static Potion fromDamage(int damage)
      已过时。
      参数:
      damage - the damage value
      返回:
      the produced potion
    • fromItemStack

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

      public static PotionBrewer getBrewer()
      已过时。
      Returns an instance of PotionBrewer.
      返回:
      An instance of PotionBrewer
    • setPotionBrewer

      public static void setPotionBrewer(PotionBrewer other)
      已过时。
      Sets the current instance of PotionBrewer. Generally not to be used from within a plugin.
      参数:
      other - The new PotionBrewer
    • getNameId

      @Deprecated public int getNameId()
      已过时。
      Non-functional
      返回:
      the name id