diff options
author | Olof Larsson <olof@sylt.nu> | 2012-12-17 09:45:56 +0100 |
---|---|---|
committer | GJ <gjmcferrin@gmail.com> | 2013-03-21 15:17:31 -0400 |
commit | 2d7f856436b55b7ea6b629f4777fbffbacb4a9ed (patch) | |
tree | 1a07fb1088f5e8f1c3d98ce84427ed089cfb8ada /src/main/java | |
parent | 9c1bc74618e5aa23224e6f814b4d4a8a5a026ddf (diff) | |
download | bukkit-2d7f856436b55b7ea6b629f4777fbffbacb4a9ed.tar bukkit-2d7f856436b55b7ea6b629f4777fbffbacb4a9ed.tar.gz bukkit-2d7f856436b55b7ea6b629f4777fbffbacb4a9ed.tar.lz bukkit-2d7f856436b55b7ea6b629f4777fbffbacb4a9ed.tar.xz bukkit-2d7f856436b55b7ea6b629f4777fbffbacb4a9ed.zip |
Add ability to modify ThrownPotion properties. Adds BUKKIT-3197
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/org/bukkit/entity/ThrownPotion.java | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/entity/ThrownPotion.java b/src/main/java/org/bukkit/entity/ThrownPotion.java index 8e34ca21..4da1f1b9 100644 --- a/src/main/java/org/bukkit/entity/ThrownPotion.java +++ b/src/main/java/org/bukkit/entity/ThrownPotion.java @@ -2,6 +2,7 @@ package org.bukkit.entity; import java.util.Collection; +import org.bukkit.inventory.ItemStack; import org.bukkit.potion.PotionEffect; /** @@ -13,4 +14,24 @@ public interface ThrownPotion extends Projectile { * @return The potion effects */ public Collection<PotionEffect> getEffects(); + + /** + * Returns a copy of the ItemStack for this thrown potion. + * <p> + * Altering this copy will not alter the thrown potion directly. + * If you want to alter the thrown potion, you must use the + * {@link #setItemStack(ItemStack) setItemStack} method. + * + * @return A copy of the ItemStack for this thrown potion. + */ + public ItemStack getItem(); + + /** + * Set the ItemStack for this thrown potion. + * <p> + * The ItemStack must be a potion, otherwise an exception is thrown. + * + * @param item New ItemStack + */ + public void setItem(ItemStack item); } |