From 2d7f856436b55b7ea6b629f4777fbffbacb4a9ed Mon Sep 17 00:00:00 2001 From: Olof Larsson Date: Mon, 17 Dec 2012 09:45:56 +0100 Subject: Add ability to modify ThrownPotion properties. Adds BUKKIT-3197 --- src/main/java/org/bukkit/entity/ThrownPotion.java | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/main/java/org') 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 getEffects(); + + /** + * Returns a copy of the ItemStack for this thrown potion. + *

+ * 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. + *

+ * The ItemStack must be a potion, otherwise an exception is thrown. + * + * @param item New ItemStack + */ + public void setItem(ItemStack item); } -- cgit v1.2.3