类 Potion
java.lang.Object
org.bukkit.potion.Potion
已过时。
Potion Adapter for pre-1.9 data values
see @PotionMeta for 1.9+
-
构造器概要
构造器说明Potion
(int name) 已过时。Potion
(PotionType type) 已过时。Construct a new potion of the given type.Potion
(PotionType type, int level) 已过时。Create a new potion of the given type and level.Potion
(PotionType type, int level, boolean splash) 已过时。Potion
(PotionType type, int level, boolean splash, boolean extended) 已过时。 -
方法概要
修饰符和类型方法说明void
apply
(LivingEntity to) 已过时。Applies the effects that would be applied by this potion to the givenLivingEntity
.void
已过时。Applies the effects of this potion to the givenItemStack
.boolean
已过时。extend()
已过时。Chain this to the constructor to extend the potion's duration.static Potion
fromDamage
(int damage) 已过时。static Potion
fromItemStack
(ItemStack item) 已过时。static PotionBrewer
已过时。Returns an instance ofPotionBrewer
.已过时。int
getLevel()
已过时。Returns the level of this potion.int
已过时。Non-functionalgetType()
已过时。Returns thePotionType
of this potion.boolean
已过时。Returns whether this potion has an extended duration.int
hashCode()
已过时。boolean
isSplash()
已过时。Returns whether this potion is a splash potion.void
setHasExtendedDuration
(boolean isExtended) 已过时。Set whether this potion has extended duration.void
setLevel
(int level) 已过时。Sets the level of this potion.static void
setPotionBrewer
(PotionBrewer other) 已过时。Sets the current instance ofPotionBrewer
.void
setSplash
(boolean isSplash) 已过时。Sets whether this potion is a splash potion.void
setType
(PotionType type) 已过时。Sets thePotionType
of this potion.splash()
已过时。Chain this to the constructor to make the potion a splash potion.short
已过时。Non-functionaltoItemStack
(int amount) 已过时。Converts this potion to anItemStack
with the specified amount and a correct damage value.
-
构造器详细资料
-
Potion
已过时。Construct a new potion of the given type. Unless the type isPotionType.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
已过时。Create a new potion of the given type and level.- 参数:
type
- The type of potion.level
- The potion's level.
-
Potion
已过时。In favour of usingPotion(PotionType)
withsplash()
.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
已过时。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
已过时。
-
-
方法详细资料
-
splash
已过时。Chain this to the constructor to make the potion a splash potion.- 返回:
- The potion.
-
extend
已过时。Chain this to the constructor to extend the potion's duration.- 返回:
- The potion.
-
apply
已过时。Applies the effects of this potion to the givenItemStack
. The ItemStack must be a potion.- 参数:
to
- The itemstack to apply to
-
apply
已过时。Applies the effects that would be applied by this potion to the givenLivingEntity
.- 参数:
to
- The entity to apply the effects to- 另请参阅:
-
equals
已过时。 -
getEffects
已过时。- 返回:
- The effects that this potion applies
- 另请参阅:
-
getLevel
public int getLevel()已过时。Returns the level of this potion.- 返回:
- The level of this potion
-
getType
已过时。Returns thePotionType
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()已过时。 -
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
已过时。Sets thePotionType
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
已过时。Non-functionalConverts this potion to a valid potion damage short, usable for potion item stacks.- 返回:
- The damage value of this potion
-
toItemStack
已过时。Converts this potion to anItemStack
with the specified amount and a correct damage value.- 参数:
amount
- The amount of the ItemStack- 返回:
- The created ItemStack
-
fromDamage
已过时。- 参数:
damage
- the damage value- 返回:
- the produced potion
-
fromItemStack
已过时。 -
getBrewer
已过时。Returns an instance ofPotionBrewer
.- 返回:
- An instance of PotionBrewer
-
setPotionBrewer
已过时。Sets the current instance ofPotionBrewer
. Generally not to be used from within a plugin.- 参数:
other
- The new PotionBrewer
-
getNameId
已过时。Non-functional- 返回:
- the name id
-
Potion(PotionType)
withsplash()
.