mirror of
https://github.com/GTNewHorizons/Mantle.git
synced 2026-11-18 11:19:20 +00:00
Additional checks for InventoryLogic to prevent crashes with invalid slots.
This commit is contained in:
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
|
||||
|
||||
Reference in new issue
Block a user