From 11d156e65e7f258fcda61fb26cc5e53a6fde80b1 Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Mon, 17 Jan 2011 01:55:18 +0100 Subject: [PATCH] Updated CraftHumanEntity to refresh the inventory on death, should fix odd behavior around that. By: Erik Broes --- .../org/bukkit/craftbukkit/entity/CraftHumanEntity.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java index 38b9f575ce..e0c669e294 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java @@ -6,6 +6,7 @@ import org.bukkit.entity.HumanEntity; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.PlayerInventory; import org.bukkit.craftbukkit.inventory.CraftInventoryPlayer; +import org.bukkit.craftbukkit.inventory.CraftItemStack; import org.bukkit.craftbukkit.CraftServer; public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { @@ -30,13 +31,14 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { public void setHandle(final EntityPlayer entity) { super.setHandle((EntityPlayer)entity); this.entity = entity; + this.inventory = new CraftInventoryPlayer( entity.an ); } - public PlayerInventory getInventory() { + public CraftInventoryPlayer getInventory() { return inventory; } - public ItemStack getItemInHand() { + public CraftItemStack getItemInHand() { return getInventory().getItemInHand(); }