diff options
author | Alkalus <draknyte1@hotmail.com> | 2017-11-12 18:31:25 +1000 |
---|---|---|
committer | Alkalus <draknyte1@hotmail.com> | 2017-11-12 18:31:25 +1000 |
commit | edddd3413b6dd761ba72b22ee0e4d0fdb8ecb806 (patch) | |
tree | b6f942e2f079dfaed4786a4297d1a126437af960 /src/Java | |
parent | f540f49012e1e9e397cbe2820a0d7e50046e4c17 (diff) | |
download | GT5-Unofficial-edddd3413b6dd761ba72b22ee0e4d0fdb8ecb806.tar.gz GT5-Unofficial-edddd3413b6dd761ba72b22ee0e4d0fdb8ecb806.tar.bz2 GT5-Unofficial-edddd3413b6dd761ba72b22ee0e4d0fdb8ecb806.zip |
$ More small MT inventory corrections.
Diffstat (limited to 'src/Java')
-rw-r--r-- | src/Java/gtPlusPlus/core/inventories/modulartable/InventoryModularOutput.java | 18 | ||||
-rw-r--r-- | src/Java/gtPlusPlus/core/tileentities/machines/TileEntityModularityTable.java | 36 |
2 files changed, 20 insertions, 34 deletions
diff --git a/src/Java/gtPlusPlus/core/inventories/modulartable/InventoryModularOutput.java b/src/Java/gtPlusPlus/core/inventories/modulartable/InventoryModularOutput.java index 484edc2b0f..998750e3e3 100644 --- a/src/Java/gtPlusPlus/core/inventories/modulartable/InventoryModularOutput.java +++ b/src/Java/gtPlusPlus/core/inventories/modulartable/InventoryModularOutput.java @@ -80,14 +80,7 @@ public class InventoryModularOutput implements IInventory { @Override public ItemStack getStackInSlot(final int slot) { - int slotNew = 0; - if (slot >= 2){ - slotNew = (slot-9); - if (slotNew < 0 || slotNew > 2){ - slotNew = 0; - } - } - return this.inventory[slotNew]; + return this.inventory[slot]; } @Override @@ -186,17 +179,10 @@ 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 (slotNew == 0){ + if (slot == 0){ return TileEntityModularityTable.isValidUpgrade(itemstack); } return TileEntityModularityTable.isValidModularPiece(itemstack); diff --git a/src/Java/gtPlusPlus/core/tileentities/machines/TileEntityModularityTable.java b/src/Java/gtPlusPlus/core/tileentities/machines/TileEntityModularityTable.java index 248817636f..8aacb7cf8c 100644 --- a/src/Java/gtPlusPlus/core/tileentities/machines/TileEntityModularityTable.java +++ b/src/Java/gtPlusPlus/core/tileentities/machines/TileEntityModularityTable.java @@ -239,11 +239,11 @@ public class TileEntityModularityTable extends TileEntityBase implements ISidedI @Override public ItemStack getStackInSlot(int slot) { - if (slot < this.inventoryGrid.getSizeInventory()){ - return this.inventoryGrid.getStackInSlot(slot); + if (slot >= this.inventoryGrid.getSizeInventory()){ + return this.inventoryOutputs.getStackInSlot(slot-9); } - else if (slot < (this.inventoryGrid.getSizeInventory()+this.inventoryOutputs.getSizeInventory())){ - return this.inventoryOutputs.getStackInSlot(slot); + else if (slot < this.inventoryGrid.getSizeInventory()){ + return this.inventoryGrid.getStackInSlot(slot); } else { return null; @@ -255,8 +255,8 @@ public class TileEntityModularityTable extends TileEntityBase implements ISidedI if (slot < this.inventoryGrid.getSizeInventory()){ return this.inventoryGrid.decrStackSize(slot, count); } - else if (slot < (this.inventoryGrid.getSizeInventory()+this.inventoryOutputs.getSizeInventory())){ - return this.inventoryOutputs.decrStackSize(slot, count); + else if (slot >= this.inventoryGrid.getSizeInventory()){ + return this.inventoryOutputs.decrStackSize(slot-9, count); } else { return null; @@ -270,12 +270,12 @@ public class TileEntityModularityTable extends TileEntityBase implements ISidedI @Override public void setInventorySlotContents(int slot, ItemStack stack) { - if (slot < this.inventoryGrid.getSizeInventory()){ + if (slot >= this.inventoryGrid.getSizeInventory()){ + this.inventoryOutputs.setInventorySlotContents(slot-9, stack); + } + else if (slot < this.inventoryGrid.getSizeInventory()){ this.inventoryGrid.setInventorySlotContents(slot, stack); } - else if (slot < (this.inventoryGrid.getSizeInventory()+this.inventoryOutputs.getSizeInventory())){ - this.inventoryOutputs.setInventorySlotContents(slot, stack); - } } @Override @@ -308,11 +308,11 @@ public class TileEntityModularityTable extends TileEntityBase implements ISidedI @Override public boolean isItemValidForSlot(int slot, ItemStack itemstack) { - if (slot < this.inventoryGrid.getSizeInventory()){ - return this.inventoryGrid.isItemValidForSlot(slot, itemstack); + if (slot >= this.inventoryGrid.getSizeInventory()){ + return this.inventoryOutputs.isItemValidForSlot(slot-9, itemstack); } - else if (slot < (this.inventoryGrid.getSizeInventory()+this.inventoryOutputs.getSizeInventory())){ - return this.inventoryOutputs.isItemValidForSlot(slot, itemstack); + else if (slot < this.inventoryGrid.getSizeInventory()){ + return this.inventoryGrid.isItemValidForSlot(slot, itemstack); } else { return false; @@ -333,11 +333,11 @@ public class TileEntityModularityTable extends TileEntityBase implements ISidedI public boolean canInsertItem(int slot, ItemStack item, int side) { Utils.LOG_INFO("Slot:"+slot+" | side? "+side); - if (side == 1){ - return this.inventoryOutputs.isItemValidForSlot(0, item); - } + /*if (side == 1){ + return this.inventoryOutputs.isItemValidForSlot(slot-9, item); + } */ if (slot >= 9){ - return this.inventoryOutputs.isItemValidForSlot(slot, item); + return this.inventoryOutputs.isItemValidForSlot(slot-9, item); } else { return this.inventoryGrid.isItemValidForSlot(slot, item); |