From f540f49012e1e9e397cbe2820a0d7e50046e4c17 Mon Sep 17 00:00:00 2001 From: Alkalus Date: Sun, 12 Nov 2017 18:09:22 +1000 Subject: $ Small fixes to slot handling. --- .../modulartable/InventoryModularOutput.java | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'src/Java/gtPlusPlus/core/inventories') diff --git a/src/Java/gtPlusPlus/core/inventories/modulartable/InventoryModularOutput.java b/src/Java/gtPlusPlus/core/inventories/modulartable/InventoryModularOutput.java index 998750e3e3..484edc2b0f 100644 --- a/src/Java/gtPlusPlus/core/inventories/modulartable/InventoryModularOutput.java +++ b/src/Java/gtPlusPlus/core/inventories/modulartable/InventoryModularOutput.java @@ -80,7 +80,14 @@ public class InventoryModularOutput implements IInventory { @Override public ItemStack getStackInSlot(final int slot) { - return this.inventory[slot]; + int slotNew = 0; + if (slot >= 2){ + slotNew = (slot-9); + if (slotNew < 0 || slotNew > 2){ + slotNew = 0; + } + } + return this.inventory[slotNew]; } @Override @@ -179,10 +186,17 @@ public class InventoryModularOutput implements IInventory { */ @Override public boolean isItemValidForSlot(final int slot, final ItemStack itemstack) { + int slotNew = 0; + if (slot >= 2){ + slotNew = (slot-9); + if (slotNew < 0 || slotNew > 2){ + slotNew = 0; + } + } // Don't want to be able to store the inventory item within itself // Bad things will happen, like losing your inventory // Actually, this needs a custom Slot to work - if (slot == 0){ + if (slotNew == 0){ return TileEntityModularityTable.isValidUpgrade(itemstack); } return TileEntityModularityTable.isValidModularPiece(itemstack); -- cgit