![]() |
Bukkit
1.4.7-R1.0
|
Represents a minecraft potion. More...
Classes | |
| enum | Tier |
Public Member Functions | |
| Potion (PotionType type) | |
| Construct a new potion of the given type. | |
| Potion (PotionType type, Tier tier) | |
| Potion (PotionType type, Tier tier, boolean splash) | |
| Potion (PotionType type, Tier tier, boolean splash, boolean extended) | |
| Potion (PotionType type, int level) | |
| Create a new potion of the given type and level. | |
| Potion (PotionType type, int level, boolean splash) | |
| Create a new potion of the given type and level. | |
| Potion (PotionType type, int level, boolean splash, boolean extended) | |
| Create a new potion of the given type and level. | |
| Potion (int name) | |
| Create a potion with a specific name. | |
| Potion | splash () |
| Chain this to the constructor to make the potion a splash potion. | |
| Potion | extend () |
| Chain this to the constructor to extend the potion's duration. | |
| void | apply (ItemStack to) |
| Applies the effects of this potion to the given ItemStack. | |
| void | apply (LivingEntity to) |
| Applies the effects that would be applied by this potion to the given LivingEntity. | |
| boolean | equals (Object obj) |
| Collection< PotionEffect > | getEffects () |
| Returns a collection of PotionEffects that this Potion would confer upon a LivingEntity. | |
| int | getLevel () |
| Returns the level of this potion. | |
| Tier | getTier () |
| Returns the Tier of this potion. | |
| PotionType | getType () |
| Returns the PotionType of this potion. | |
| boolean | hasExtendedDuration () |
| 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 | setSplash (boolean isSplash) |
| Sets whether this potion is a splash potion. | |
| void | setTier (Tier tier) |
| Sets the Tier of this potion. | |
| void | setType (PotionType type) |
| Sets the PotionType of this potion. | |
| void | setLevel (int level) |
| Sets the level of this potion. | |
| short | toDamageValue () |
| Converts this potion to a valid potion damage short, usable for potion item stacks. | |
| ItemStack | toItemStack (int amount) |
| Converts this potion to an ItemStack with the specified amount and a correct damage value. | |
| int | getNameId () |
Static Public Member Functions | |
| static Potion | fromDamage (int damage) |
| static Potion | fromItemStack (ItemStack item) |
| static PotionBrewer | getBrewer () |
| Returns an instance of PotionBrewer. | |
| static void | setPotionBrewer (PotionBrewer other) |
| Sets the current instance of PotionBrewer. | |
Represents a minecraft potion.
Definition at line 15 of file Potion.java.
| org.bukkit.potion.Potion.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 |
Definition at line 29 of file Potion.java.
References org.bukkit.potion.PotionType.getDamageValue(), and org.bukkit.potion.PotionType.WATER.
Referenced by org.bukkit.potion.Potion.equals(), and org.bukkit.potion.Potion.fromDamage().
| org.bukkit.potion.Potion.Potion | ( | PotionType | type, |
| Tier | tier | ||
| ) |
Definition at line 42 of file Potion.java.
References org.bukkit.potion.Potion.Tier.TWO.
| org.bukkit.potion.Potion.Potion | ( | PotionType | type, |
| Tier | tier, | ||
| boolean | splash | ||
| ) |
Definition at line 50 of file Potion.java.
References org.bukkit.potion.Potion.splash(), and org.bukkit.potion.Potion.Tier.TWO.
| org.bukkit.potion.Potion.Potion | ( | PotionType | type, |
| Tier | tier, | ||
| boolean | splash, | ||
| boolean | extended | ||
| ) |
Definition at line 57 of file Potion.java.
References org.bukkit.potion.Potion.splash().
| org.bukkit.potion.Potion.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. |
Definition at line 67 of file Potion.java.
References org.bukkit.potion.PotionType.WATER.
| org.bukkit.potion.Potion.Potion | ( | PotionType | type, |
| int | level, | ||
| boolean | 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. |
Definition at line 83 of file Potion.java.
References org.bukkit.potion.Potion.splash().
| org.bukkit.potion.Potion.Potion | ( | PotionType | type, |
| int | level, | ||
| boolean | splash, | ||
| boolean | extended | ||
| ) |
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. |
Definition at line 98 of file Potion.java.
References org.bukkit.potion.Potion.splash().
| org.bukkit.potion.Potion.Potion | ( | int | name | ) |
Create a potion with a specific name.
| name | The name index (0-63) |
Definition at line 107 of file Potion.java.
References org.bukkit.potion.PotionType.getByDamageValue().
| void org.bukkit.potion.Potion.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 |
Definition at line 140 of file Potion.java.
References org.bukkit.inventory.ItemStack.getType(), org.bukkit.Material.POTION, org.bukkit.inventory.ItemStack.setDurability(), and org.bukkit.potion.Potion.toDamageValue().
| void org.bukkit.potion.Potion.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 |
Definition at line 153 of file Potion.java.
References org.bukkit.entity.LivingEntity.addPotionEffects(), and org.bukkit.potion.Potion.getEffects().
| boolean org.bukkit.potion.Potion.equals | ( | Object | obj | ) |
Definition at line 159 of file Potion.java.
References org.bukkit.potion.Potion.Potion(), and org.bukkit.potion.Potion.splash().
| Potion org.bukkit.potion.Potion.extend | ( | ) |
Chain this to the constructor to extend the potion's duration.
Definition at line 129 of file Potion.java.
References org.bukkit.potion.Potion.setHasExtendedDuration().
Referenced by org.bukkit.potion.Potion.fromDamage().
|
static |
Definition at line 366 of file Potion.java.
References org.bukkit.potion.Potion.extend(), org.bukkit.potion.PotionType.getByDamageValue(), org.bukkit.potion.Potion.Potion(), and org.bukkit.potion.PotionType.WATER.
Referenced by org.bukkit.potion.Potion.fromItemStack().
Definition at line 385 of file Potion.java.
References org.bukkit.potion.Potion.fromDamage(), org.bukkit.inventory.ItemStack.getDurability(), org.bukkit.inventory.ItemStack.getType(), and org.bukkit.Material.POTION.
|
static |
Returns an instance of PotionBrewer.
Definition at line 397 of file Potion.java.
Referenced by org.bukkit.potion.PotionEffectType.createEffect(), and org.bukkit.potion.Potion.getEffects().
| Collection<PotionEffect> org.bukkit.potion.Potion.getEffects | ( | ) |
Returns a collection of PotionEffects that this Potion would confer upon a LivingEntity.
Definition at line 178 of file Potion.java.
References org.bukkit.potion.Potion.getBrewer(), org.bukkit.potion.PotionBrewer.getEffectsFromDamage(), and org.bukkit.potion.Potion.toDamageValue().
Referenced by org.bukkit.potion.Potion.apply().
| int org.bukkit.potion.Potion.getLevel | ( | ) |
Returns the level of this potion.
Definition at line 188 of file Potion.java.
| int org.bukkit.potion.Potion.getNameId | ( | ) |
Definition at line 413 of file Potion.java.
| Tier org.bukkit.potion.Potion.getTier | ( | ) |
Returns the Tier of this potion.
Definition at line 198 of file Potion.java.
References org.bukkit.potion.Potion.Tier.ONE, and org.bukkit.potion.Potion.Tier.TWO.
| PotionType org.bukkit.potion.Potion.getType | ( | ) |
Returns the PotionType of this potion.
Definition at line 207 of file Potion.java.
| boolean org.bukkit.potion.Potion.hasExtendedDuration | ( | ) |
Returns whether this potion has an extended duration.
Definition at line 216 of file Potion.java.
| int org.bukkit.potion.Potion.hashCode | ( | ) |
Definition at line 221 of file Potion.java.
References org.bukkit.potion.Potion.splash().
| boolean org.bukkit.potion.Potion.isSplash | ( | ) |
Returns whether this potion is a splash potion.
Definition at line 235 of file Potion.java.
References org.bukkit.potion.Potion.splash().
Referenced by org.bukkit.potion.Potion.setSplash().
| void org.bukkit.potion.Potion.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 |
Definition at line 245 of file Potion.java.
References org.bukkit.potion.PotionType.isInstant().
Referenced by org.bukkit.potion.Potion.extend().
| void org.bukkit.potion.Potion.setLevel | ( | int | level | ) |
Sets the level of this potion.
| level | The new level of this potion |
Definition at line 288 of file Potion.java.
References org.bukkit.potion.PotionType.getMaxLevel().
|
static |
Sets the current instance of PotionBrewer.
Generally not to be used from within a plugin.
| other | The new PotionBrewer |
Definition at line 407 of file Potion.java.
| void org.bukkit.potion.Potion.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 |
Definition at line 257 of file Potion.java.
References org.bukkit.potion.Potion.isSplash(), and org.bukkit.potion.Potion.splash().
Referenced by org.bukkit.potion.Potion.splash().
| void org.bukkit.potion.Potion.setTier | ( | Tier | tier | ) |
Sets the Tier of this potion.
| tier | The new tier of this potion |
Definition at line 268 of file Potion.java.
References org.bukkit.potion.Potion.Tier.TWO.
| void org.bukkit.potion.Potion.setType | ( | PotionType | type | ) |
Sets the PotionType of this potion.
| type | The new type of this potion |
Definition at line 279 of file Potion.java.
| Potion org.bukkit.potion.Potion.splash | ( | ) |
Chain this to the constructor to make the potion a splash potion.
Definition at line 120 of file Potion.java.
References org.bukkit.potion.Potion.setSplash().
Referenced by org.bukkit.potion.Potion.equals(), org.bukkit.potion.Potion.hashCode(), org.bukkit.potion.Potion.isSplash(), org.bukkit.potion.Potion.Potion(), org.bukkit.potion.Potion.setSplash(), and org.bukkit.potion.Potion.toDamageValue().
| short org.bukkit.potion.Potion.toDamageValue | ( | ) |
Converts this potion to a valid potion damage short, usable for potion item stacks.
Definition at line 301 of file Potion.java.
References org.bukkit.potion.PotionType.getDamageValue(), org.bukkit.potion.Potion.splash(), and org.bukkit.potion.PotionType.WATER.
Referenced by org.bukkit.potion.Potion.apply(), org.bukkit.potion.Potion.getEffects(), and org.bukkit.potion.Potion.toItemStack().
| ItemStack org.bukkit.potion.Potion.toItemStack | ( | int | amount | ) |
Converts this potion to an ItemStack with the specified amount and a correct damage value.
| amount | The amount of the ItemStack |
Definition at line 329 of file Potion.java.
References org.bukkit.Material.POTION, and org.bukkit.potion.Potion.toDamageValue().