From 15a8cfe9db9e55c7c33eabcf62fe0b2dd1cf06a7 Mon Sep 17 00:00:00 2001 From: Ben Spiers Date: Sat, 19 Apr 2014 01:41:48 +0100 Subject: [PATCH] Work on un-screwing up NEI recipe GUIs. --- .../gui/GuiAdvancedElectricMachine.java | 12 +++--- common/mekanism/client/gui/GuiBucketIO.java | 6 +-- .../mekanism/client/gui/GuiChanceMachine.java | 10 ++--- .../client/gui/GuiChemicalCrystallizer.java | 12 +++--- .../gui/GuiChemicalDissolutionChamber.java | 16 ++++---- .../client/gui/GuiChemicalInfuser.java | 20 +++++----- .../client/gui/GuiChemicalOxidizer.java | 12 +++--- .../client/gui/GuiChemicalWasher.java | 16 ++++---- .../client/gui/GuiConfigurationTab.java | 14 ++++--- .../mekanism/client/gui/GuiDigitalMiner.java | 6 +-- .../client/gui/GuiElectricMachine.java | 10 ++--- .../mekanism/client/gui/GuiElectricPump.java | 8 ++-- .../client/gui/GuiElectrolyticSeparator.java | 18 ++++----- common/mekanism/client/gui/GuiElement.java | 13 +++---- common/mekanism/client/gui/GuiEnergyCube.java | 8 ++-- .../mekanism/client/gui/GuiEnergyGauge.java | 4 +- common/mekanism/client/gui/GuiEnergyInfo.java | 6 +-- common/mekanism/client/gui/GuiFactory.java | 2 +- common/mekanism/client/gui/GuiFluidGauge.java | 4 +- common/mekanism/client/gui/GuiGasGauge.java | 4 +- common/mekanism/client/gui/GuiGauge.java | 12 +++--- common/mekanism/client/gui/GuiMekanism.java | 33 +++++++++++++++- .../client/gui/GuiMetallurgicInfuser.java | 12 +++--- common/mekanism/client/gui/GuiPRC.java | 14 +++---- common/mekanism/client/gui/GuiPowerBar.java | 8 ++-- common/mekanism/client/gui/GuiProgress.java | 9 ++--- common/mekanism/client/gui/GuiRecipeType.java | 14 ++++--- .../client/gui/GuiRedstoneControl.java | 14 ++++--- .../client/gui/GuiRotaryCondensentrator.java | 18 ++++----- .../client/gui/GuiSeismicVibrator.java | 2 +- common/mekanism/client/gui/GuiSlot.java | 8 ++-- common/mekanism/client/gui/GuiSortingTab.java | 14 ++++--- common/mekanism/client/gui/GuiTeleporter.java | 2 +- .../client/gui/GuiUpgradeManagement.java | 12 ++++-- common/mekanism/client/gui/IGuiWrapper.java | 19 ++++++++++ .../nei/AdvancedMachineRecipeHandler.java | 6 +++ .../client/nei/BaseRecipeHandler.java | 37 +++++++++++++++++- .../ChemicalCrystallizerRecipeHandler.java | 6 +++ ...emicalDissolutionChamberRecipeHandler.java | 6 +++ .../nei/ChemicalInfuserRecipeHandler.java | 6 +++ .../nei/ChemicalOxidizerRecipeHandler.java | 6 +++ .../nei/ChemicalWasherRecipeHandler.java | 6 +++ .../client/nei/CrusherRecipeHandler.java | 9 ++--- .../ElectrolyticSeparatorRecipeHandler.java | 6 +++ .../nei/EnrichmentChamberRecipeHandler.java | 6 --- .../client/nei/MachineRecipeHandler.java | 38 +++++++++++++++++++ .../nei/MetallurgicInfuserRecipeHandler.java | 6 +++ .../RotaryCondensentratorRecipeHandler.java | 6 +++ .../SalinationControllerRecipeHandler.java | 6 +++ .../client/gui/GuiBioGenerator.java | 6 +-- .../client/gui/GuiHeatGenerator.java | 8 ++-- .../client/gui/GuiHydrogenGenerator.java | 8 ++-- .../client/gui/GuiSolarGenerator.java | 4 +- .../generators/client/gui/GuiWindTurbine.java | 4 +- 54 files changed, 381 insertions(+), 191 deletions(-) create mode 100644 common/mekanism/client/gui/IGuiWrapper.java diff --git a/common/mekanism/client/gui/GuiAdvancedElectricMachine.java b/common/mekanism/client/gui/GuiAdvancedElectricMachine.java index fd6f842be..30bd1156c 100644 --- a/common/mekanism/client/gui/GuiAdvancedElectricMachine.java +++ b/common/mekanism/client/gui/GuiAdvancedElectricMachine.java @@ -41,12 +41,12 @@ public class GuiAdvancedElectricMachine extends GuiMekanism String multiplier = MekanismUtils.getEnergyDisplay(MekanismUtils.getEnergyPerTick(tileEntity.getSpeedMultiplier(), tileEntity.getEnergyMultiplier(), tileEntity.ENERGY_PER_TICK)); return ListUtils.asList("Using: " + multiplier + "/t", "Needed: " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxEnergy()-tileEntity.getEnergy())); } - }, this, tileEntity, tileEntity.guiLocation)); + }, this, tileEntity.guiLocation)); - guiElements.add(new GuiSlot(SlotType.INPUT, this, tileEntity, tileEntity.guiLocation, 55, 16)); - guiElements.add(new GuiSlot(SlotType.POWER, this, tileEntity, tileEntity.guiLocation, 30, 34).with(SlotOverlay.POWER)); - guiElements.add(new GuiSlot(SlotType.EXTRA, this, tileEntity, tileEntity.guiLocation, 55, 52)); - guiElements.add(new GuiSlot(SlotType.OUTPUT_LARGE, this, tileEntity, tileEntity.guiLocation, 111, 30)); + guiElements.add(new GuiSlot(SlotType.INPUT, this, tileEntity.guiLocation, 55, 16)); + guiElements.add(new GuiSlot(SlotType.POWER, this, tileEntity.guiLocation, 30, 34).with(SlotOverlay.POWER)); + guiElements.add(new GuiSlot(SlotType.EXTRA, this, tileEntity.guiLocation, 55, 52)); + guiElements.add(new GuiSlot(SlotType.OUTPUT_LARGE, this, tileEntity.guiLocation, 111, 30)); guiElements.add(new GuiProgress(new IProgressInfoHandler() { @@ -55,7 +55,7 @@ public class GuiAdvancedElectricMachine extends GuiMekanism { return tileEntity.getScaledProgress(); } - }, tileEntity.getProgressType(), this, tileEntity, tileEntity.guiLocation, 77, 37)); + }, tileEntity.getProgressType(), this, tileEntity.guiLocation, 77, 37)); } @Override diff --git a/common/mekanism/client/gui/GuiBucketIO.java b/common/mekanism/client/gui/GuiBucketIO.java index f9ef7ed61..eb603e56a 100644 --- a/common/mekanism/client/gui/GuiBucketIO.java +++ b/common/mekanism/client/gui/GuiBucketIO.java @@ -10,9 +10,9 @@ import cpw.mods.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class GuiBucketIO extends GuiElement { - public GuiBucketIO(GuiMekanism gui, TileEntity tile, ResourceLocation def) + public GuiBucketIO(IGuiWrapper gui, ResourceLocation def) { - super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiBucket.png"), gui, tile, def); + super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiBucket.png"), gui, def); } @Override @@ -20,7 +20,7 @@ public class GuiBucketIO extends GuiElement { mc.renderEngine.bindTexture(RESOURCE); - guiObj.drawTexturedModalRect(guiWidth - 26, guiHeight + 4, 0, 0, 26, 57); + guiObj.drawTexturedRect(guiWidth - 26, guiHeight + 4, 0, 0, 26, 57); mc.renderEngine.bindTexture(defaultLocation); } diff --git a/common/mekanism/client/gui/GuiChanceMachine.java b/common/mekanism/client/gui/GuiChanceMachine.java index 7675c2159..9d592f0dd 100644 --- a/common/mekanism/client/gui/GuiChanceMachine.java +++ b/common/mekanism/client/gui/GuiChanceMachine.java @@ -38,11 +38,11 @@ public class GuiChanceMachine extends GuiMekanism String multiplier = MekanismUtils.getEnergyDisplay(MekanismUtils.getEnergyPerTick(tileEntity.getSpeedMultiplier(), tileEntity.getEnergyMultiplier(), tileEntity.ENERGY_PER_TICK)); return ListUtils.asList("Using: " + multiplier + "/t", "Needed: " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxEnergy()-tileEntity.getEnergy())); } - }, this, tileEntity, tileEntity.guiLocation)); + }, this, tileEntity.guiLocation)); - guiElements.add(new GuiSlot(SlotType.INPUT, this, tileEntity, tileEntity.guiLocation, 55, 16)); - guiElements.add(new GuiSlot(SlotType.POWER, this, tileEntity, tileEntity.guiLocation, 55, 52).with(SlotOverlay.POWER)); - guiElements.add(new GuiSlot(SlotType.OUTPUT_WIDE, this, tileEntity, tileEntity.guiLocation, 111, 30)); + guiElements.add(new GuiSlot(SlotType.INPUT, this, tileEntity.guiLocation, 55, 16)); + guiElements.add(new GuiSlot(SlotType.POWER, this, tileEntity.guiLocation, 55, 52).with(SlotOverlay.POWER)); + guiElements.add(new GuiSlot(SlotType.OUTPUT_WIDE, this, tileEntity.guiLocation, 111, 30)); guiElements.add(new GuiProgress(new IProgressInfoHandler() { @@ -51,7 +51,7 @@ public class GuiChanceMachine extends GuiMekanism { return tileEntity.getScaledProgress(); } - }, tileEntity.getProgressType(), this, tileEntity, tileEntity.guiLocation, 77, 37)); + }, tileEntity.getProgressType(), this, tileEntity.guiLocation, 77, 37)); } @Override diff --git a/common/mekanism/client/gui/GuiChemicalCrystallizer.java b/common/mekanism/client/gui/GuiChemicalCrystallizer.java index b6e60881e..ec456a0cd 100644 --- a/common/mekanism/client/gui/GuiChemicalCrystallizer.java +++ b/common/mekanism/client/gui/GuiChemicalCrystallizer.java @@ -64,17 +64,17 @@ public class GuiChemicalCrystallizer extends GuiMekanism String multiplier = MekanismUtils.getEnergyDisplay(tileEntity.ENERGY_USAGE); return ListUtils.asList("Using: " + multiplier + "/t", "Needed: " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxEnergy()-tileEntity.getEnergy())); } - }, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalCrystallizer.png"))); + }, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalCrystallizer.png"))); guiElements.add(new GuiGasGauge(new IGasInfoHandler() { @Override public GasTank getTank() { return tileEntity.inputTank; } - }, GuiGauge.Type.STANDARD, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalCrystallizer.png"), 5, 4)); - guiElements.add(new GuiSlot(SlotType.EXTRA, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalCrystallizer.png"), 5, 64).with(SlotOverlay.PLUS)); - guiElements.add(new GuiSlot(SlotType.POWER, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalCrystallizer.png"), 154, 4).with(SlotOverlay.POWER)); - guiElements.add(new GuiSlot(SlotType.OUTPUT, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalCrystallizer.png"), 130, 56)); + }, GuiGauge.Type.STANDARD, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalCrystallizer.png"), 5, 4)); + guiElements.add(new GuiSlot(SlotType.EXTRA, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalCrystallizer.png"), 5, 64).with(SlotOverlay.PLUS)); + guiElements.add(new GuiSlot(SlotType.POWER, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalCrystallizer.png"), 154, 4).with(SlotOverlay.POWER)); + guiElements.add(new GuiSlot(SlotType.OUTPUT, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalCrystallizer.png"), 130, 56)); guiElements.add(new GuiProgress(new IProgressInfoHandler() { @@ -83,7 +83,7 @@ public class GuiChemicalCrystallizer extends GuiMekanism { return tileEntity.getScaledProgress(); } - }, ProgressBar.LARGE_RIGHT, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalCrystallizer.png"), 51, 60)); + }, ProgressBar.LARGE_RIGHT, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalCrystallizer.png"), 51, 60)); } @Override diff --git a/common/mekanism/client/gui/GuiChemicalDissolutionChamber.java b/common/mekanism/client/gui/GuiChemicalDissolutionChamber.java index 225ad204f..7d2afef86 100644 --- a/common/mekanism/client/gui/GuiChemicalDissolutionChamber.java +++ b/common/mekanism/client/gui/GuiChemicalDissolutionChamber.java @@ -39,26 +39,26 @@ public class GuiChemicalDissolutionChamber extends GuiMekanism String multiplier = MekanismUtils.getEnergyDisplay(tileEntity.ENERGY_USAGE); return ListUtils.asList("Using: " + multiplier + "/t", "Needed: " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxEnergy()-tileEntity.getEnergy())); } - }, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalDissolutionChamber.png"))); + }, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalDissolutionChamber.png"))); guiElements.add(new GuiGasGauge(new IGasInfoHandler() { @Override public GasTank getTank() { return tileEntity.injectTank; } - }, GuiGauge.Type.STANDARD, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalDissolutionChamber.png"), 5, 4)); + }, GuiGauge.Type.STANDARD, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalDissolutionChamber.png"), 5, 4)); guiElements.add(new GuiGasGauge(new IGasInfoHandler() { @Override public GasTank getTank() { return tileEntity.outputTank; } - }, GuiGauge.Type.STANDARD, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalDissolutionChamber.png"), 133, 13)); + }, GuiGauge.Type.STANDARD, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalDissolutionChamber.png"), 133, 13)); - guiElements.add(new GuiSlot(SlotType.NORMAL, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalDissolutionChamber.png"), 154, 4).with(SlotOverlay.POWER)); - guiElements.add(new GuiSlot(SlotType.NORMAL, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalDissolutionChamber.png"), 25, 35)); - guiElements.add(new GuiSlot(SlotType.NORMAL, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalDissolutionChamber.png"), 154, 24).with(SlotOverlay.PLUS)); - guiElements.add(new GuiSlot(SlotType.NORMAL, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalDissolutionChamber.png"), 5, 64).with(SlotOverlay.MINUS)); + guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalDissolutionChamber.png"), 154, 4).with(SlotOverlay.POWER)); + guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalDissolutionChamber.png"), 25, 35)); + guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalDissolutionChamber.png"), 154, 24).with(SlotOverlay.PLUS)); + guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalDissolutionChamber.png"), 5, 64).with(SlotOverlay.MINUS)); guiElements.add(new GuiProgress(new IProgressInfoHandler() { @@ -67,7 +67,7 @@ public class GuiChemicalDissolutionChamber extends GuiMekanism { return tileEntity.getScaledProgress(); } - }, ProgressBar.LARGE_RIGHT, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalDissolutionChamber.png"), 62, 39)); + }, ProgressBar.LARGE_RIGHT, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalDissolutionChamber.png"), 62, 39)); } @Override diff --git a/common/mekanism/client/gui/GuiChemicalInfuser.java b/common/mekanism/client/gui/GuiChemicalInfuser.java index a53799f6f..b3a7180ec 100644 --- a/common/mekanism/client/gui/GuiChemicalInfuser.java +++ b/common/mekanism/client/gui/GuiChemicalInfuser.java @@ -47,33 +47,33 @@ public class GuiChemicalInfuser extends GuiMekanism String multiplier = MekanismUtils.getEnergyDisplay(tileEntity.ENERGY_USAGE); return ListUtils.asList("Using: " + multiplier + "/t", "Needed: " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxEnergy()-tileEntity.getEnergy())); } - }, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalInfuser.png"))); + }, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalInfuser.png"))); guiElements.add(new GuiGasGauge(new IGasInfoHandler() { @Override public GasTank getTank() { return tileEntity.leftTank; } - }, GuiGauge.Type.STANDARD, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalInfuser.png"), 25, 13)); + }, GuiGauge.Type.STANDARD, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalInfuser.png"), 25, 13)); guiElements.add(new GuiGasGauge(new IGasInfoHandler() { @Override public GasTank getTank() { return tileEntity.centerTank; } - }, GuiGauge.Type.STANDARD, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalInfuser.png"), 79, 4)); + }, GuiGauge.Type.STANDARD, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalInfuser.png"), 79, 4)); guiElements.add(new GuiGasGauge(new IGasInfoHandler() { @Override public GasTank getTank() { return tileEntity.rightTank; } - }, GuiGauge.Type.STANDARD, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalInfuser.png"), 133, 13)); + }, GuiGauge.Type.STANDARD, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalInfuser.png"), 133, 13)); - guiElements.add(new GuiSlot(SlotType.NORMAL, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalInfuser.png"), 154, 4).with(SlotOverlay.POWER)); - guiElements.add(new GuiSlot(SlotType.NORMAL, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalInfuser.png"), 154, 55).with(SlotOverlay.MINUS)); - guiElements.add(new GuiSlot(SlotType.NORMAL, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalInfuser.png"), 4, 55).with(SlotOverlay.MINUS)); - guiElements.add(new GuiSlot(SlotType.NORMAL, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalInfuser.png"), 79, 64).with(SlotOverlay.PLUS)); + guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalInfuser.png"), 154, 4).with(SlotOverlay.POWER)); + guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalInfuser.png"), 154, 55).with(SlotOverlay.MINUS)); + guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalInfuser.png"), 4, 55).with(SlotOverlay.MINUS)); + guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalInfuser.png"), 79, 64).with(SlotOverlay.PLUS)); guiElements.add(new GuiProgress(new IProgressInfoHandler() { @@ -82,7 +82,7 @@ public class GuiChemicalInfuser extends GuiMekanism { return tileEntity.isActive ? 1 : 0; } - }, ProgressBar.SMALL_RIGHT, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalInfuser.png"), 45, 38)); + }, ProgressBar.SMALL_RIGHT, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalInfuser.png"), 45, 38)); guiElements.add(new GuiProgress(new IProgressInfoHandler() { @Override @@ -90,7 +90,7 @@ public class GuiChemicalInfuser extends GuiMekanism { return tileEntity.isActive ? 1 : 0; } - }, ProgressBar.SMALL_LEFT, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalInfuser.png"), 99, 38)); + }, ProgressBar.SMALL_LEFT, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalInfuser.png"), 99, 38)); } @Override diff --git a/common/mekanism/client/gui/GuiChemicalOxidizer.java b/common/mekanism/client/gui/GuiChemicalOxidizer.java index 26bb9b4b2..0534bf20b 100644 --- a/common/mekanism/client/gui/GuiChemicalOxidizer.java +++ b/common/mekanism/client/gui/GuiChemicalOxidizer.java @@ -39,18 +39,18 @@ public class GuiChemicalOxidizer extends GuiMekanism String multiplier = MekanismUtils.getEnergyDisplay(tileEntity.ENERGY_USAGE); return ListUtils.asList("Using: " + multiplier + "/t", "Needed: " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxEnergy()-tileEntity.getEnergy())); } - }, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalOxidizer.png"))); + }, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalOxidizer.png"))); guiElements.add(new GuiGasGauge(new IGasInfoHandler() { @Override public GasTank getTank() { return tileEntity.gasTank; } - }, GuiGauge.Type.STANDARD, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalOxidizer.png"), 133, 13)); + }, GuiGauge.Type.STANDARD, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalOxidizer.png"), 133, 13)); - guiElements.add(new GuiSlot(SlotType.NORMAL, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalOxidizer.png"), 154, 4).with(SlotOverlay.POWER)); - guiElements.add(new GuiSlot(SlotType.NORMAL, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalOxidizer.png"), 25, 35)); - guiElements.add(new GuiSlot(SlotType.NORMAL, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalOxidizer.png"), 154, 24).with(SlotOverlay.PLUS)); + guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalOxidizer.png"), 154, 4).with(SlotOverlay.POWER)); + guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalOxidizer.png"), 25, 35)); + guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalOxidizer.png"), 154, 24).with(SlotOverlay.PLUS)); guiElements.add(new GuiProgress(new IProgressInfoHandler() { @@ -59,7 +59,7 @@ public class GuiChemicalOxidizer extends GuiMekanism { return tileEntity.getScaledProgress(); } - }, ProgressBar.LARGE_RIGHT, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalOxidizer.png"), 62, 39)); + }, ProgressBar.LARGE_RIGHT, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalOxidizer.png"), 62, 39)); } @Override diff --git a/common/mekanism/client/gui/GuiChemicalWasher.java b/common/mekanism/client/gui/GuiChemicalWasher.java index a3728e8e1..a03a7d05e 100644 --- a/common/mekanism/client/gui/GuiChemicalWasher.java +++ b/common/mekanism/client/gui/GuiChemicalWasher.java @@ -43,7 +43,7 @@ public class GuiChemicalWasher extends GuiMekanism tileEntity = tentity; guiElements.add(new GuiRedstoneControl(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalWasher.png"))); - guiElements.add(new GuiBucketIO(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalWasher.png"))); + guiElements.add(new GuiBucketIO(this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalWasher.png"))); guiElements.add(new GuiEnergyInfo(new IInfoHandler() { @Override public List getInfo() @@ -51,7 +51,7 @@ public class GuiChemicalWasher extends GuiMekanism String multiplier = MekanismUtils.getEnergyDisplay(tileEntity.ENERGY_USAGE); return ListUtils.asList("Using: " + multiplier + "/t", "Needed: " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxEnergy()-tileEntity.getEnergy())); } - }, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalWasher.png"))); + }, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalWasher.png"))); guiElements.add(new GuiFluidGauge(new IFluidInfoHandler() { @Override @@ -59,24 +59,24 @@ public class GuiChemicalWasher extends GuiMekanism { return tileEntity.fluidTank; } - }, Type.STANDARD, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalWasher.png"), 5, 4)); + }, Type.STANDARD, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalWasher.png"), 5, 4)); guiElements.add(new GuiGasGauge(new IGasInfoHandler() { @Override public GasTank getTank() { return tileEntity.inputTank; } - }, GuiGauge.Type.STANDARD, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalWasher.png"), 26, 13)); + }, GuiGauge.Type.STANDARD, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalWasher.png"), 26, 13)); guiElements.add(new GuiGasGauge(new IGasInfoHandler() { @Override public GasTank getTank() { return tileEntity.outputTank; } - }, GuiGauge.Type.STANDARD, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalWasher.png"), 133, 13)); + }, GuiGauge.Type.STANDARD, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalWasher.png"), 133, 13)); - guiElements.add(new GuiSlot(SlotType.NORMAL, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalWasher.png"), 154, 4).with(SlotOverlay.POWER)); - guiElements.add(new GuiSlot(SlotType.NORMAL, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalWasher.png"), 154, 55).with(SlotOverlay.MINUS)); + guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalWasher.png"), 154, 4).with(SlotOverlay.POWER)); + guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalWasher.png"), 154, 55).with(SlotOverlay.MINUS)); guiElements.add(new GuiProgress(new IProgressInfoHandler() { @@ -85,7 +85,7 @@ public class GuiChemicalWasher extends GuiMekanism { return tileEntity.isActive ? 1 : 0; } - }, ProgressBar.LARGE_RIGHT, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalWasher.png"), 62, 38)); + }, ProgressBar.LARGE_RIGHT, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalWasher.png"), 62, 38)); } @Override diff --git a/common/mekanism/client/gui/GuiConfigurationTab.java b/common/mekanism/client/gui/GuiConfigurationTab.java index 6dbee3465..143556320 100644 --- a/common/mekanism/client/gui/GuiConfigurationTab.java +++ b/common/mekanism/client/gui/GuiConfigurationTab.java @@ -15,9 +15,13 @@ import cpw.mods.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class GuiConfigurationTab extends GuiElement { - public GuiConfigurationTab(GuiMekanism gui, TileEntity tile, ResourceLocation def) + TileEntity tileEntity; + + public GuiConfigurationTab(IGuiWrapper gui, TileEntity tile, ResourceLocation def) { - super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiConfigurationTab.png"), gui, tile, def); + super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiConfigurationTab.png"), gui, def); + + tileEntity = tile; } @Override @@ -25,14 +29,14 @@ public class GuiConfigurationTab extends GuiElement { mc.renderEngine.bindTexture(RESOURCE); - guiObj.drawTexturedModalRect(guiWidth - 26, guiHeight + 6, 0, 0, 26, 26); + guiObj.drawTexturedRect(guiWidth - 26, guiHeight + 6, 0, 0, 26, 26); if(xAxis >= -21 && xAxis <= -3 && yAxis >= 10 && yAxis <= 28) { - guiObj.drawTexturedModalRect(guiWidth - 21, guiHeight + 10, 26, 0, 18, 18); + guiObj.drawTexturedRect(guiWidth - 21, guiHeight + 10, 26, 0, 18, 18); } else { - guiObj.drawTexturedModalRect(guiWidth - 21, guiHeight + 10, 26, 18, 18, 18); + guiObj.drawTexturedRect(guiWidth - 21, guiHeight + 10, 26, 18, 18, 18); } mc.renderEngine.bindTexture(defaultLocation); diff --git a/common/mekanism/client/gui/GuiDigitalMiner.java b/common/mekanism/client/gui/GuiDigitalMiner.java index af963b201..da514eac0 100644 --- a/common/mekanism/client/gui/GuiDigitalMiner.java +++ b/common/mekanism/client/gui/GuiDigitalMiner.java @@ -54,10 +54,10 @@ public class GuiDigitalMiner extends GuiMekanism String multiplier = MekanismUtils.getEnergyDisplay(MekanismUtils.getEnergyPerTick(tileEntity.getSpeedMultiplier(), tileEntity.getEnergyMultiplier(), tileEntity.ENERGY_USAGE)); return ListUtils.asList("Using: " + multiplier + "/t", "Needed: " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxEnergy()-tileEntity.getEnergy())); } - }, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiDigitalMiner.png"))); + }, this, MekanismUtils.getResource(ResourceType.GUI, "GuiDigitalMiner.png"))); - guiElements.add(new GuiSlot(SlotType.NORMAL, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiDigitalMiner.png"), 151, 5).with(SlotOverlay.POWER)); - guiElements.add(new GuiSlot(SlotType.NORMAL, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiDigitalMiner.png"), 143, 26)); + guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiDigitalMiner.png"), 151, 5).with(SlotOverlay.POWER)); + guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiDigitalMiner.png"), 143, 26)); ySize+=64; diff --git a/common/mekanism/client/gui/GuiElectricMachine.java b/common/mekanism/client/gui/GuiElectricMachine.java index 4f6a03a44..176653193 100644 --- a/common/mekanism/client/gui/GuiElectricMachine.java +++ b/common/mekanism/client/gui/GuiElectricMachine.java @@ -41,11 +41,11 @@ public class GuiElectricMachine extends GuiMekanism String multiplier = MekanismUtils.getEnergyDisplay(MekanismUtils.getEnergyPerTick(tileEntity.getSpeedMultiplier(), tileEntity.getEnergyMultiplier(), tileEntity.ENERGY_PER_TICK)); return ListUtils.asList("Using: " + multiplier + "/t", "Needed: " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxEnergy()-tileEntity.getEnergy())); } - }, this, tileEntity, tileEntity.guiLocation)); + }, this, tileEntity.guiLocation)); - guiElements.add(new GuiSlot(SlotType.INPUT, this, tileEntity, tileEntity.guiLocation, 55, 16)); - guiElements.add(new GuiSlot(SlotType.POWER, this, tileEntity, tileEntity.guiLocation, 55, 52).with(SlotOverlay.POWER)); - guiElements.add(new GuiSlot(SlotType.OUTPUT_LARGE, this, tileEntity, tileEntity.guiLocation, 111, 30)); + guiElements.add(new GuiSlot(SlotType.INPUT, this, tileEntity.guiLocation, 55, 16)); + guiElements.add(new GuiSlot(SlotType.POWER, this, tileEntity.guiLocation, 55, 52).with(SlotOverlay.POWER)); + guiElements.add(new GuiSlot(SlotType.OUTPUT_LARGE, this, tileEntity.guiLocation, 111, 30)); guiElements.add(new GuiProgress(new IProgressInfoHandler() { @@ -54,7 +54,7 @@ public class GuiElectricMachine extends GuiMekanism { return tileEntity.getScaledProgress(); } - }, tileEntity.getProgressType(), this, tileEntity, tileEntity.guiLocation, 77, 37)); + }, tileEntity.getProgressType(), this, tileEntity.guiLocation, 77, 37)); } @Override diff --git a/common/mekanism/client/gui/GuiElectricPump.java b/common/mekanism/client/gui/GuiElectricPump.java index fe24ebc33..d70a3b24c 100644 --- a/common/mekanism/client/gui/GuiElectricPump.java +++ b/common/mekanism/client/gui/GuiElectricPump.java @@ -30,9 +30,9 @@ public class GuiElectricPump extends GuiMekanism super(new ContainerElectricPump(inventory, tentity)); tileEntity = tentity; - guiElements.add(new GuiSlot(SlotType.NORMAL, this, tileEntity, guiLocation, 27, 19)); - guiElements.add(new GuiSlot(SlotType.NORMAL, this, tileEntity, guiLocation, 27, 50)); - guiElements.add(new GuiSlot(SlotType.POWER, this, tileEntity, guiLocation, 142, 34).with(SlotOverlay.POWER)); + guiElements.add(new GuiSlot(SlotType.NORMAL, this, guiLocation, 27, 19)); + guiElements.add(new GuiSlot(SlotType.NORMAL, this, guiLocation, 27, 50)); + guiElements.add(new GuiSlot(SlotType.POWER, this, guiLocation, 142, 34).with(SlotOverlay.POWER)); guiElements.add(new GuiPowerBar(this, tileEntity, guiLocation, 164, 15)); guiElements.add(new GuiFluidGauge(new IFluidInfoHandler() { @Override @@ -40,7 +40,7 @@ public class GuiElectricPump extends GuiMekanism { return tileEntity.fluidTank; } - }, GuiGauge.Type.STANDARD, this, tileEntity, guiLocation, 6, 13)); + }, GuiGauge.Type.STANDARD, this, guiLocation, 6, 13)); } diff --git a/common/mekanism/client/gui/GuiElectrolyticSeparator.java b/common/mekanism/client/gui/GuiElectrolyticSeparator.java index 93cccbe4f..1cc1b893d 100755 --- a/common/mekanism/client/gui/GuiElectrolyticSeparator.java +++ b/common/mekanism/client/gui/GuiElectrolyticSeparator.java @@ -47,34 +47,34 @@ public class GuiElectrolyticSeparator extends GuiMekanism String multiplier = MekanismUtils.getEnergyDisplay(Mekanism.FROM_H2*2); return ListUtils.asList("Using: " + multiplier + "/t", "Needed: " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxEnergy()-tileEntity.getEnergy())); } - }, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiElectrolyticSeparator.png"))); + }, this, MekanismUtils.getResource(ResourceType.GUI, "GuiElectrolyticSeparator.png"))); guiElements.add(new GuiFluidGauge(new IFluidInfoHandler() { @Override public FluidTank getTank() { return tileEntity.fluidTank; } - }, GuiGauge.Type.STANDARD, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiElectrolyticSeparator.png"), 5, 10)); + }, GuiGauge.Type.STANDARD, this, MekanismUtils.getResource(ResourceType.GUI, "GuiElectrolyticSeparator.png"), 5, 10)); guiElements.add(new GuiGasGauge(new IGasInfoHandler() { @Override public GasTank getTank() { return tileEntity.leftTank; } - }, GuiGauge.Type.SMALL, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiElectrolyticSeparator.png"), 58, 18)); + }, GuiGauge.Type.SMALL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiElectrolyticSeparator.png"), 58, 18)); guiElements.add(new GuiGasGauge(new IGasInfoHandler() { @Override public GasTank getTank() { return tileEntity.rightTank; } - }, GuiGauge.Type.SMALL, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiElectrolyticSeparator.png"), 100, 18)); + }, GuiGauge.Type.SMALL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiElectrolyticSeparator.png"), 100, 18)); guiElements.add(new GuiPowerBar(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiElectrolyticSeparator.png"), 164, 15)); - guiElements.add(new GuiSlot(SlotType.NORMAL, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiElectrolyticSeparator.png"), 25, 34)); - guiElements.add(new GuiSlot(SlotType.NORMAL, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiElectrolyticSeparator.png"), 58, 51)); - guiElements.add(new GuiSlot(SlotType.NORMAL, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiElectrolyticSeparator.png"), 100, 51)); - guiElements.add(new GuiSlot(SlotType.NORMAL, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiElectrolyticSeparator.png"), 142, 34).with(SlotOverlay.POWER)); + guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiElectrolyticSeparator.png"), 25, 34)); + guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiElectrolyticSeparator.png"), 58, 51)); + guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiElectrolyticSeparator.png"), 100, 51)); + guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiElectrolyticSeparator.png"), 142, 34).with(SlotOverlay.POWER)); guiElements.add(new GuiProgress(new IProgressInfoHandler() { @@ -83,7 +83,7 @@ public class GuiElectrolyticSeparator extends GuiMekanism { return tileEntity.isActive ? 1 : 0; } - }, ProgressBar.BI, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalDissolutionChamber.png"), 78, 29)); + }, ProgressBar.BI, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalDissolutionChamber.png"), 78, 29)); } @Override diff --git a/common/mekanism/client/gui/GuiElement.java b/common/mekanism/client/gui/GuiElement.java index 78287ff7e..83b6d6346 100644 --- a/common/mekanism/client/gui/GuiElement.java +++ b/common/mekanism/client/gui/GuiElement.java @@ -19,28 +19,25 @@ public abstract class GuiElement protected ResourceLocation RESOURCE; - public GuiMekanism guiObj; - - public TileEntity tileEntity; + public IGuiWrapper guiObj; public ResourceLocation defaultLocation; - public GuiElement(ResourceLocation resource, GuiMekanism gui, TileEntity tile, ResourceLocation def) + public GuiElement(ResourceLocation resource, IGuiWrapper gui, ResourceLocation def) { RESOURCE = resource; guiObj = gui; - tileEntity = tile; defaultLocation = def; } protected void displayTooltip(String s, int xAxis, int yAxis) { - guiObj.drawCreativeTabHoveringText(s, xAxis, yAxis); + guiObj.displayTooltip(s, xAxis, yAxis); } protected void displayTooltips(List list, int xAxis, int yAxis) { - guiObj.func_102021_a(list, xAxis, yAxis); + guiObj.displayTooltips(list, xAxis, yAxis); } protected void offsetX(int xSize) @@ -67,7 +64,7 @@ public abstract class GuiElement protected FontRenderer getFontRenderer() { - return guiObj.getFontRenderer(); + return guiObj.getFont(); } public abstract void renderBackground(int xAxis, int yAxis, int guiWidth, int guiHeight); diff --git a/common/mekanism/client/gui/GuiEnergyCube.java b/common/mekanism/client/gui/GuiEnergyCube.java index 4b7f55071..2767ae2d4 100644 --- a/common/mekanism/client/gui/GuiEnergyCube.java +++ b/common/mekanism/client/gui/GuiEnergyCube.java @@ -36,7 +36,7 @@ public class GuiEnergyCube extends GuiMekanism { return tileEntity; } - }, GuiEnergyGauge.Type.WIDE, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiEnergyCube.png"), 55, 18)); + }, GuiEnergyGauge.Type.WIDE, this, MekanismUtils.getResource(ResourceType.GUI, "GuiEnergyCube.png"), 55, 18)); guiElements.add(new GuiEnergyInfo(new IInfoHandler() { @Override @@ -46,9 +46,9 @@ public class GuiEnergyCube extends GuiMekanism "Storing: " + MekanismUtils.getEnergyDisplay(tileEntity.getEnergy()), "Max Output: " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxOutput()) + "/t"); } - }, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiEnergyCube.png"))); - guiElements.add(new GuiSlot(SlotType.NORMAL, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiEnergyCube.png"), 16, 34).with(SlotOverlay.MINUS)); - guiElements.add(new GuiSlot(SlotType.NORMAL, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiEnergyCube.png"), 142, 34).with(SlotOverlay.PLUS)); + }, this, MekanismUtils.getResource(ResourceType.GUI, "GuiEnergyCube.png"))); + guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiEnergyCube.png"), 16, 34).with(SlotOverlay.MINUS)); + guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiEnergyCube.png"), 142, 34).with(SlotOverlay.PLUS)); } @Override diff --git a/common/mekanism/client/gui/GuiEnergyGauge.java b/common/mekanism/client/gui/GuiEnergyGauge.java index b7af9864f..b7e73b69f 100644 --- a/common/mekanism/client/gui/GuiEnergyGauge.java +++ b/common/mekanism/client/gui/GuiEnergyGauge.java @@ -12,9 +12,9 @@ public class GuiEnergyGauge extends GuiGauge { IEnergyInfoHandler infoHandler; - public GuiEnergyGauge(IEnergyInfoHandler handler, Type type, GuiMekanism gui, TileEntity tile, ResourceLocation def, int x, int y) + public GuiEnergyGauge(IEnergyInfoHandler handler, Type type, IGuiWrapper gui, ResourceLocation def, int x, int y) { - super(type, gui, tile, def, x, y); + super(type, gui, def, x, y); infoHandler = handler; } diff --git a/common/mekanism/client/gui/GuiEnergyInfo.java b/common/mekanism/client/gui/GuiEnergyInfo.java index 42db2f6ee..174c99407 100644 --- a/common/mekanism/client/gui/GuiEnergyInfo.java +++ b/common/mekanism/client/gui/GuiEnergyInfo.java @@ -14,9 +14,9 @@ public class GuiEnergyInfo extends GuiElement { public IInfoHandler infoHandler; - public GuiEnergyInfo(IInfoHandler handler, GuiMekanism gui, TileEntity tile, ResourceLocation def) + public GuiEnergyInfo(IInfoHandler handler, IGuiWrapper gui, ResourceLocation def) { - super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiEnergyInfo.png"), gui, tile, def); + super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiEnergyInfo.png"), gui, def); infoHandler = handler; } @@ -31,7 +31,7 @@ public class GuiEnergyInfo extends GuiElement { mc.renderEngine.bindTexture(RESOURCE); - guiObj.drawTexturedModalRect(guiWidth - 26, guiHeight + 138, 0, 0, 26, 26); + guiObj.drawTexturedRect(guiWidth - 26, guiHeight + 138, 0, 0, 26, 26); mc.renderEngine.bindTexture(defaultLocation); } diff --git a/common/mekanism/client/gui/GuiFactory.java b/common/mekanism/client/gui/GuiFactory.java index 1805f49d4..62231a323 100644 --- a/common/mekanism/client/gui/GuiFactory.java +++ b/common/mekanism/client/gui/GuiFactory.java @@ -42,7 +42,7 @@ public class GuiFactory extends GuiMekanism String multiplier = MekanismUtils.getEnergyDisplay(MekanismUtils.getEnergyPerTick(tileEntity.getSpeedMultiplier(), tileEntity.getEnergyMultiplier(), tileEntity.ENERGY_PER_TICK)); return ListUtils.asList("Using: " + multiplier + "/t", "Needed: " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxEnergy()-tileEntity.getEnergy())); } - }, this, tileEntity, tileEntity.tier.guiLocation)); + }, this, tileEntity.tier.guiLocation)); } @Override diff --git a/common/mekanism/client/gui/GuiFluidGauge.java b/common/mekanism/client/gui/GuiFluidGauge.java index 4fc7cee84..972185507 100644 --- a/common/mekanism/client/gui/GuiFluidGauge.java +++ b/common/mekanism/client/gui/GuiFluidGauge.java @@ -11,9 +11,9 @@ public class GuiFluidGauge extends GuiGauge { IFluidInfoHandler infoHandler; - public GuiFluidGauge(IFluidInfoHandler handler, Type type, GuiMekanism gui, TileEntity tile, ResourceLocation def, int x, int y) + public GuiFluidGauge(IFluidInfoHandler handler, Type type, IGuiWrapper gui, ResourceLocation def, int x, int y) { - super(type, gui, tile, def, x, y); + super(type, gui, def, x, y); infoHandler = handler; } diff --git a/common/mekanism/client/gui/GuiGasGauge.java b/common/mekanism/client/gui/GuiGasGauge.java index 92f224baa..b4bfeb51e 100644 --- a/common/mekanism/client/gui/GuiGasGauge.java +++ b/common/mekanism/client/gui/GuiGasGauge.java @@ -11,9 +11,9 @@ public class GuiGasGauge extends GuiGauge { IGasInfoHandler infoHandler; - public GuiGasGauge(IGasInfoHandler handler, Type type, GuiMekanism gui, TileEntity tile, ResourceLocation def, int x, int y) + public GuiGasGauge(IGasInfoHandler handler, Type type, IGuiWrapper gui, ResourceLocation def, int x, int y) { - super(type, gui, tile, def, x, y); + super(type, gui, def, x, y); infoHandler = handler; } diff --git a/common/mekanism/client/gui/GuiGauge.java b/common/mekanism/client/gui/GuiGauge.java index 1fbee71c4..76189fd40 100644 --- a/common/mekanism/client/gui/GuiGauge.java +++ b/common/mekanism/client/gui/GuiGauge.java @@ -20,9 +20,9 @@ public abstract class GuiGauge extends GuiElement protected int number; - public GuiGauge(Type type, GuiMekanism gui, TileEntity tile, ResourceLocation def, int x, int y) + public GuiGauge(Type type, IGuiWrapper gui, ResourceLocation def, int x, int y) { - super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, type.textureLocation), gui, tile, def); + super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, type.textureLocation), gui, def); xLocation = x; yLocation = y; @@ -46,7 +46,7 @@ public abstract class GuiGauge extends GuiElement int scale = getScaledLevel(); int start = 0; - guiObj.drawTexturedModalRect(guiWidth + xLocation, guiHeight + yLocation, 0, 0, width, height); + guiObj.drawTexturedRect(guiWidth + xLocation, guiHeight + yLocation, 0, 0, width, height); while(scale > 0) { @@ -66,7 +66,7 @@ public abstract class GuiGauge extends GuiElement for(int i = 0; i < number; i++) { - guiObj.drawTexturedModelRectFromIcon(guiWidth + xLocation + 16*i + 1, guiHeight + yLocation + height - renderRemaining - start - 1, getIcon(), 16, renderRemaining); + guiObj.drawTexturedRectFromIcon(guiWidth + xLocation + 16*i + 1, guiHeight + yLocation + height - renderRemaining - start - 1, getIcon(), 16, renderRemaining); } start+=16; @@ -78,7 +78,7 @@ public abstract class GuiGauge extends GuiElement } mc.renderEngine.bindTexture(RESOURCE); - guiObj.drawTexturedModalRect(guiWidth + xLocation, guiHeight + yLocation, width, 0, width, height); + guiObj.drawTexturedRect(guiWidth + xLocation, guiHeight + yLocation, width, 0, width, height); mc.renderEngine.bindTexture(defaultLocation); } @@ -88,7 +88,7 @@ public abstract class GuiGauge extends GuiElement { if(xAxis >= xLocation + 1 && xAxis <= xLocation + width - 1 && yAxis >= yLocation + 1 && yAxis <= yLocation + height - 1) { - guiObj.drawCreativeTabHoveringText(getTooltipText(), xAxis, yAxis); + guiObj.displayTooltip(getTooltipText(), xAxis, yAxis); } } diff --git a/common/mekanism/client/gui/GuiMekanism.java b/common/mekanism/client/gui/GuiMekanism.java index 523921ef5..b4d8770db 100644 --- a/common/mekanism/client/gui/GuiMekanism.java +++ b/common/mekanism/client/gui/GuiMekanism.java @@ -15,10 +15,11 @@ import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.inventory.Container; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; +import net.minecraft.util.Icon; import org.lwjgl.opengl.GL11; -public abstract class GuiMekanism extends GuiContainer +public abstract class GuiMekanism extends GuiContainer implements IGuiWrapper { public Set guiElements = new HashSet(); @@ -151,6 +152,36 @@ public abstract class GuiMekanism extends GuiContainer GL11.glPopAttrib(); } + @Override + public void drawTexturedRect(int x, int y, int u, int v, int w, int h) + { + drawTexturedModalRect(x, y, u, v, w, h); + } + + @Override + public void drawTexturedRectFromIcon(int x, int y, Icon icon, int w, int h) + { + drawTexturedModelRectFromIcon(x, y, icon, w, h); + } + + @Override + public void displayTooltip(String s, int x, int y) + { + drawCreativeTabHoveringText(s, x, y); + } + + @Override + public void displayTooltips(List list, int xAxis, int yAxis) + { + func_102021_a(list, xAxis, yAxis); + } + + @Override + public FontRenderer getFont() + { + return fontRenderer; + } + protected FontRenderer getFontRenderer() { return fontRenderer; diff --git a/common/mekanism/client/gui/GuiMetallurgicInfuser.java b/common/mekanism/client/gui/GuiMetallurgicInfuser.java index 23bb667df..17b80ebbf 100644 --- a/common/mekanism/client/gui/GuiMetallurgicInfuser.java +++ b/common/mekanism/client/gui/GuiMetallurgicInfuser.java @@ -45,12 +45,12 @@ public class GuiMetallurgicInfuser extends GuiMekanism String multiplier = MekanismUtils.getEnergyDisplay(MekanismUtils.getEnergyPerTick(tileEntity.getSpeedMultiplier(), tileEntity.getEnergyMultiplier(), tileEntity.ENERGY_PER_TICK)); return ListUtils.asList("Using: " + multiplier + "/t", "Needed: " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxEnergy()-tileEntity.getEnergy())); } - }, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiMetallurgicInfuser.png"))); + }, this, MekanismUtils.getResource(ResourceType.GUI, "GuiMetallurgicInfuser.png"))); - guiElements.add(new GuiSlot(SlotType.EXTRA, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiMetallurgicInfuser.png"), 16, 34)); - guiElements.add(new GuiSlot(SlotType.INPUT, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiMetallurgicInfuser.png"), 50, 42)); - guiElements.add(new GuiSlot(SlotType.POWER, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiMetallurgicInfuser.png"), 142, 34).with(SlotOverlay.POWER)); - guiElements.add(new GuiSlot(SlotType.OUTPUT, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiMetallurgicInfuser.png"), 108, 42)); + guiElements.add(new GuiSlot(SlotType.EXTRA, this, MekanismUtils.getResource(ResourceType.GUI, "GuiMetallurgicInfuser.png"), 16, 34)); + guiElements.add(new GuiSlot(SlotType.INPUT, this, MekanismUtils.getResource(ResourceType.GUI, "GuiMetallurgicInfuser.png"), 50, 42)); + guiElements.add(new GuiSlot(SlotType.POWER, this, MekanismUtils.getResource(ResourceType.GUI, "GuiMetallurgicInfuser.png"), 142, 34).with(SlotOverlay.POWER)); + guiElements.add(new GuiSlot(SlotType.OUTPUT, this, MekanismUtils.getResource(ResourceType.GUI, "GuiMetallurgicInfuser.png"), 108, 42)); guiElements.add(new GuiProgress(new IProgressInfoHandler() { @@ -59,7 +59,7 @@ public class GuiMetallurgicInfuser extends GuiMekanism { return tileEntity.getScaledProgress(); } - }, ProgressBar.MEDIUM, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiMetallurgicInfuser.png"), 70, 46)); + }, ProgressBar.MEDIUM, this, MekanismUtils.getResource(ResourceType.GUI, "GuiMetallurgicInfuser.png"), 70, 46)); } @Override diff --git a/common/mekanism/client/gui/GuiPRC.java b/common/mekanism/client/gui/GuiPRC.java index 5248bea2c..c98d8dfc3 100644 --- a/common/mekanism/client/gui/GuiPRC.java +++ b/common/mekanism/client/gui/GuiPRC.java @@ -32,26 +32,26 @@ public class GuiPRC extends GuiMekanism { return tileEntity.inputFluidTank; } - }, GuiGauge.Type.STANDARD, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiPRC.png"), 5, 10)); + }, GuiGauge.Type.STANDARD, this, MekanismUtils.getResource(ResourceType.GUI, "GuiPRC.png"), 5, 10)); guiElements.add(new GuiGasGauge(new IGasInfoHandler() { @Override public GasTank getTank() { return tileEntity.inputGasTank; } - }, GuiGauge.Type.STANDARD, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiPRC.png"), 28, 10)); + }, GuiGauge.Type.STANDARD, this, MekanismUtils.getResource(ResourceType.GUI, "GuiPRC.png"), 28, 10)); guiElements.add(new GuiGasGauge(new IGasInfoHandler() { @Override public GasTank getTank() { return tileEntity.outputGasTank; } - }, GuiGauge.Type.SMALL, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiPRC.png"), 140, 40)); + }, GuiGauge.Type.SMALL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiPRC.png"), 140, 40)); guiElements.add(new GuiPowerBar(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiPRC.png"), 164, 15)); - guiElements.add(new GuiSlot(SlotType.INPUT, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiPRC.png"), 53, 34)); - guiElements.add(new GuiSlot(SlotType.POWER, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiPRC.png"), 140, 18).with(SlotOverlay.POWER)); - guiElements.add(new GuiSlot(SlotType.OUTPUT, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiPRC.png"), 115, 34)); + guiElements.add(new GuiSlot(SlotType.INPUT, this, MekanismUtils.getResource(ResourceType.GUI, "GuiPRC.png"), 53, 34)); + guiElements.add(new GuiSlot(SlotType.POWER, this, MekanismUtils.getResource(ResourceType.GUI, "GuiPRC.png"), 140, 18).with(SlotOverlay.POWER)); + guiElements.add(new GuiSlot(SlotType.OUTPUT, this, MekanismUtils.getResource(ResourceType.GUI, "GuiPRC.png"), 115, 34)); guiElements.add(new GuiProgress(new IProgressInfoHandler() { @@ -60,7 +60,7 @@ public class GuiPRC extends GuiMekanism { return tileEntity.getScaledProgress(); } - }, ProgressBar.MEDIUM, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiPRC.png"), 75, 37)); + }, ProgressBar.MEDIUM, this, MekanismUtils.getResource(ResourceType.GUI, "GuiPRC.png"), 75, 37)); } @Override diff --git a/common/mekanism/client/gui/GuiPowerBar.java b/common/mekanism/client/gui/GuiPowerBar.java index 53363d1a4..0e8fce8cb 100644 --- a/common/mekanism/client/gui/GuiPowerBar.java +++ b/common/mekanism/client/gui/GuiPowerBar.java @@ -19,9 +19,9 @@ public class GuiPowerBar extends GuiElement private TileEntityElectricBlock tileEntityElectric; - public GuiPowerBar(GuiMekanism gui, TileEntityElectricBlock tile, ResourceLocation def, int x, int y) + public GuiPowerBar(IGuiWrapper gui, TileEntityElectricBlock tile, ResourceLocation def, int x, int y) { - super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiPowerBar.png"), gui, tile, def); + super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiPowerBar.png"), gui, def); tileEntityElectric = tile; xLocation = x; yLocation = y; @@ -32,9 +32,9 @@ public class GuiPowerBar extends GuiElement { mc.renderEngine.bindTexture(RESOURCE); - guiObj.drawTexturedModalRect(guiWidth + xLocation, guiHeight + yLocation, 0, 0, width, height); + guiObj.drawTexturedRect(guiWidth + xLocation, guiHeight + yLocation, 0, 0, width, height); int displayInt = tileEntityElectric.getScaledEnergyLevel(52) + innerOffsetY; - guiObj.drawTexturedModalRect(guiWidth + xLocation, guiHeight + yLocation + height - displayInt, 6, height - displayInt, width, displayInt); + guiObj.drawTexturedRect(guiWidth + xLocation, guiHeight + yLocation + height - displayInt, 6, height - displayInt, width, displayInt); mc.renderEngine.bindTexture(defaultLocation); } diff --git a/common/mekanism/client/gui/GuiProgress.java b/common/mekanism/client/gui/GuiProgress.java index 394a1d6e5..c26e73bab 100644 --- a/common/mekanism/client/gui/GuiProgress.java +++ b/common/mekanism/client/gui/GuiProgress.java @@ -20,10 +20,9 @@ public class GuiProgress extends GuiElement private ProgressBar type; private IProgressInfoHandler handler; - public GuiProgress(IProgressInfoHandler handler, ProgressBar type, GuiMekanism gui, TileEntity tile, ResourceLocation def, int x, int y) + public GuiProgress(IProgressInfoHandler handler, ProgressBar type, IGuiWrapper gui, ResourceLocation def, int x, int y) { - super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiProgress.png"), gui, tile, def); - tileEntity = tile; + super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiProgress.png"), gui, def); xLocation = x; yLocation = y; @@ -37,9 +36,9 @@ public class GuiProgress extends GuiElement mc.renderEngine.bindTexture(RESOURCE); if(handler.isActive()) { - guiObj.drawTexturedModalRect(guiWidth + xLocation, guiHeight + yLocation, type.textureX, type.textureY, type.width, type.height); + guiObj.drawTexturedRect(guiWidth + xLocation, guiHeight + yLocation, type.textureX, type.textureY, type.width, type.height); int displayInt = (int)(handler.getProgress() * (type.width-2*innerOffsetX)); - guiObj.drawTexturedModalRect(guiWidth + xLocation + innerOffsetX, guiHeight + yLocation, type.textureX + type.width + innerOffsetX, type.textureY, displayInt, type.height); + guiObj.drawTexturedRect(guiWidth + xLocation + innerOffsetX, guiHeight + yLocation, type.textureX + type.width + innerOffsetX, type.textureY, displayInt, type.height); } mc.renderEngine.bindTexture(defaultLocation); } diff --git a/common/mekanism/client/gui/GuiRecipeType.java b/common/mekanism/client/gui/GuiRecipeType.java index 5894e7624..9092bc418 100644 --- a/common/mekanism/client/gui/GuiRecipeType.java +++ b/common/mekanism/client/gui/GuiRecipeType.java @@ -9,9 +9,13 @@ import net.minecraft.util.ResourceLocation; public class GuiRecipeType extends GuiElement { - public GuiRecipeType(GuiMekanism gui, TileEntity tile, ResourceLocation def) + TileEntityFactory tileEntity; + + public GuiRecipeType(IGuiWrapper gui, TileEntityFactory tile, ResourceLocation def) { - super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiRecipeType.png"), gui, tile, def); + super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiRecipeType.png"), gui, def); + + tileEntity = tile; } @Override @@ -19,12 +23,12 @@ public class GuiRecipeType extends GuiElement { mc.renderEngine.bindTexture(RESOURCE); - guiObj.drawTexturedModalRect(guiWidth + 176, guiHeight + 70, 0, 0, 26, 63); + guiObj.drawTexturedRect(guiWidth + 176, guiHeight + 70, 0, 0, 26, 63); - TileEntityFactory factory = (TileEntityFactory)tileEntity; + TileEntityFactory factory = tileEntity; int displayInt = factory.getScaledRecipeProgress(15); - guiObj.drawTexturedModalRect(guiWidth + 181, guiHeight + 94, 26, 0, 10, displayInt); + guiObj.drawTexturedRect(guiWidth + 181, guiHeight + 94, 26, 0, 10, displayInt); mc.renderEngine.bindTexture(defaultLocation); } diff --git a/common/mekanism/client/gui/GuiRedstoneControl.java b/common/mekanism/client/gui/GuiRedstoneControl.java index cab89d5ff..a84438fc0 100644 --- a/common/mekanism/client/gui/GuiRedstoneControl.java +++ b/common/mekanism/client/gui/GuiRedstoneControl.java @@ -14,9 +14,13 @@ import net.minecraft.util.ResourceLocation; public class GuiRedstoneControl extends GuiElement { - public GuiRedstoneControl(GuiMekanism gui, TileEntity tile, ResourceLocation def) + TileEntity tileEntity; + + public GuiRedstoneControl(IGuiWrapper gui, TileEntity tile, ResourceLocation def) { - super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiRedstoneControl.png"), gui, tile, def); + super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiRedstoneControl.png"), gui, def); + + tileEntity = tile; } @Override @@ -24,17 +28,17 @@ public class GuiRedstoneControl extends GuiElement { mc.renderEngine.bindTexture(RESOURCE); - guiObj.drawTexturedModalRect(guiWidth + 176, guiHeight + 138, 0, 0, 26, 26); + guiObj.drawTexturedRect(guiWidth + 176, guiHeight + 138, 0, 0, 26, 26); IRedstoneControl control = (IRedstoneControl)tileEntity; int renderX = 26 + (18*control.getControlType().ordinal()); if(xAxis >= 179 && xAxis <= 197 && yAxis >= 142 && yAxis <= 160) { - guiObj.drawTexturedModalRect(guiWidth + 179, guiHeight + 142, renderX, 0, 18, 18); + guiObj.drawTexturedRect(guiWidth + 179, guiHeight + 142, renderX, 0, 18, 18); } else { - guiObj.drawTexturedModalRect(guiWidth + 179, guiHeight + 142, renderX, 18, 18, 18); + guiObj.drawTexturedRect(guiWidth + 179, guiHeight + 142, renderX, 18, 18, 18); } mc.renderEngine.bindTexture(defaultLocation); diff --git a/common/mekanism/client/gui/GuiRotaryCondensentrator.java b/common/mekanism/client/gui/GuiRotaryCondensentrator.java index 065ed5ac6..64b6dd691 100644 --- a/common/mekanism/client/gui/GuiRotaryCondensentrator.java +++ b/common/mekanism/client/gui/GuiRotaryCondensentrator.java @@ -39,13 +39,13 @@ public class GuiRotaryCondensentrator extends GuiMekanism tileEntity = tentity; guiElements.add(new GuiRedstoneControl(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiRotaryCondensentrator.png"))); - guiElements.add(new GuiSlot(SlotType.NORMAL, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiRotaryCondensentrator.png"), 4, 24).with(SlotOverlay.PLUS)); - guiElements.add(new GuiSlot(SlotType.NORMAL, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiRotaryCondensentrator.png"), 4, 55).with(SlotOverlay.MINUS)); + guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiRotaryCondensentrator.png"), 4, 24).with(SlotOverlay.PLUS)); + guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiRotaryCondensentrator.png"), 4, 55).with(SlotOverlay.MINUS)); - guiElements.add(new GuiSlot(SlotType.NORMAL, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiRotaryCondensentrator.png"), 154, 24)); - guiElements.add(new GuiSlot(SlotType.NORMAL, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiRotaryCondensentrator.png"), 154, 55)); + guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiRotaryCondensentrator.png"), 154, 24)); + guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiRotaryCondensentrator.png"), 154, 55)); - guiElements.add(new GuiSlot(SlotType.NORMAL, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiRotaryCondensentrator.png"), 154, 4).with(SlotOverlay.POWER)); + guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiRotaryCondensentrator.png"), 154, 4).with(SlotOverlay.POWER)); guiElements.add(new GuiFluidGauge(new IFluidInfoHandler() { @Override @@ -53,14 +53,14 @@ public class GuiRotaryCondensentrator extends GuiMekanism { return tileEntity.fluidTank; } - }, GuiGauge.Type.STANDARD, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiRotaryCondensentrator.png"), 133, 13)); + }, GuiGauge.Type.STANDARD, this, MekanismUtils.getResource(ResourceType.GUI, "GuiRotaryCondensentrator.png"), 133, 13)); guiElements.add(new GuiGasGauge(new IGasInfoHandler() { @Override public GasTank getTank() { return tileEntity.gasTank; } - }, GuiGauge.Type.STANDARD, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiRotaryCondensentrator.png"), 25, 13)); + }, GuiGauge.Type.STANDARD, this, MekanismUtils.getResource(ResourceType.GUI, "GuiRotaryCondensentrator.png"), 25, 13)); guiElements.add(new GuiProgress(new IProgressInfoHandler() { @@ -75,7 +75,7 @@ public class GuiRotaryCondensentrator extends GuiMekanism { return tileEntity.mode == 0; } - }, ProgressBar.LARGE_RIGHT, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiRotaryCondensentrator.png"), 62, 38)); + }, ProgressBar.LARGE_RIGHT, this, MekanismUtils.getResource(ResourceType.GUI, "GuiRotaryCondensentrator.png"), 62, 38)); guiElements.add(new GuiProgress(new IProgressInfoHandler() { @Override @@ -89,7 +89,7 @@ public class GuiRotaryCondensentrator extends GuiMekanism { return tileEntity.mode == 1; } - }, ProgressBar.LARGE_LEFT, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiRotaryCondensentrator.png"), 62, 38)); + }, ProgressBar.LARGE_LEFT, this, MekanismUtils.getResource(ResourceType.GUI, "GuiRotaryCondensentrator.png"), 62, 38)); } diff --git a/common/mekanism/client/gui/GuiSeismicVibrator.java b/common/mekanism/client/gui/GuiSeismicVibrator.java index 083658bc1..a433fe18a 100644 --- a/common/mekanism/client/gui/GuiSeismicVibrator.java +++ b/common/mekanism/client/gui/GuiSeismicVibrator.java @@ -26,7 +26,7 @@ public class GuiSeismicVibrator extends GuiMekanism guiElements.add(new GuiRedstoneControl(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiSeismicVibrator.png"))); guiElements.add(new GuiPowerBar(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiSeismicVibrator.png"), 164, 15)); - guiElements.add(new GuiSlot(SlotType.NORMAL, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiSeismicVibrator.png"), 142, 34).with(SlotOverlay.POWER)); + guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiSeismicVibrator.png"), 142, 34).with(SlotOverlay.POWER)); } @Override diff --git a/common/mekanism/client/gui/GuiSlot.java b/common/mekanism/client/gui/GuiSlot.java index 8e3a82b66..21beeca66 100644 --- a/common/mekanism/client/gui/GuiSlot.java +++ b/common/mekanism/client/gui/GuiSlot.java @@ -19,9 +19,9 @@ public class GuiSlot extends GuiElement protected SlotOverlay overlay = null; - public GuiSlot(SlotType type, GuiMekanism gui, TileEntity tile, ResourceLocation def, int x, int y) + public GuiSlot(SlotType type, IGuiWrapper gui, ResourceLocation def, int x, int y) { - super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiSlot.png"), gui, tile, def); + super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiSlot.png"), gui, def); xLocation = x; yLocation = y; @@ -44,7 +44,7 @@ public class GuiSlot extends GuiElement { mc.renderEngine.bindTexture(RESOURCE); - guiObj.drawTexturedModalRect(guiWidth + xLocation, guiHeight + yLocation, textureX, textureY, width, height); + guiObj.drawTexturedRect(guiWidth + xLocation, guiHeight + yLocation, textureX, textureY, width, height); if(overlay != null) { @@ -53,7 +53,7 @@ public class GuiSlot extends GuiElement int xLocationOverlay = xLocation + (width-w)/2; int yLocationOverlay = yLocation + (height-h)/2; - guiObj.drawTexturedModalRect(guiWidth + xLocationOverlay, guiHeight + yLocationOverlay, overlay.textureX, overlay.textureY, w, h); + guiObj.drawTexturedRect(guiWidth + xLocationOverlay, guiHeight + yLocationOverlay, overlay.textureX, overlay.textureY, w, h); } mc.renderEngine.bindTexture(defaultLocation); diff --git a/common/mekanism/client/gui/GuiSortingTab.java b/common/mekanism/client/gui/GuiSortingTab.java index b28944eb7..8b0010fe6 100644 --- a/common/mekanism/client/gui/GuiSortingTab.java +++ b/common/mekanism/client/gui/GuiSortingTab.java @@ -17,9 +17,13 @@ import cpw.mods.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class GuiSortingTab extends GuiElement { - public GuiSortingTab(GuiMekanism gui, TileEntity tile, ResourceLocation def) + TileEntityFactory tileEntity; + + public GuiSortingTab(IGuiWrapper gui, TileEntityFactory tile, ResourceLocation def) { - super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiSortingTab.png"), gui, tile, def); + super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiSortingTab.png"), gui, def); + + tileEntity = tile; } @Override @@ -27,14 +31,14 @@ public class GuiSortingTab extends GuiElement { mc.renderEngine.bindTexture(RESOURCE); - guiObj.drawTexturedModalRect(guiWidth - 26, guiHeight + 34, 0, 0, 26, 35); + guiObj.drawTexturedRect(guiWidth - 26, guiHeight + 34, 0, 0, 26, 35); if(xAxis >= -21 && xAxis <= -3 && yAxis >= 38 && yAxis <= 56) { - guiObj.drawTexturedModalRect(guiWidth - 21, guiHeight + 38, 26, 0, 18, 18); + guiObj.drawTexturedRect(guiWidth - 21, guiHeight + 38, 26, 0, 18, 18); } else { - guiObj.drawTexturedModalRect(guiWidth - 21, guiHeight + 38, 26, 18, 18, 18); + guiObj.drawTexturedRect(guiWidth - 21, guiHeight + 38, 26, 18, 18, 18); } mc.renderEngine.bindTexture(defaultLocation); diff --git a/common/mekanism/client/gui/GuiTeleporter.java b/common/mekanism/client/gui/GuiTeleporter.java index 709de78b6..2662e73e9 100644 --- a/common/mekanism/client/gui/GuiTeleporter.java +++ b/common/mekanism/client/gui/GuiTeleporter.java @@ -30,7 +30,7 @@ public class GuiTeleporter extends GuiMekanism tileEntity = tentity; guiElements.add(new GuiPowerBar(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiTeleporter.png"), 164, 15)); - guiElements.add(new GuiSlot(SlotType.NORMAL, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiTeleporter.png"), 26, 13).with(SlotOverlay.POWER)); + guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiTeleporter.png"), 26, 13).with(SlotOverlay.POWER)); } @Override diff --git a/common/mekanism/client/gui/GuiUpgradeManagement.java b/common/mekanism/client/gui/GuiUpgradeManagement.java index d42179685..ea882b54c 100644 --- a/common/mekanism/client/gui/GuiUpgradeManagement.java +++ b/common/mekanism/client/gui/GuiUpgradeManagement.java @@ -13,9 +13,13 @@ import net.minecraft.util.ResourceLocation; public class GuiUpgradeManagement extends GuiElement { - public GuiUpgradeManagement(GuiMekanism gui, TileEntity tile, ResourceLocation def) + TileEntity tileEntity; + + public GuiUpgradeManagement(IGuiWrapper gui, TileEntity tile, ResourceLocation def) { - super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiUpgradeManagement.png"), gui, tile, def); + super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiUpgradeManagement.png"), gui, def); + + tileEntity = tile; } @Override @@ -23,12 +27,12 @@ public class GuiUpgradeManagement extends GuiElement { mc.renderEngine.bindTexture(RESOURCE); - guiObj.drawTexturedModalRect(guiWidth + 176, guiHeight + 6, 0, 0, 26, 63); + guiObj.drawTexturedRect(guiWidth + 176, guiHeight + 6, 0, 0, 26, 63); IUpgradeTile upgradeTile = (IUpgradeTile)tileEntity; int displayInt = upgradeTile.getComponent().getScaledUpgradeProgress(14); - guiObj.drawTexturedModalRect(guiWidth + 180, guiHeight + 30, 26, 0, 10, displayInt); + guiObj.drawTexturedRect(guiWidth + 180, guiHeight + 30, 26, 0, 10, displayInt); mc.renderEngine.bindTexture(defaultLocation); } diff --git a/common/mekanism/client/gui/IGuiWrapper.java b/common/mekanism/client/gui/IGuiWrapper.java new file mode 100644 index 000000000..19b1ff67c --- /dev/null +++ b/common/mekanism/client/gui/IGuiWrapper.java @@ -0,0 +1,19 @@ +package mekanism.client.gui; + +import java.util.List; + +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.util.Icon; + +public interface IGuiWrapper +{ + public void drawTexturedRect(int x, int y, int u, int v, int w, int h); + + public void drawTexturedRectFromIcon(int x, int y, Icon icon, int w, int h); + + public void displayTooltip(String s, int xAxis, int yAxis); + + public void displayTooltips(List list, int xAxis, int yAxis); + + public FontRenderer getFont(); +} diff --git a/common/mekanism/client/nei/AdvancedMachineRecipeHandler.java b/common/mekanism/client/nei/AdvancedMachineRecipeHandler.java index a610f640b..2ae08c079 100644 --- a/common/mekanism/client/nei/AdvancedMachineRecipeHandler.java +++ b/common/mekanism/client/nei/AdvancedMachineRecipeHandler.java @@ -221,6 +221,12 @@ public abstract class AdvancedMachineRecipeHandler extends BaseRecipeHandler return super.mouseClicked(gui, button, recipe); } + @Override + public void addGuiElements() + { + + } + public class CachedIORecipe extends TemplateRecipeHandler.CachedRecipe { public List fuelStacks; diff --git a/common/mekanism/client/nei/BaseRecipeHandler.java b/common/mekanism/client/nei/BaseRecipeHandler.java index 0fe6c06d3..e4c75d041 100644 --- a/common/mekanism/client/nei/BaseRecipeHandler.java +++ b/common/mekanism/client/nei/BaseRecipeHandler.java @@ -1,17 +1,35 @@ package mekanism.client.nei; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + import static codechicken.core.gui.GuiDraw.changeTexture; import static codechicken.core.gui.GuiDraw.drawTexturedModalRect; import static codechicken.core.gui.GuiDraw.gui; import mekanism.api.gas.GasStack; +import mekanism.client.gui.GuiElement; +import mekanism.client.gui.IGuiWrapper; import mekanism.client.render.MekanismRenderer; + +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.util.Icon; import net.minecraftforge.fluids.FluidStack; import codechicken.nei.recipe.GuiCraftingRecipe; import codechicken.nei.recipe.GuiUsageRecipe; import codechicken.nei.recipe.TemplateRecipeHandler; -public abstract class BaseRecipeHandler extends TemplateRecipeHandler +public abstract class BaseRecipeHandler extends TemplateRecipeHandler implements IGuiWrapper { + public BaseRecipeHandler() + { + addGuiElements(); + } + + public Set guiElements = new HashSet(); + + public abstract void addGuiElements(); + public void displayGauge(int length, int xPos, int yPos, int overlayX, int overlayY, int scale, FluidStack fluid, GasStack gas) { if(fluid == null && gas == null) @@ -122,4 +140,21 @@ public abstract class BaseRecipeHandler extends TemplateRecipeHandler return false; } + + public void drawTexturedRect(int x, int y, int u, int v, int w, int h) + { + drawTexturedModalRect(x, y, u, v, w, h); + } + + public void drawTexturedRectFromIcon(int x, int y, Icon icon, int w, int h) + { + gui.drawTexturedModelRectFromIcon(x, y, icon, w, h); + } + + public void displayTooltip(String s, int xAxis, int yAxis) {} + + public void displayTooltips(List list, int xAxis, int yAxis) {} + + public FontRenderer getFont() { return null; } + } diff --git a/common/mekanism/client/nei/ChemicalCrystallizerRecipeHandler.java b/common/mekanism/client/nei/ChemicalCrystallizerRecipeHandler.java index 9cebfb086..a8ef1108c 100644 --- a/common/mekanism/client/nei/ChemicalCrystallizerRecipeHandler.java +++ b/common/mekanism/client/nei/ChemicalCrystallizerRecipeHandler.java @@ -243,6 +243,12 @@ public class ChemicalCrystallizerRecipeHandler extends BaseRecipeHandler } } + @Override + public void addGuiElements() + { + + } + public class CachedIORecipe extends TemplateRecipeHandler.CachedRecipe { public GasStack inputStack; diff --git a/common/mekanism/client/nei/ChemicalDissolutionChamberRecipeHandler.java b/common/mekanism/client/nei/ChemicalDissolutionChamberRecipeHandler.java index c240b974a..4b5544644 100644 --- a/common/mekanism/client/nei/ChemicalDissolutionChamberRecipeHandler.java +++ b/common/mekanism/client/nei/ChemicalDissolutionChamberRecipeHandler.java @@ -252,6 +252,12 @@ public class ChemicalDissolutionChamberRecipeHandler extends BaseRecipeHandler } } + @Override + public void addGuiElements() + { + + } + public class CachedIORecipe extends TemplateRecipeHandler.CachedRecipe { public PositionedStack inputStack; diff --git a/common/mekanism/client/nei/ChemicalInfuserRecipeHandler.java b/common/mekanism/client/nei/ChemicalInfuserRecipeHandler.java index 93dea2ed8..81ea0252b 100644 --- a/common/mekanism/client/nei/ChemicalInfuserRecipeHandler.java +++ b/common/mekanism/client/nei/ChemicalInfuserRecipeHandler.java @@ -276,6 +276,12 @@ public class ChemicalInfuserRecipeHandler extends BaseRecipeHandler return 1; } + @Override + public void addGuiElements() + { + + } + public class CachedIORecipe extends TemplateRecipeHandler.CachedRecipe { public ChemicalPair chemicalInput; diff --git a/common/mekanism/client/nei/ChemicalOxidizerRecipeHandler.java b/common/mekanism/client/nei/ChemicalOxidizerRecipeHandler.java index 9bb6181ff..c3a071f80 100644 --- a/common/mekanism/client/nei/ChemicalOxidizerRecipeHandler.java +++ b/common/mekanism/client/nei/ChemicalOxidizerRecipeHandler.java @@ -225,6 +225,12 @@ public class ChemicalOxidizerRecipeHandler extends BaseRecipeHandler } } + @Override + public void addGuiElements() + { + + } + public class CachedIORecipe extends TemplateRecipeHandler.CachedRecipe { public PositionedStack inputStack; diff --git a/common/mekanism/client/nei/ChemicalWasherRecipeHandler.java b/common/mekanism/client/nei/ChemicalWasherRecipeHandler.java index db860e10f..765a531f1 100644 --- a/common/mekanism/client/nei/ChemicalWasherRecipeHandler.java +++ b/common/mekanism/client/nei/ChemicalWasherRecipeHandler.java @@ -318,6 +318,12 @@ public class ChemicalWasherRecipeHandler extends BaseRecipeHandler return 1; } + @Override + public void addGuiElements() + { + + } + public class CachedIORecipe extends TemplateRecipeHandler.CachedRecipe { public GasStack inputStack; diff --git a/common/mekanism/client/nei/CrusherRecipeHandler.java b/common/mekanism/client/nei/CrusherRecipeHandler.java index e344088a9..cbb20f30b 100644 --- a/common/mekanism/client/nei/CrusherRecipeHandler.java +++ b/common/mekanism/client/nei/CrusherRecipeHandler.java @@ -3,8 +3,11 @@ package mekanism.client.nei; import java.util.Set; import mekanism.client.gui.GuiCrusher; +import mekanism.client.gui.GuiSlot; +import mekanism.client.gui.GuiSlot.SlotType; import mekanism.common.recipe.RecipeHandler.Recipe; import mekanism.common.util.MekanismUtils; +import mekanism.common.util.MekanismUtils.ResourceType; public class CrusherRecipeHandler extends MachineRecipeHandler { @@ -32,12 +35,6 @@ public class CrusherRecipeHandler extends MachineRecipeHandler return Recipe.CRUSHER.get().entrySet(); } - @Override - public String getGuiTexture() - { - return "mekanism:gui/GuiCrusher.png"; - } - @Override public Class getGuiClass() { diff --git a/common/mekanism/client/nei/ElectrolyticSeparatorRecipeHandler.java b/common/mekanism/client/nei/ElectrolyticSeparatorRecipeHandler.java index 895f0866a..6ca8bd170 100644 --- a/common/mekanism/client/nei/ElectrolyticSeparatorRecipeHandler.java +++ b/common/mekanism/client/nei/ElectrolyticSeparatorRecipeHandler.java @@ -311,6 +311,12 @@ public class ElectrolyticSeparatorRecipeHandler extends BaseRecipeHandler return 1; } + @Override + public void addGuiElements() + { + + } + public class CachedIORecipe extends TemplateRecipeHandler.CachedRecipe { public FluidStack fluidInput; diff --git a/common/mekanism/client/nei/EnrichmentChamberRecipeHandler.java b/common/mekanism/client/nei/EnrichmentChamberRecipeHandler.java index d90d5edf0..da23745a4 100644 --- a/common/mekanism/client/nei/EnrichmentChamberRecipeHandler.java +++ b/common/mekanism/client/nei/EnrichmentChamberRecipeHandler.java @@ -32,12 +32,6 @@ public class EnrichmentChamberRecipeHandler extends MachineRecipeHandler return Recipe.ENRICHMENT_CHAMBER.get().entrySet(); } - @Override - public String getGuiTexture() - { - return "mekanism:gui/GuiChamber.png"; - } - @Override public Class getGuiClass() { diff --git a/common/mekanism/client/nei/MachineRecipeHandler.java b/common/mekanism/client/nei/MachineRecipeHandler.java index 9a851f80c..3edd5436a 100644 --- a/common/mekanism/client/nei/MachineRecipeHandler.java +++ b/common/mekanism/client/nei/MachineRecipeHandler.java @@ -2,12 +2,23 @@ package mekanism.client.nei; import static codechicken.core.gui.GuiDraw.changeTexture; import static codechicken.core.gui.GuiDraw.drawTexturedModalRect; +import static codechicken.core.gui.GuiDraw.gui; import java.awt.Rectangle; import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import mekanism.client.gui.GuiElement; +import mekanism.client.gui.GuiProgress; +import mekanism.client.gui.GuiProgress.IProgressInfoHandler; +import mekanism.client.gui.GuiProgress.ProgressBar; +import mekanism.client.gui.GuiSlot; +import mekanism.client.gui.GuiSlot.SlotOverlay; +import mekanism.client.gui.GuiSlot.SlotType; +import mekanism.common.util.MekanismUtils; +import mekanism.common.util.MekanismUtils.ResourceType; + import net.minecraft.item.ItemStack; import org.lwjgl.opengl.GL11; @@ -24,12 +35,33 @@ public abstract class MachineRecipeHandler extends BaseRecipeHandler public abstract Set> getRecipes(); + @Override + public void addGuiElements() + { + guiElements.add(new GuiSlot(SlotType.INPUT, this, MekanismUtils.getResource(ResourceType.GUI, getGuiTexture()), 55, 16)); + guiElements.add(new GuiSlot(SlotType.POWER, this, MekanismUtils.getResource(ResourceType.GUI, getGuiTexture()), 55, 52).with(SlotOverlay.POWER)); + guiElements.add(new GuiSlot(SlotType.OUTPUT_LARGE, this, MekanismUtils.getResource(ResourceType.GUI, getGuiTexture()), 111, 30)); + + guiElements.add(new GuiProgress(new IProgressInfoHandler() + { + @Override + public double getProgress() + { + return ticksPassed >= 20 ? (ticksPassed - 20) % 20 / 20.0F : 0.0F; + } + }, ProgressBar.BLUE, this, MekanismUtils.getResource(ResourceType.GUI, getGuiTexture()), 77, 37)); + } + @Override public void drawBackground(int i) { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); changeTexture(getGuiTexture()); drawTexturedModalRect(12, 0, 28, 5, 144, 68); + for(GuiElement e : guiElements) + { + e.renderBackground(0, 0, -16, -5); + } } @Override @@ -81,6 +113,12 @@ public abstract class MachineRecipeHandler extends BaseRecipeHandler } } + @Override + public String getGuiTexture() + { + return "mekanism:gui/GuiBasicMachine.png"; + } + @Override public void loadUsageRecipes(ItemStack ingredient) { diff --git a/common/mekanism/client/nei/MetallurgicInfuserRecipeHandler.java b/common/mekanism/client/nei/MetallurgicInfuserRecipeHandler.java index dc9c8b1c6..8ab757fc2 100644 --- a/common/mekanism/client/nei/MetallurgicInfuserRecipeHandler.java +++ b/common/mekanism/client/nei/MetallurgicInfuserRecipeHandler.java @@ -164,6 +164,12 @@ public class MetallurgicInfuserRecipeHandler extends BaseRecipeHandler } } + @Override + public void addGuiElements() + { + + } + public class CachedIORecipe extends TemplateRecipeHandler.CachedRecipe { public List infuseStacks; diff --git a/common/mekanism/client/nei/RotaryCondensentratorRecipeHandler.java b/common/mekanism/client/nei/RotaryCondensentratorRecipeHandler.java index 655bd5781..08ec78b7f 100644 --- a/common/mekanism/client/nei/RotaryCondensentratorRecipeHandler.java +++ b/common/mekanism/client/nei/RotaryCondensentratorRecipeHandler.java @@ -316,6 +316,12 @@ public class RotaryCondensentratorRecipeHandler extends BaseRecipeHandler return 1; } + @Override + public void addGuiElements() + { + + } + public class CachedIORecipe extends TemplateRecipeHandler.CachedRecipe { public GasStack gasStack; diff --git a/common/mekanism/client/nei/SalinationControllerRecipeHandler.java b/common/mekanism/client/nei/SalinationControllerRecipeHandler.java index 4b09f295a..2e73c377a 100644 --- a/common/mekanism/client/nei/SalinationControllerRecipeHandler.java +++ b/common/mekanism/client/nei/SalinationControllerRecipeHandler.java @@ -260,6 +260,12 @@ public class SalinationControllerRecipeHandler extends BaseRecipeHandler return 1; } + @Override + public void addGuiElements() + { + + } + public class CachedIORecipe extends TemplateRecipeHandler.CachedRecipe { public FluidStack fluidInput; diff --git a/common/mekanism/generators/client/gui/GuiBioGenerator.java b/common/mekanism/generators/client/gui/GuiBioGenerator.java index a61dfc9dc..67258dcd4 100644 --- a/common/mekanism/generators/client/gui/GuiBioGenerator.java +++ b/common/mekanism/generators/client/gui/GuiBioGenerator.java @@ -43,10 +43,10 @@ public class GuiBioGenerator extends GuiMekanism "Storing: " + MekanismUtils.getEnergyDisplay(tileEntity.getEnergy()), "Max Output: " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxOutput()) + "/t"); } - }, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiBioGenerator.png"))); + }, this, MekanismUtils.getResource(ResourceType.GUI, "GuiBioGenerator.png"))); guiElements.add(new GuiPowerBar(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiBioGenerator.png"), 164, 15)); - guiElements.add(new GuiSlot(SlotType.NORMAL, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiBioGenerator.png"), 16, 34)); - guiElements.add(new GuiSlot(SlotType.NORMAL, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiBioGenerator.png"), 142, 34).with(SlotOverlay.POWER)); + guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiBioGenerator.png"), 16, 34)); + guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiBioGenerator.png"), 142, 34).with(SlotOverlay.POWER)); } @Override diff --git a/common/mekanism/generators/client/gui/GuiHeatGenerator.java b/common/mekanism/generators/client/gui/GuiHeatGenerator.java index 0c74b9a4a..57da2a147 100644 --- a/common/mekanism/generators/client/gui/GuiHeatGenerator.java +++ b/common/mekanism/generators/client/gui/GuiHeatGenerator.java @@ -50,17 +50,17 @@ public class GuiHeatGenerator extends GuiMekanism "Storing: " + MekanismUtils.getEnergyDisplay(tileEntity.getEnergy()), "Max Output: " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxOutput()) + "/t"); } - }, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiHeatGenerator.png"))); + }, this, MekanismUtils.getResource(ResourceType.GUI, "GuiHeatGenerator.png"))); guiElements.add(new GuiFluidGauge(new IFluidInfoHandler() { @Override public FluidTank getTank() { return tileEntity.lavaTank; } - }, Type.WIDE, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiHeatGenerator.png"), 55, 18)); + }, Type.WIDE, this, MekanismUtils.getResource(ResourceType.GUI, "GuiHeatGenerator.png"), 55, 18)); guiElements.add(new GuiPowerBar(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiHeatGenerator.png"), 164, 15)); - guiElements.add(new GuiSlot(SlotType.NORMAL, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiHeatGenerator.png"), 16, 34)); - guiElements.add(new GuiSlot(SlotType.NORMAL, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiHeatGenerator.png"), 142, 34).with(SlotOverlay.POWER)); + guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiHeatGenerator.png"), 16, 34)); + guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiHeatGenerator.png"), 142, 34).with(SlotOverlay.POWER)); } @Override diff --git a/common/mekanism/generators/client/gui/GuiHydrogenGenerator.java b/common/mekanism/generators/client/gui/GuiHydrogenGenerator.java index c3195708a..46eee9b8b 100644 --- a/common/mekanism/generators/client/gui/GuiHydrogenGenerator.java +++ b/common/mekanism/generators/client/gui/GuiHydrogenGenerator.java @@ -45,17 +45,17 @@ public class GuiHydrogenGenerator extends GuiMekanism "Storing: " + MekanismUtils.getEnergyDisplay(tileEntity.getEnergy()), "Max Output: " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxOutput()) + "/t"); } - }, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiHydrogenGenerator.png"))); + }, this, MekanismUtils.getResource(ResourceType.GUI, "GuiHydrogenGenerator.png"))); guiElements.add(new GuiGasGauge(new IGasInfoHandler() { @Override public GasTank getTank() { return tileEntity.fuelTank; } - }, Type.WIDE, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiHydrogenGenerator.png"), 55, 18)); + }, Type.WIDE, this, MekanismUtils.getResource(ResourceType.GUI, "GuiHydrogenGenerator.png"), 55, 18)); guiElements.add(new GuiPowerBar(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiHydrogenGenerator.png"), 164, 15)); - guiElements.add(new GuiSlot(SlotType.NORMAL, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiHydrogenGenerator.png"), 16, 34).with(SlotOverlay.MINUS)); - guiElements.add(new GuiSlot(SlotType.NORMAL, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiHydrogenGenerator.png"), 142, 34).with(SlotOverlay.POWER)); + guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiHydrogenGenerator.png"), 16, 34).with(SlotOverlay.MINUS)); + guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiHydrogenGenerator.png"), 142, 34).with(SlotOverlay.POWER)); } @Override diff --git a/common/mekanism/generators/client/gui/GuiSolarGenerator.java b/common/mekanism/generators/client/gui/GuiSolarGenerator.java index 534b68ce1..3eca39cfa 100644 --- a/common/mekanism/generators/client/gui/GuiSolarGenerator.java +++ b/common/mekanism/generators/client/gui/GuiSolarGenerator.java @@ -43,9 +43,9 @@ public class GuiSolarGenerator extends GuiMekanism "Storing: " + MekanismUtils.getEnergyDisplay(tileEntity.getEnergy()), "Max Output: " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxOutput()) + "/t"); } - }, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiSolarGenerator.png"))); + }, this, MekanismUtils.getResource(ResourceType.GUI, "GuiSolarGenerator.png"))); guiElements.add(new GuiPowerBar(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiSolarGenerator.png"), 164, 15)); - guiElements.add(new GuiSlot(SlotType.NORMAL, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiSolarGenerator.png"), 142, 34).with(SlotOverlay.POWER)); + guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiSolarGenerator.png"), 142, 34).with(SlotOverlay.POWER)); } @Override diff --git a/common/mekanism/generators/client/gui/GuiWindTurbine.java b/common/mekanism/generators/client/gui/GuiWindTurbine.java index ffa7ecb82..97d15b90e 100644 --- a/common/mekanism/generators/client/gui/GuiWindTurbine.java +++ b/common/mekanism/generators/client/gui/GuiWindTurbine.java @@ -44,9 +44,9 @@ public class GuiWindTurbine extends GuiMekanism "Storing: " + MekanismUtils.getEnergyDisplay(tileEntity.getEnergy()), "Max Output: " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxOutput()) + "/t"); } - }, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiWindTurbine.png"))); + }, this, MekanismUtils.getResource(ResourceType.GUI, "GuiWindTurbine.png"))); guiElements.add(new GuiPowerBar(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiWindTurbine.png"), 164, 15)); - guiElements.add(new GuiSlot(SlotType.NORMAL, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiWindTurbine.png"), 142, 34).with(SlotOverlay.POWER)); + guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiWindTurbine.png"), 142, 34).with(SlotOverlay.POWER)); } @Override