From 4f101e97e22f64f6804fe9a08b22231131dbf719 Mon Sep 17 00:00:00 2001 From: Calclavia Date: Tue, 25 Feb 2014 23:18:25 +0800 Subject: [PATCH] Fixed #289 - Engineering table inventory search crash --- .../archaic/engineering/TileEngineeringTable.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/archaic/src/main/java/resonantinduction/archaic/engineering/TileEngineeringTable.java b/archaic/src/main/java/resonantinduction/archaic/engineering/TileEngineeringTable.java index 916cb814..22d6bcb4 100644 --- a/archaic/src/main/java/resonantinduction/archaic/engineering/TileEngineeringTable.java +++ b/archaic/src/main/java/resonantinduction/archaic/engineering/TileEngineeringTable.java @@ -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();