Safer onUpdate in ItemProxy, should fix #1187
This commit is contained in:
parent
653aa6c30f
commit
0859b54a55
1 changed files with 3 additions and 4 deletions
|
@ -87,11 +87,10 @@ public class ItemProxy extends Item
|
|||
if (par3Entity instanceof EntityPlayer)
|
||||
{
|
||||
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 (s.getStack() != null && s.getStack().getItem() == this)
|
||||
player.inventory.decrStackSize(s.slotNumber, 64);
|
||||
if (player.inventory.mainInventory[i] != null && player.inventory.mainInventory[i].getItem() == this)
|
||||
player.inventory.mainInventory[i] = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue