Fixed #289 - Engineering table inventory search crash

This commit is contained in:
Calclavia 2014-02-25 23:18:25 +08:00
parent 47b845a67a
commit 4f101e97e2

View file

@ -184,7 +184,7 @@ public class TileEngineeringTable extends TileAdvanced implements IPacketReceive
IInventory inventory = (IInventory) tile;
int slotID = slot - idDisplacement;
if (slotID < inventory.getSizeInventory())
if (slotID >= 0 && slotID < inventory.getSizeInventory())
return inventory.getStackInSlot(slotID);
idDisplacement += inventory.getSizeInventory();
@ -229,7 +229,7 @@ public class TileEngineeringTable extends TileAdvanced implements IPacketReceive
IInventory inventory = (IInventory) tile;
int slotID = slot - idDisplacement;
if (slotID < inventory.getSizeInventory())
if (slotID >= 0 && slotID < inventory.getSizeInventory())
inventory.setInventorySlotContents(slotID, itemStack);
idDisplacement += inventory.getSizeInventory();