diff options
| author | Alkalus <draknyte1@hotmail.com> | 2017-11-12 18:09:22 +1000 |
|---|---|---|
| committer | Alkalus <draknyte1@hotmail.com> | 2017-11-12 18:09:22 +1000 |
| commit | f540f49012e1e9e397cbe2820a0d7e50046e4c17 (patch) | |
| tree | 9d2c7d23ccd17c69ea3c811955feb964fbfba2f3 /src/Java/gtPlusPlus/core/inventories | |
| parent | 4b50c6c2b9dc2666c0d61ccce0c730d7f7acb329 (diff) | |
| download | GT5-Unofficial-f540f49012e1e9e397cbe2820a0d7e50046e4c17.tar.gz GT5-Unofficial-f540f49012e1e9e397cbe2820a0d7e50046e4c17.tar.bz2 GT5-Unofficial-f540f49012e1e9e397cbe2820a0d7e50046e4c17.zip | |
$ Small fixes to slot handling.
Diffstat (limited to 'src/Java/gtPlusPlus/core/inventories')
| -rw-r--r-- | src/Java/gtPlusPlus/core/inventories/modulartable/InventoryModularOutput.java | 18 |
1 files changed, 16 insertions, 2 deletions
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); |
