Additional checks for InventoryLogic to prevent crashes with invalid slots.

This commit is contained in:
Bernhard Bonigl committed 2014-10-17 15:04:47 +02:00
1 parent 8a7539803f
commit cb2a0cfef1
1 file changed
+2 -2
@@ -40,12 +40,12 @@ public abstract class InventoryLogic extends TileEntity implements IInventory, I
@Override
public ItemStack getStackInSlot (int slot)
{
return inventory[slot];
return slot < inventory.length ? inventory[slot] : null;
}
public boolean isStackInSlot (int slot)
{
return inventory[slot] != null;
return slot < inventory.length && inventory[slot] != null;
}
@Override