Fixed #289 - Engineering table inventory search crash
This commit is contained in:
parent
47b845a67a
commit
4f101e97e2
1 changed files with 2 additions and 2 deletions
|
@ -184,7 +184,7 @@ public class TileEngineeringTable extends TileAdvanced implements IPacketReceive
|
||||||
IInventory inventory = (IInventory) tile;
|
IInventory inventory = (IInventory) tile;
|
||||||
int slotID = slot - idDisplacement;
|
int slotID = slot - idDisplacement;
|
||||||
|
|
||||||
if (slotID < inventory.getSizeInventory())
|
if (slotID >= 0 && slotID < inventory.getSizeInventory())
|
||||||
return inventory.getStackInSlot(slotID);
|
return inventory.getStackInSlot(slotID);
|
||||||
|
|
||||||
idDisplacement += inventory.getSizeInventory();
|
idDisplacement += inventory.getSizeInventory();
|
||||||
|
@ -229,7 +229,7 @@ public class TileEngineeringTable extends TileAdvanced implements IPacketReceive
|
||||||
IInventory inventory = (IInventory) tile;
|
IInventory inventory = (IInventory) tile;
|
||||||
int slotID = slot - idDisplacement;
|
int slotID = slot - idDisplacement;
|
||||||
|
|
||||||
if (slotID < inventory.getSizeInventory())
|
if (slotID >= 0 && slotID < inventory.getSizeInventory())
|
||||||
inventory.setInventorySlotContents(slotID, itemStack);
|
inventory.setInventorySlotContents(slotID, itemStack);
|
||||||
|
|
||||||
idDisplacement += inventory.getSizeInventory();
|
idDisplacement += inventory.getSizeInventory();
|
||||||
|
|
Loading…
Reference in a new issue