diff --git a/src/main/java/mekanism/client/gui/GuiBucketIO.java b/src/main/java/mekanism/client/gui/GuiBucketIO.java index 30d763920..7c6c00222 100644 --- a/src/main/java/mekanism/client/gui/GuiBucketIO.java +++ b/src/main/java/mekanism/client/gui/GuiBucketIO.java @@ -18,7 +18,7 @@ public class GuiBucketIO extends GuiElement @Override public Rectangle4i getBounds(int guiWidth, int guiHeight) { - return new Rectangle4i(guiWidth - 26, guiHeight + 4, 26, 57); + return new Rectangle4i(guiWidth + 176, guiHeight + 66, 26, 57); } @Override @@ -26,7 +26,7 @@ public class GuiBucketIO extends GuiElement { mc.renderEngine.bindTexture(RESOURCE); - guiObj.drawTexturedRect(guiWidth - 26, guiHeight + 4, 0, 0, 26, 57); + guiObj.drawTexturedRect(guiWidth + 176, guiHeight + 66, 0, 0, 26, 57); mc.renderEngine.bindTexture(defaultLocation); } @@ -40,8 +40,20 @@ public class GuiBucketIO extends GuiElement } @Override - public void preMouseClicked(int xAxis, int yAxis, int button) {} + public void preMouseClicked(int xAxis, int yAxis, int button) + { + if((xAxis >= 180 && xAxis <= 196 && yAxis >= 71 && yAxis <= 87) || (xAxis >= 180 && xAxis <= 196 && yAxis >= 102 && yAxis <= 118)) + { + offsetX(26); + } + } @Override - public void mouseClicked(int xAxis, int yAxis, int button) {} + public void mouseClicked(int xAxis, int yAxis, int button) + { + if((xAxis >= 180 && xAxis <= 196 && yAxis >= 71 && yAxis <= 87) || (xAxis >= 180 && xAxis <= 196 && yAxis >= 102 && yAxis <= 118)) + { + offsetX(-26); + } + } } diff --git a/src/main/java/mekanism/client/gui/GuiElement.java b/src/main/java/mekanism/client/gui/GuiElement.java index 3c8c5f3b9..ac812f03c 100644 --- a/src/main/java/mekanism/client/gui/GuiElement.java +++ b/src/main/java/mekanism/client/gui/GuiElement.java @@ -47,7 +47,9 @@ public abstract class GuiElement try { int size = (Integer)MekanismUtils.getPrivateValue(guiObj, GuiContainer.class, ObfuscatedNames.GuiContainer_xSize); MekanismUtils.setPrivateValue(guiObj, size + xSize, GuiContainer.class, ObfuscatedNames.GuiContainer_xSize); - } catch(Exception e) {} + } catch(Exception e) { + e.printStackTrace(); + } } } @@ -58,7 +60,36 @@ public abstract class GuiElement try { int size = (Integer)MekanismUtils.getPrivateValue(guiObj, GuiContainer.class, ObfuscatedNames.GuiContainer_ySize); MekanismUtils.setPrivateValue(guiObj, size + ySize, GuiContainer.class, ObfuscatedNames.GuiContainer_ySize); - } catch(Exception e) {} + } catch(Exception e) { + e.printStackTrace(); + } + } + } + + protected void offsetLeft(int guiLeft) + { + if(guiObj instanceof GuiContainer) + { + try { + int left = (Integer)MekanismUtils.getPrivateValue(guiObj, GuiContainer.class, ObfuscatedNames.GuiContainer_guiLeft); + System.out.println(left + " " + guiLeft); + MekanismUtils.setPrivateValue(guiObj, left + guiLeft, GuiContainer.class, ObfuscatedNames.GuiContainer_guiLeft); + } catch(Exception e) { + e.printStackTrace(); + } + } + } + + protected void offsetTop(int guiTop) + { + if(guiObj instanceof GuiContainer) + { + try { + int top = (Integer)MekanismUtils.getPrivateValue(guiObj, GuiContainer.class, ObfuscatedNames.GuiContainer_guiTop); + MekanismUtils.setPrivateValue(guiObj, top + guiTop, GuiContainer.class, ObfuscatedNames.GuiContainer_guiTop); + } catch(Exception e) { + e.printStackTrace(); + } } } diff --git a/src/main/java/mekanism/client/gui/GuiUpgradeManagement.java b/src/main/java/mekanism/client/gui/GuiUpgradeManagement.java index a95241137..8d871a7b8 100644 --- a/src/main/java/mekanism/client/gui/GuiUpgradeManagement.java +++ b/src/main/java/mekanism/client/gui/GuiUpgradeManagement.java @@ -72,36 +72,30 @@ public class GuiUpgradeManagement extends GuiElement @Override public void preMouseClicked(int xAxis, int yAxis, int button) { - if(button == 0) + if(xAxis >= 180 && xAxis <= 196 && yAxis >= 11 && yAxis <= 27) { - if(xAxis >= 180 && xAxis <= 196 && yAxis >= 11 && yAxis <= 27) - { - offsetX(26); - } + offsetX(26); } } @Override public void mouseClicked(int xAxis, int yAxis, int button) { - if(button == 0) + if(xAxis >= 179 && xAxis <= 198 && yAxis >= 47 && yAxis <= 54) { - if(xAxis >= 179 && xAxis <= 198 && yAxis >= 47 && yAxis <= 54) - { - SoundHandler.playSound("gui.button.press"); - Mekanism.packetHandler.sendToServer(new RemoveUpgradeMessage(Coord4D.get(tileEntity), (byte)0)); - } + 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 >= 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); - } + if(xAxis >= 180 && xAxis <= 196 && yAxis >= 11 && yAxis <= 27) + { + offsetX(-26); } } } diff --git a/src/main/java/mekanism/common/inventory/container/ContainerChemicalCrystallizer.java b/src/main/java/mekanism/common/inventory/container/ContainerChemicalCrystallizer.java index 2ada2b433..956005c43 100644 --- a/src/main/java/mekanism/common/inventory/container/ContainerChemicalCrystallizer.java +++ b/src/main/java/mekanism/common/inventory/container/ContainerChemicalCrystallizer.java @@ -5,6 +5,7 @@ import mekanism.common.inventory.slot.SlotEnergy.SlotDischarge; import mekanism.common.inventory.slot.SlotMachineUpgrade; import mekanism.common.inventory.slot.SlotOutput; import mekanism.common.inventory.slot.SlotStorageTank; +import mekanism.common.item.ItemMachineUpgrade; import mekanism.common.tile.TileEntityChemicalCrystallizer; import mekanism.common.util.ChargeUtils; import net.minecraft.entity.player.EntityPlayer; @@ -80,7 +81,7 @@ public class ContainerChemicalCrystallizer extends Container } } else { - if(!mergeItemStack(slotStack, 3, inventorySlots.size(), true)) + if(!mergeItemStack(slotStack, 4, inventorySlots.size(), true)) { return null; } @@ -88,45 +89,61 @@ public class ContainerChemicalCrystallizer extends Container } else if(slotID == 1) { - if(!mergeItemStack(slotStack, 3, inventorySlots.size(), true)) + if(!mergeItemStack(slotStack, 4, inventorySlots.size(), true)) { return null; } } else if(ChargeUtils.canBeDischarged(slotStack)) { - if(slotID != 3) + if(slotID != 2) { if(!mergeItemStack(slotStack, 2, 3, false)) { return null; } } - else if(slotID == 3) + else if(slotID == 2) { - if(!mergeItemStack(slotStack, 3, inventorySlots.size(), true)) + 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)) { return null; } } } else { - if(slotID >= 3 && slotID <= 29) + if(slotID >= 4 && slotID <= 30) { - if(!mergeItemStack(slotStack, 30, inventorySlots.size(), false)) + if(!mergeItemStack(slotStack, 31, inventorySlots.size(), false)) { return null; } } else if(slotID > 30) { - if(!mergeItemStack(slotStack, 3, 29, false)) + if(!mergeItemStack(slotStack, 4, 30, false)) { return null; } } else { - if(!mergeItemStack(slotStack, 3, 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 83f5cb495..d4a659825 100644 --- a/src/main/java/mekanism/common/inventory/container/ContainerChemicalOxidizer.java +++ b/src/main/java/mekanism/common/inventory/container/ContainerChemicalOxidizer.java @@ -4,6 +4,7 @@ import mekanism.api.gas.IGasItem; import mekanism.common.inventory.slot.SlotEnergy.SlotDischarge; import mekanism.common.inventory.slot.SlotMachineUpgrade; import mekanism.common.inventory.slot.SlotStorageTank; +import mekanism.common.item.ItemMachineUpgrade; import mekanism.common.recipe.RecipeHandler; import mekanism.common.recipe.RecipeHandler.Recipe; import mekanism.common.tile.TileEntityChemicalOxidizer; @@ -28,15 +29,15 @@ public class ContainerChemicalOxidizer extends Container 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)); } @@ -89,7 +90,7 @@ public class ContainerChemicalOxidizer extends Container } else if(slotID == 1) { - if(!mergeItemStack(slotStack, 3, inventorySlots.size(), true)) + if(!mergeItemStack(slotStack, 4, inventorySlots.size(), true)) { return null; } @@ -105,29 +106,45 @@ public class ContainerChemicalOxidizer extends Container } } else { - if(!mergeItemStack(slotStack, 3, inventorySlots.size(), true)) + 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)) { return null; } } } else { - if(slotID >= 3 && slotID <= 29) + if(slotID >= 4 && slotID <= 30) { - if(!mergeItemStack(slotStack, 30, inventorySlots.size(), false)) + if(!mergeItemStack(slotStack, 31, inventorySlots.size(), false)) { return null; } } else if(slotID > 30) { - if(!mergeItemStack(slotStack, 3, 29, false)) + if(!mergeItemStack(slotStack, 4, 30, false)) { return null; } } else { - if(!mergeItemStack(slotStack, 3, inventorySlots.size(), true)) + if(!mergeItemStack(slotStack, 4, inventorySlots.size(), true)) { return null; } diff --git a/src/main/java/mekanism/common/inventory/container/ContainerChemicalWasher.java b/src/main/java/mekanism/common/inventory/container/ContainerChemicalWasher.java index ffd133cda..f715faee0 100644 --- a/src/main/java/mekanism/common/inventory/container/ContainerChemicalWasher.java +++ b/src/main/java/mekanism/common/inventory/container/ContainerChemicalWasher.java @@ -21,8 +21,8 @@ public class ContainerChemicalWasher extends Container public ContainerChemicalWasher(InventoryPlayer inventory, TileEntityChemicalWasher tentity) { tileEntity = tentity; - addSlotToContainer(new Slot(tentity, 0, -20, 9)); - addSlotToContainer(new SlotOutput(tentity, 1, -20, 40)); + addSlotToContainer(new Slot(tentity, 0, 180, 71)); + addSlotToContainer(new SlotOutput(tentity, 1, 180, 102)); addSlotToContainer(new SlotStorageTank(tentity, 2, 155, 56)); addSlotToContainer(new SlotDischarge(tentity, 3, 155, 5)); diff --git a/src/main/java/mekanism/common/inventory/container/ContainerElectricMachine.java b/src/main/java/mekanism/common/inventory/container/ContainerElectricMachine.java index 664a0c0d6..a33308b1b 100644 --- a/src/main/java/mekanism/common/inventory/container/ContainerElectricMachine.java +++ b/src/main/java/mekanism/common/inventory/container/ContainerElectricMachine.java @@ -26,15 +26,15 @@ public class ContainerElectricMachine extends Container addSlotToContainer(new SlotMachineUpgrade(tentity, 3, 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, 84 + slotX * 18)); } } - for(slotX = 0; slotX < 9; ++slotX) + for(slotX = 0; slotX < 9; slotX++) { addSlotToContainer(new Slot(inventory, slotX, 8 + slotX * 18, 142)); } diff --git a/src/main/resources/assets/mekanism/gui/elements/GuiBucket.png b/src/main/resources/assets/mekanism/gui/elements/GuiBucket.png index fbab38d15..046d6ec5f 100644 Binary files a/src/main/resources/assets/mekanism/gui/elements/GuiBucket.png and b/src/main/resources/assets/mekanism/gui/elements/GuiBucket.png differ diff --git a/src/main/resources/assets/mekanism/gui/elements/GuiRecipeType.png b/src/main/resources/assets/mekanism/gui/elements/GuiRecipeType.png index 704d60972..2f995cdc5 100644 Binary files a/src/main/resources/assets/mekanism/gui/elements/GuiRecipeType.png and b/src/main/resources/assets/mekanism/gui/elements/GuiRecipeType.png differ