Safer onUpdate in ItemProxy, should fix #1187

This commit is contained in:
tterrag1098 2014-03-10 17:03:22 -04:00
parent 653aa6c30f
commit 0859b54a55

View file

@ -87,11 +87,10 @@ public class ItemProxy extends Item
if (par3Entity instanceof EntityPlayer) if (par3Entity instanceof EntityPlayer)
{ {
EntityPlayer player = (EntityPlayer) par3Entity; EntityPlayer player = (EntityPlayer) par3Entity;
for (Object o : player.inventoryContainer.inventorySlots) for (int i = 0; i < player.inventory.mainInventory.length; i++)
{ {
Slot s = (Slot) o; if (player.inventory.mainInventory[i] != null && player.inventory.mainInventory[i].getItem() == this)
if (s.getStack() != null && s.getStack().getItem() == this) player.inventory.mainInventory[i] = null;
player.inventory.decrStackSize(s.slotNumber, 64);
} }
} }
} }