diff options
author | sk89q <the.sk89q@gmail.com> | 2011-01-15 19:33:28 -0800 |
---|---|---|
committer | sk89q <the.sk89q@gmail.com> | 2011-01-15 19:33:28 -0800 |
commit | 5d93ab3e54bddf4babf03b99d1745bd57dc5deaf (patch) | |
tree | 9c1a71caa7c90fae213b5ef42e8d845ab0857be6 /src/main/java/org | |
parent | 44ae0531e72871775be20bdc557e1933cc2a71dd (diff) | |
download | craftbukkit-5d93ab3e54bddf4babf03b99d1745bd57dc5deaf.tar craftbukkit-5d93ab3e54bddf4babf03b99d1745bd57dc5deaf.tar.gz craftbukkit-5d93ab3e54bddf4babf03b99d1745bd57dc5deaf.tar.lz craftbukkit-5d93ab3e54bddf4babf03b99d1745bd57dc5deaf.tar.xz craftbukkit-5d93ab3e54bddf4babf03b99d1745bd57dc5deaf.zip |
Added item-in-hand related API.
Diffstat (limited to 'src/main/java/org')
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java | 4 | ||||
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryPlayer.java | 8 |
2 files changed, 12 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java index ef09a416..38b9f575 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java @@ -40,6 +40,10 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { return getInventory().getItemInHand(); } + public void setItemInHand(ItemStack item) { + getInventory().setItemInHand(item); + } + @Override public String toString() { return "CraftHumanEntity{" + "id=" + getEntityId() + "name=" + getName() + '}'; diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryPlayer.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryPlayer.java index 7140d36f..af222f3c 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryPlayer.java @@ -22,6 +22,14 @@ public class CraftInventoryPlayer extends CraftInventory implements PlayerInvent return new CraftItemStack( getInventory().e() ); } + public void setItemInHand(ItemStack stack) { + setItem( getHeldItemSlot(), stack ); + } + + public int getHeldItemSlot() { + return getInventory().c; + } + public CraftItemStack getHelmet() { return getItem( getSize() + 0 ); } |