summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorsk89q <the.sk89q@gmail.com>2011-01-15 19:33:19 -0800
committersk89q <the.sk89q@gmail.com>2011-01-15 19:33:19 -0800
commit757fc26e4a3e644081b85b21bf2c9991d735ec5d (patch)
treefa7acccb0f3263cc4901914b483acec87af73148 /src
parent5d9fb3e884af6d6119d40b202ae11f6a9b9fb12d (diff)
downloadbukkit-757fc26e4a3e644081b85b21bf2c9991d735ec5d.tar
bukkit-757fc26e4a3e644081b85b21bf2c9991d735ec5d.tar.gz
bukkit-757fc26e4a3e644081b85b21bf2c9991d735ec5d.tar.lz
bukkit-757fc26e4a3e644081b85b21bf2c9991d735ec5d.tar.xz
bukkit-757fc26e4a3e644081b85b21bf2c9991d735ec5d.zip
Added item-in-hand related API.
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/bukkit/entity/HumanEntity.java9
-rw-r--r--src/main/java/org/bukkit/inventory/PlayerInventory.java14
2 files changed, 18 insertions, 5 deletions
diff --git a/src/main/java/org/bukkit/entity/HumanEntity.java b/src/main/java/org/bukkit/entity/HumanEntity.java
index 25f59c8c..25be6897 100644
--- a/src/main/java/org/bukkit/entity/HumanEntity.java
+++ b/src/main/java/org/bukkit/entity/HumanEntity.java
@@ -29,17 +29,16 @@ public interface HumanEntity extends LivingEntity {
*/
public ItemStack getItemInHand();
-
- /** TODO: This probably won't work ;(
+ /**
* Sets the item to the given ItemStack, this will replace whatever the
* user was holding.
*
* @param item The ItemStack which will end up in the hand
* @return
- *
- public void setItemInHand( ItemStack item );
+ */
+ public void setItemInHand(ItemStack item);
- **
+ /**
* Changes the item in hand to another of your 'action slots'.
*
* @param index The new index to use, only valid ones are 0-8.
diff --git a/src/main/java/org/bukkit/inventory/PlayerInventory.java b/src/main/java/org/bukkit/inventory/PlayerInventory.java
index 13bff851..983fec4b 100644
--- a/src/main/java/org/bukkit/inventory/PlayerInventory.java
+++ b/src/main/java/org/bukkit/inventory/PlayerInventory.java
@@ -77,4 +77,18 @@ public interface PlayerInventory extends Inventory {
* @return The currently holded ItemStack
*/
public ItemStack getItemInHand();
+
+ /**
+ * Sets the item in hand
+ *
+ * @param stack Stack to set
+ */
+ public void setItemInHand(ItemStack stack);
+
+ /**
+ * Get the slot number of the currently held item
+ *
+ * @return Held item slot number
+ */
+ public int getHeldItemSlot();
} \ No newline at end of file