diff --git a/src/main/java/mekanism/client/gui/GuiUpgradeTab.java b/src/main/java/mekanism/client/gui/GuiUpgradeTab.java index a101dfe52..dd94bc319 100644 --- a/src/main/java/mekanism/client/gui/GuiUpgradeTab.java +++ b/src/main/java/mekanism/client/gui/GuiUpgradeTab.java @@ -1,15 +1,16 @@ package mekanism.client.gui; -import codechicken.lib.vec.Rectangle4i; import mekanism.api.Coord4D; import mekanism.client.sound.SoundHandler; import mekanism.common.IUpgradeTile; import mekanism.common.Mekanism; import mekanism.common.network.PacketRemoveUpgrade.RemoveUpgradeMessage; +import mekanism.common.network.PacketSimpleGui.SimpleGuiMessage; import mekanism.common.util.MekanismUtils; import mekanism.common.util.MekanismUtils.ResourceType; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ResourceLocation; +import codechicken.lib.vec.Rectangle4i; public class GuiUpgradeTab extends GuiElement { @@ -17,7 +18,7 @@ public class GuiUpgradeTab extends GuiElement public GuiUpgradeTab(IGuiWrapper gui, TileEntity tile, ResourceLocation def) { - super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiUpgradeManagement.png"), gui, def); + super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiUpgradeTab.png"), gui, def); tileEntity = tile; } @@ -25,7 +26,7 @@ public class GuiUpgradeTab extends GuiElement @Override public Rectangle4i getBounds(int guiWidth, int guiHeight) { - return new Rectangle4i(guiWidth + 176, guiHeight + 6, 26, 63); + return new Rectangle4i(guiWidth + 176, guiHeight + 6, 26, 26); } @Override @@ -50,52 +51,25 @@ public class GuiUpgradeTab extends GuiElement IUpgradeTile upgradeTile = (IUpgradeTile)tileEntity; - if(getFontRenderer() != null) + if(xAxis >= 179 && xAxis <= 197 && yAxis >= 10 && yAxis <= 28) { - getFontRenderer().drawString("S:" + (upgradeTile.getSpeedMultiplier()+1) + "x", 179, 47, 0x404040); - getFontRenderer().drawString("E:" + (upgradeTile.getEnergyMultiplier()+1) + "x", 179, 57, 0x404040); + displayTooltip(MekanismUtils.localize("gui.upgrades"), xAxis, yAxis); } - if(xAxis >= 179 && xAxis <= 198 && yAxis >= 47 && yAxis <= 54) - { - displayTooltip(MekanismUtils.localize("gui.removeSpeedUpgrade"), xAxis, yAxis); - } - - if(xAxis >= 179 && xAxis <= 198 && yAxis >= 57 && yAxis <= 64) - { - displayTooltip(MekanismUtils.localize("gui.removeEnergyUpgrade"), xAxis, yAxis); - } mc.renderEngine.bindTexture(defaultLocation); } @Override - public void preMouseClicked(int xAxis, int yAxis, int button) - { - if(xAxis >= 180 && xAxis <= 196 && yAxis >= 11 && yAxis <= 27) - { - offsetX(26); - } - } + public void preMouseClicked(int xAxis, int yAxis, int button) {} @Override public void mouseClicked(int xAxis, int yAxis, int button) { - if(xAxis >= 179 && xAxis <= 198 && yAxis >= 47 && yAxis <= 54) + if(xAxis >= 179 && xAxis <= 197 && yAxis >= 10 && yAxis <= 28) { + Mekanism.packetHandler.sendToServer(new SimpleGuiMessage(Coord4D.get(tileEntity), 9)); SoundHandler.playSound("gui.button.press"); - Mekanism.packetHandler.sendToServer(new RemoveUpgradeMessage(Coord4D.get(tileEntity), (byte)0)); - } - - if(xAxis >= 179 && xAxis <= 198 && yAxis >= 57 && yAxis <= 64) - { - SoundHandler.playSound("gui.button.press"); - Mekanism.packetHandler.sendToServer(new RemoveUpgradeMessage(Coord4D.get(tileEntity), (byte)1)); - } - - if(xAxis >= 180 && xAxis <= 196 && yAxis >= 11 && yAxis <= 27) - { - offsetX(-26); } } } diff --git a/src/main/java/mekanism/common/inventory/container/ContainerAdvancedElectricMachine.java b/src/main/java/mekanism/common/inventory/container/ContainerAdvancedElectricMachine.java index fc38b1374..4231f7cd9 100644 --- a/src/main/java/mekanism/common/inventory/container/ContainerAdvancedElectricMachine.java +++ b/src/main/java/mekanism/common/inventory/container/ContainerAdvancedElectricMachine.java @@ -26,7 +26,6 @@ public class ContainerAdvancedElectricMachine extends Container addSlotToContainer(new Slot(tentity, 1, 56, 53)); addSlotToContainer(new SlotOutput(tentity, 2, 116, 35)); addSlotToContainer(new SlotDischarge(tentity, 3, 31, 35)); - addSlotToContainer(new SlotMachineUpgrade(tentity, 4, 180, 11)); int slotX; @@ -75,7 +74,7 @@ public class ContainerAdvancedElectricMachine extends Container if(slotID == 2) { - if(!mergeItemStack(slotStack, 5, inventorySlots.size(), true)) + if(!mergeItemStack(slotStack, 4, inventorySlots.size(), true)) { return null; } @@ -90,7 +89,7 @@ public class ContainerAdvancedElectricMachine extends Container } } else { - if(!mergeItemStack(slotStack, 5, inventorySlots.size(), true)) + if(!mergeItemStack(slotStack, 4, inventorySlots.size(), true)) { return null; } @@ -106,7 +105,7 @@ public class ContainerAdvancedElectricMachine extends Container } } else { - if(!mergeItemStack(slotStack, 5, inventorySlots.size(), true)) + if(!mergeItemStack(slotStack, 4, inventorySlots.size(), true)) { return null; } @@ -122,45 +121,29 @@ public class ContainerAdvancedElectricMachine extends Container } } else { - if(!mergeItemStack(slotStack, 5, inventorySlots.size(), true)) - { - return null; - } - } - } - else if(slotStack.getItem() instanceof ItemMachineUpgrade) - { - if(slotID != 4) - { - if(!mergeItemStack(slotStack, 4, 5, false)) - { - return null; - } - } - else { - if(!mergeItemStack(slotStack, 5, inventorySlots.size(), true)) + if(!mergeItemStack(slotStack, 4, inventorySlots.size(), true)) { return null; } } } else { - if(slotID >= 5 && slotID <= 31) + if(slotID >= 4 && slotID <= 30) { - if(!mergeItemStack(slotStack, 32, inventorySlots.size(), false)) + if(!mergeItemStack(slotStack, 31, inventorySlots.size(), false)) { return null; } } - else if(slotID > 31) + else if(slotID > 30) { - if(!mergeItemStack(slotStack, 5, 31, false)) + if(!mergeItemStack(slotStack, 4, 30, false)) { return null; } } else { - if(!mergeItemStack(slotStack, 5, inventorySlots.size(), true)) + if(!mergeItemStack(slotStack, 4, inventorySlots.size(), true)) { return null; } diff --git a/src/main/java/mekanism/common/inventory/container/ContainerChanceMachine.java b/src/main/java/mekanism/common/inventory/container/ContainerChanceMachine.java index 587922a28..3184a0e41 100644 --- a/src/main/java/mekanism/common/inventory/container/ContainerChanceMachine.java +++ b/src/main/java/mekanism/common/inventory/container/ContainerChanceMachine.java @@ -23,19 +23,18 @@ public class ContainerChanceMachine extends Container addSlotToContainer(new Slot(tentity, 0, 56, 17)); addSlotToContainer(new SlotDischarge(tentity, 1, 56, 53)); addSlotToContainer(new SlotOutput(tentity, 2, 116, 35)); - addSlotToContainer(new SlotMachineUpgrade(tentity, 3, 180, 11)); addSlotToContainer(new SlotOutput(tentity, 4, 132, 35)); int slotX; - for(slotX = 0; slotX < 3; ++slotX) + for(slotX = 0; slotX < 3; slotX++) { - for(int slotY = 0; slotY < 9; ++slotY) + for(int slotY = 0; slotY < 9; slotY++) { addSlotToContainer(new Slot(inventory, slotY + slotX * 9 + 9, 8 + slotY * 18, 84 + slotX * 18)); } } - for(slotX = 0; slotX < 9; ++slotX) + for(slotX = 0; slotX < 9; slotX++) { addSlotToContainer(new Slot(inventory, slotX, 8 + slotX * 18, 142)); } @@ -70,9 +69,9 @@ public class ContainerChanceMachine extends Container ItemStack slotStack = currentSlot.getStack(); stack = slotStack.copy(); - if(slotID == 2 || slotID == 4) + if(slotID == 2 || slotID == 3) { - if(!mergeItemStack(slotStack, 5, inventorySlots.size(), true)) + if(!mergeItemStack(slotStack, 4, inventorySlots.size(), true)) { return null; } @@ -88,7 +87,7 @@ public class ContainerChanceMachine extends Container } else if(slotID == 1) { - if(!mergeItemStack(slotStack, 5, inventorySlots.size(), true)) + if(!mergeItemStack(slotStack, 4, inventorySlots.size(), true)) { return null; } @@ -96,7 +95,7 @@ public class ContainerChanceMachine extends Container } else if(RecipeHandler.getChanceOutput(slotStack, false, tileEntity.getRecipes()) != null) { - if(slotID != 0 && slotID != 1 && slotID != 2 && slotID != 3 && slotID != 4) + if(slotID != 0 && slotID != 1 && slotID != 2 && slotID != 3) { if(!mergeItemStack(slotStack, 0, 1, false)) { @@ -104,45 +103,29 @@ public class ContainerChanceMachine extends Container } } else { - if(!mergeItemStack(slotStack, 5, inventorySlots.size(), true)) - { - return null; - } - } - } - else if(slotStack.getItem() instanceof ItemMachineUpgrade) - { - if(slotID != 0 && slotID != 1 && slotID != 2 && slotID != 3) - { - if(!mergeItemStack(slotStack, 3, 4, false)) - { - return null; - } - } - else { - if(!mergeItemStack(slotStack, 5, inventorySlots.size(), true)) + if(!mergeItemStack(slotStack, 4, inventorySlots.size(), true)) { return null; } } } else { - if(slotID >= 5 && slotID <= 31) + if(slotID >= 4 && slotID <= 30) { - if(!mergeItemStack(slotStack, 32, inventorySlots.size(), false)) + if(!mergeItemStack(slotStack, 31, inventorySlots.size(), false)) { return null; } } - else if(slotID > 31) + else if(slotID > 30) { - if(!mergeItemStack(slotStack, 5, 31, false)) + if(!mergeItemStack(slotStack, 4, 30, false)) { return null; } } else { - if(!mergeItemStack(slotStack, 5, inventorySlots.size(), true)) + if(!mergeItemStack(slotStack, 4, inventorySlots.size(), true)) { return null; } diff --git a/src/main/java/mekanism/common/inventory/container/ContainerChemicalCrystallizer.java b/src/main/java/mekanism/common/inventory/container/ContainerChemicalCrystallizer.java index 956005c43..6607d00ab 100644 --- a/src/main/java/mekanism/common/inventory/container/ContainerChemicalCrystallizer.java +++ b/src/main/java/mekanism/common/inventory/container/ContainerChemicalCrystallizer.java @@ -24,7 +24,6 @@ public class ContainerChemicalCrystallizer extends Container addSlotToContainer(new SlotStorageTank(tentity, 0, 6, 65)); addSlotToContainer(new SlotOutput(tentity, 1, 131, 57)); addSlotToContainer(new SlotDischarge(tentity, 2, 155, 5)); - addSlotToContainer(new SlotMachineUpgrade(tentity, 3, 180, 11)); int slotY; @@ -81,7 +80,7 @@ public class ContainerChemicalCrystallizer extends Container } } else { - if(!mergeItemStack(slotStack, 4, inventorySlots.size(), true)) + if(!mergeItemStack(slotStack, 3, inventorySlots.size(), true)) { return null; } @@ -89,7 +88,7 @@ public class ContainerChemicalCrystallizer extends Container } else if(slotID == 1) { - if(!mergeItemStack(slotStack, 4, inventorySlots.size(), true)) + if(!mergeItemStack(slotStack, 3, inventorySlots.size(), true)) { return null; } @@ -105,45 +104,29 @@ public class ContainerChemicalCrystallizer extends Container } else if(slotID == 2) { - if(!mergeItemStack(slotStack, 4, inventorySlots.size(), true)) - { - return null; - } - } - } - else if(slotStack.getItem() instanceof ItemMachineUpgrade) - { - if(slotID != 0 && slotID != 1 && slotID != 2 && slotID != 3) - { - if(!mergeItemStack(slotStack, 3, 4, false)) - { - return null; - } - } - else { - if(!mergeItemStack(slotStack, 4, inventorySlots.size(), true)) + if(!mergeItemStack(slotStack, 3, inventorySlots.size(), true)) { return null; } } } else { - if(slotID >= 4 && slotID <= 30) + if(slotID >= 3 && slotID <= 29) { - if(!mergeItemStack(slotStack, 31, inventorySlots.size(), false)) + if(!mergeItemStack(slotStack, 30, inventorySlots.size(), false)) { return null; } } - else if(slotID > 30) + else if(slotID > 29) { - if(!mergeItemStack(slotStack, 4, 30, false)) + if(!mergeItemStack(slotStack, 3, 29, false)) { return null; } } else { - if(!mergeItemStack(slotStack, 4, inventorySlots.size(), true)) + if(!mergeItemStack(slotStack, 3, inventorySlots.size(), true)) { return null; } diff --git a/src/main/java/mekanism/common/inventory/container/ContainerChemicalDissolutionChamber.java b/src/main/java/mekanism/common/inventory/container/ContainerChemicalDissolutionChamber.java index a59e395f4..d7d6db4c5 100644 --- a/src/main/java/mekanism/common/inventory/container/ContainerChemicalDissolutionChamber.java +++ b/src/main/java/mekanism/common/inventory/container/ContainerChemicalDissolutionChamber.java @@ -26,7 +26,6 @@ public class ContainerChemicalDissolutionChamber extends Container addSlotToContainer(new Slot(tentity, 1, 26, 36)); addSlotToContainer(new SlotStorageTank(tentity, 2, 155, 25)); addSlotToContainer(new SlotDischarge(tentity, 3, 155, 5)); - addSlotToContainer(new SlotMachineUpgrade(tentity, 4, 180, 11)); int slotY; @@ -83,7 +82,7 @@ public class ContainerChemicalDissolutionChamber extends Container } } else { - if(!mergeItemStack(slotStack, 5, inventorySlots.size(), true)) + if(!mergeItemStack(slotStack, 4, inventorySlots.size(), true)) { return null; } @@ -100,7 +99,7 @@ public class ContainerChemicalDissolutionChamber extends Container } else if(slotID == 3) { - if(!mergeItemStack(slotStack, 5, inventorySlots.size(), true)) + if(!mergeItemStack(slotStack, 4, inventorySlots.size(), true)) { return null; } @@ -119,45 +118,29 @@ public class ContainerChemicalDissolutionChamber extends Container } } else { - if(!mergeItemStack(slotStack, 5, inventorySlots.size(), true)) - { - return null; - } - } - } - else if(slotStack.getItem() instanceof ItemMachineUpgrade) - { - if(slotID != 0 && slotID != 1 && slotID != 2 && slotID != 3 && slotID != 4) - { - if(!mergeItemStack(slotStack, 4, 5, false)) - { - return null; - } - } - else { - if(!mergeItemStack(slotStack, 5, inventorySlots.size(), true)) + if(!mergeItemStack(slotStack, 4, inventorySlots.size(), true)) { return null; } } } else { - if(slotID >= 5 && slotID <= 31) + if(slotID >= 4 && slotID <= 30) { - if(!mergeItemStack(slotStack, 32, inventorySlots.size(), false)) + if(!mergeItemStack(slotStack, 31, inventorySlots.size(), false)) { return null; } } - else if(slotID > 31) + else if(slotID > 30) { - if(!mergeItemStack(slotStack, 5, 31, false)) + if(!mergeItemStack(slotStack, 4, 30, false)) { return null; } } else { - if(!mergeItemStack(slotStack, 5, inventorySlots.size(), true)) + if(!mergeItemStack(slotStack, 4, inventorySlots.size(), true)) { return null; } diff --git a/src/main/java/mekanism/common/inventory/container/ContainerChemicalOxidizer.java b/src/main/java/mekanism/common/inventory/container/ContainerChemicalOxidizer.java index d4a659825..ccba9f249 100644 --- a/src/main/java/mekanism/common/inventory/container/ContainerChemicalOxidizer.java +++ b/src/main/java/mekanism/common/inventory/container/ContainerChemicalOxidizer.java @@ -25,7 +25,6 @@ public class ContainerChemicalOxidizer extends Container addSlotToContainer(new Slot(tentity, 0, 26, 36)); addSlotToContainer(new SlotDischarge(tentity, 1, 155, 5)); addSlotToContainer(new SlotStorageTank(tentity, 2, 155, 25)); - addSlotToContainer(new SlotMachineUpgrade(tentity, 3, 180, 11)); int slotX; @@ -90,7 +89,7 @@ public class ContainerChemicalOxidizer extends Container } else if(slotID == 1) { - if(!mergeItemStack(slotStack, 4, inventorySlots.size(), true)) + if(!mergeItemStack(slotStack, 3, inventorySlots.size(), true)) { return null; } @@ -106,45 +105,29 @@ public class ContainerChemicalOxidizer extends Container } } else { - if(!mergeItemStack(slotStack, 4, inventorySlots.size(), true)) - { - return null; - } - } - } - else if(slotStack.getItem() instanceof ItemMachineUpgrade) - { - if(slotID != 0 && slotID != 1 && slotID != 2 && slotID != 3) - { - if(!mergeItemStack(slotStack, 3, 4, false)) - { - return null; - } - } - else { - if(!mergeItemStack(slotStack, 4, inventorySlots.size(), true)) + if(!mergeItemStack(slotStack, 3, inventorySlots.size(), true)) { return null; } } } else { - if(slotID >= 4 && slotID <= 30) + if(slotID >= 3 && slotID <= 29) { - if(!mergeItemStack(slotStack, 31, inventorySlots.size(), false)) + if(!mergeItemStack(slotStack, 30, inventorySlots.size(), false)) { return null; } } - else if(slotID > 30) + else if(slotID > 29) { - if(!mergeItemStack(slotStack, 4, 30, false)) + if(!mergeItemStack(slotStack, 3, 29, false)) { return null; } } else { - if(!mergeItemStack(slotStack, 4, inventorySlots.size(), true)) + if(!mergeItemStack(slotStack, 3, inventorySlots.size(), true)) { return null; } diff --git a/src/main/java/mekanism/common/inventory/container/ContainerDigitalMiner.java b/src/main/java/mekanism/common/inventory/container/ContainerDigitalMiner.java index 82e7c4c9a..5d6c96e57 100644 --- a/src/main/java/mekanism/common/inventory/container/ContainerDigitalMiner.java +++ b/src/main/java/mekanism/common/inventory/container/ContainerDigitalMiner.java @@ -28,19 +28,18 @@ public class ContainerDigitalMiner extends Container } addSlotToContainer(new SlotDischarge(tentity, 27, 152, 6)); - addSlotToContainer(new SlotMachineUpgrade(tentity, 28, 180, 11)); int slotX; - for(slotX = 0; slotX < 3; ++slotX) + for(slotX = 0; slotX < 3; slotX++) { - for(int slotY = 0; slotY < 9; ++slotY) + for(int slotY = 0; slotY < 9; slotY++) { addSlotToContainer(new Slot(inventory, slotY + slotX * 9 + 9, 8 + slotY * 18, 148 + slotX * 18)); } } - for(slotX = 0; slotX < 9; ++slotX) + for(slotX = 0; slotX < 9; slotX++) { addSlotToContainer(new Slot(inventory, slotX, 8 + slotX * 18, 206)); } @@ -86,23 +85,7 @@ public class ContainerDigitalMiner extends Container } else if(slotID == 27) { - if(!mergeItemStack(slotStack, 29, inventorySlots.size(), true)) - { - return null; - } - } - } - else if(slotStack.getItem() instanceof ItemMachineUpgrade) - { - if(slotID != 27 && slotID != 28) - { - if(!mergeItemStack(slotStack, 28, 29, false)) - { - return null; - } - } - else { - if(!mergeItemStack(slotStack, 29, inventorySlots.size(), true)) + if(!mergeItemStack(slotStack, 28, inventorySlots.size(), true)) { return null; } @@ -111,7 +94,7 @@ public class ContainerDigitalMiner extends Container else { if(slotID < 27) { - if(!mergeItemStack(slotStack, 29, inventorySlots.size(), true)) + if(!mergeItemStack(slotStack, 28, inventorySlots.size(), true)) { return null; } diff --git a/src/main/java/mekanism/common/inventory/container/ContainerElectricMachine.java b/src/main/java/mekanism/common/inventory/container/ContainerElectricMachine.java index a33308b1b..8b72812b6 100644 --- a/src/main/java/mekanism/common/inventory/container/ContainerElectricMachine.java +++ b/src/main/java/mekanism/common/inventory/container/ContainerElectricMachine.java @@ -23,7 +23,6 @@ public class ContainerElectricMachine extends Container addSlotToContainer(new Slot(tentity, 0, 56, 17)); addSlotToContainer(new SlotDischarge(tentity, 1, 56, 53)); addSlotToContainer(new SlotOutput(tentity, 2, 116, 35)); - addSlotToContainer(new SlotMachineUpgrade(tentity, 3, 180, 11)); int slotX; for(slotX = 0; slotX < 3; slotX++) @@ -71,14 +70,14 @@ public class ContainerElectricMachine extends Container if(slotID == 2) { - if(!mergeItemStack(slotStack, 4, inventorySlots.size(), true)) + if(!mergeItemStack(slotStack, 3, inventorySlots.size(), true)) { return null; } } else if(RecipeHandler.getOutput(slotStack, false, tileEntity.getRecipes()) != null) { - if(slotID != 0 && slotID != 1 && slotID != 2 && slotID != 3) + if(slotID != 0 && slotID != 1 && slotID != 2) { if(!mergeItemStack(slotStack, 0, 1, false)) { @@ -86,7 +85,7 @@ public class ContainerElectricMachine extends Container } } else { - if(!mergeItemStack(slotStack, 4, inventorySlots.size(), true)) + if(!mergeItemStack(slotStack, 3, inventorySlots.size(), true)) { return null; } @@ -103,45 +102,29 @@ public class ContainerElectricMachine extends Container } else if(slotID == 1) { - if(!mergeItemStack(slotStack, 4, inventorySlots.size(), true)) - { - return null; - } - } - } - else if(slotStack.getItem() instanceof ItemMachineUpgrade) - { - if(slotID != 0 && slotID != 1 && slotID != 2 && slotID != 3) - { - if(!mergeItemStack(slotStack, 3, 4, false)) - { - return null; - } - } - else { - if(!mergeItemStack(slotStack, 4, inventorySlots.size(), true)) + if(!mergeItemStack(slotStack, 3, inventorySlots.size(), true)) { return null; } } } else { - if(slotID >= 4 && slotID <= 30) + if(slotID >= 3 && slotID <= 29) { - if(!mergeItemStack(slotStack, 31, inventorySlots.size(), false)) + if(!mergeItemStack(slotStack, 30, inventorySlots.size(), false)) { return null; } } - else if(slotID > 30) + else if(slotID > 29) { - if(!mergeItemStack(slotStack, 4, 30, false)) + if(!mergeItemStack(slotStack, 3, 29, false)) { return null; } } else { - if(!mergeItemStack(slotStack, 4, inventorySlots.size(), true)) + if(!mergeItemStack(slotStack, 3, inventorySlots.size(), true)) { return null; } diff --git a/src/main/java/mekanism/common/inventory/container/ContainerUpgradeManagement.java b/src/main/java/mekanism/common/inventory/container/ContainerUpgradeManagement.java index dd253b158..ce5dd9bc3 100644 --- a/src/main/java/mekanism/common/inventory/container/ContainerUpgradeManagement.java +++ b/src/main/java/mekanism/common/inventory/container/ContainerUpgradeManagement.java @@ -2,6 +2,7 @@ package mekanism.common.inventory.container; import mekanism.common.IUpgradeTile; import mekanism.common.inventory.slot.SlotMachineUpgrade; +import mekanism.common.item.ItemMachineUpgrade; import mekanism.common.tile.TileEntityContainerBlock; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; @@ -16,7 +17,7 @@ public class ContainerUpgradeManagement extends Container public ContainerUpgradeManagement(InventoryPlayer inventory, IUpgradeTile tile) { tileEntity = tile; - addSlotToContainer(new SlotMachineUpgrade((TileEntityContainerBlock)tile, 3, 180, 11)); + addSlotToContainer(new SlotMachineUpgrade((TileEntityContainerBlock)tile, tileEntity.getComponent().getUpgradeSlot(), 154, 7)); int slotX; @@ -63,24 +64,42 @@ public class ContainerUpgradeManagement extends Container ItemStack slotStack = currentSlot.getStack(); stack = slotStack.copy(); - if(slotID >= 0 && slotID <= 26) + if(slotStack.getItem() instanceof ItemMachineUpgrade) { - if(!mergeItemStack(slotStack, 27, inventorySlots.size(), false)) + if(slotID != 0) { - return null; + if(!mergeItemStack(slotStack, 0, 1, false)) + { + return null; + } } - } - else if(slotID > 26) - { - if(!mergeItemStack(slotStack, 0, 26, false)) - { - return null; + else { + if(!mergeItemStack(slotStack, 1, inventorySlots.size(), true)) + { + return null; + } } } else { - if(!mergeItemStack(slotStack, 0, inventorySlots.size(), true)) + if(slotID >= 1 && slotID <= 27) { - return null; + if(!mergeItemStack(slotStack, 28, inventorySlots.size(), false)) + { + return null; + } + } + else if(slotID > 27) + { + if(!mergeItemStack(slotStack, 1, 27, false)) + { + return null; + } + } + else { + if(!mergeItemStack(slotStack, 1, inventorySlots.size(), true)) + { + return null; + } } } diff --git a/src/main/java/mekanism/common/tile/component/TileComponentUpgrade.java b/src/main/java/mekanism/common/tile/component/TileComponentUpgrade.java index b1a16a5cf..c00358dad 100644 --- a/src/main/java/mekanism/common/tile/component/TileComponentUpgrade.java +++ b/src/main/java/mekanism/common/tile/component/TileComponentUpgrade.java @@ -96,6 +96,11 @@ public class TileComponentUpgrade implements ITileComponent } } } + + public int getUpgradeSlot() + { + return upgradeSlot; + } public int getScaledUpgradeProgress(int i) { diff --git a/src/main/resources/assets/mekanism/gui/GuiUpgradeManagement.png b/src/main/resources/assets/mekanism/gui/GuiUpgradeManagement.png index 3b1d25315..c75320fb9 100644 Binary files a/src/main/resources/assets/mekanism/gui/GuiUpgradeManagement.png and b/src/main/resources/assets/mekanism/gui/GuiUpgradeManagement.png differ diff --git a/src/main/resources/assets/mekanism/gui/GuiUpgrades.png b/src/main/resources/assets/mekanism/gui/GuiUpgrades.png deleted file mode 100644 index fbf597760..000000000 Binary files a/src/main/resources/assets/mekanism/gui/GuiUpgrades.png and /dev/null differ diff --git a/src/main/resources/assets/mekanism/gui/elements/GuiConfigurationTab.png b/src/main/resources/assets/mekanism/gui/elements/GuiConfigurationTab.png index dc7ac6a55..45bded2cd 100644 Binary files a/src/main/resources/assets/mekanism/gui/elements/GuiConfigurationTab.png and b/src/main/resources/assets/mekanism/gui/elements/GuiConfigurationTab.png differ diff --git a/src/main/resources/assets/mekanism/gui/elements/GuiRedstoneControl.png b/src/main/resources/assets/mekanism/gui/elements/GuiRedstoneControl.png index 72fb3b585..19e2b358d 100644 Binary files a/src/main/resources/assets/mekanism/gui/elements/GuiRedstoneControl.png and b/src/main/resources/assets/mekanism/gui/elements/GuiRedstoneControl.png differ diff --git a/src/main/resources/assets/mekanism/gui/elements/GuiUpgradeManagement.png b/src/main/resources/assets/mekanism/gui/elements/GuiUpgradeManagement.png deleted file mode 100644 index d278b9bc9..000000000 Binary files a/src/main/resources/assets/mekanism/gui/elements/GuiUpgradeManagement.png and /dev/null differ diff --git a/src/main/resources/assets/mekanism/gui/elements/GuiUpgradeTab.png b/src/main/resources/assets/mekanism/gui/elements/GuiUpgradeTab.png new file mode 100644 index 000000000..a6d99df03 Binary files /dev/null and b/src/main/resources/assets/mekanism/gui/elements/GuiUpgradeTab.png differ diff --git a/src/main/resources/assets/mekanism/lang/en_US.lang b/src/main/resources/assets/mekanism/lang/en_US.lang index 3562824e6..bad7f9a71 100644 --- a/src/main/resources/assets/mekanism/lang/en_US.lang +++ b/src/main/resources/assets/mekanism/lang/en_US.lang @@ -349,6 +349,8 @@ gui.id=ID gui.finished=Finished gui.well=All is well! +gui.upgrades=Upgrades + gui.chemicalInfuser.short=C. Infuser gui.chemicalDissolutionChamber.short=C. Dissolution Chamber