diff --git a/resources/assets/enderio/textures/gui/alloySmelter.png b/resources/assets/enderio/textures/gui/23/alloySmelter.png similarity index 100% rename from resources/assets/enderio/textures/gui/alloySmelter.png rename to resources/assets/enderio/textures/gui/23/alloySmelter.png diff --git a/resources/assets/enderio/textures/gui/attractor.png b/resources/assets/enderio/textures/gui/23/attractor.png similarity index 100% rename from resources/assets/enderio/textures/gui/attractor.png rename to resources/assets/enderio/textures/gui/23/attractor.png diff --git a/resources/assets/enderio/textures/gui/buffer.png b/resources/assets/enderio/textures/gui/23/buffer.png similarity index 100% rename from resources/assets/enderio/textures/gui/buffer.png rename to resources/assets/enderio/textures/gui/23/buffer.png diff --git a/resources/assets/enderio/textures/gui/buffer_full.png b/resources/assets/enderio/textures/gui/23/buffer_full.png similarity index 100% rename from resources/assets/enderio/textures/gui/buffer_full.png rename to resources/assets/enderio/textures/gui/23/buffer_full.png diff --git a/resources/assets/enderio/textures/gui/capacitorBank.png b/resources/assets/enderio/textures/gui/23/capacitorBank.png similarity index 100% rename from resources/assets/enderio/textures/gui/capacitorBank.png rename to resources/assets/enderio/textures/gui/23/capacitorBank.png diff --git a/resources/assets/enderio/textures/gui/combustionGen.png b/resources/assets/enderio/textures/gui/23/combustionGen.png similarity index 100% rename from resources/assets/enderio/textures/gui/combustionGen.png rename to resources/assets/enderio/textures/gui/23/combustionGen.png diff --git a/resources/assets/enderio/textures/gui/crafter.png b/resources/assets/enderio/textures/gui/23/crafter.png similarity index 100% rename from resources/assets/enderio/textures/gui/crafter.png rename to resources/assets/enderio/textures/gui/23/crafter.png diff --git a/resources/assets/enderio/textures/gui/crusher.png b/resources/assets/enderio/textures/gui/23/crusher.png similarity index 100% rename from resources/assets/enderio/textures/gui/crusher.png rename to resources/assets/enderio/textures/gui/23/crusher.png diff --git a/resources/assets/enderio/textures/gui/enchanter.png b/resources/assets/enderio/textures/gui/23/enchanter.png similarity index 100% rename from resources/assets/enderio/textures/gui/enchanter.png rename to resources/assets/enderio/textures/gui/23/enchanter.png diff --git a/resources/assets/enderio/textures/gui/experianceObelisk.png b/resources/assets/enderio/textures/gui/23/experianceObelisk.png similarity index 100% rename from resources/assets/enderio/textures/gui/experianceObelisk.png rename to resources/assets/enderio/textures/gui/23/experianceObelisk.png diff --git a/resources/assets/enderio/textures/gui/externalConduitConnection.png b/resources/assets/enderio/textures/gui/23/externalConduitConnection.png similarity index 100% rename from resources/assets/enderio/textures/gui/externalConduitConnection.png rename to resources/assets/enderio/textures/gui/23/externalConduitConnection.png diff --git a/resources/assets/enderio/textures/gui/farmStation.png b/resources/assets/enderio/textures/gui/23/farmStation.png similarity index 100% rename from resources/assets/enderio/textures/gui/farmStation.png rename to resources/assets/enderio/textures/gui/23/farmStation.png diff --git a/resources/assets/enderio/textures/gui/hyperCube.png b/resources/assets/enderio/textures/gui/23/hyperCube.png similarity index 100% rename from resources/assets/enderio/textures/gui/hyperCube.png rename to resources/assets/enderio/textures/gui/23/hyperCube.png diff --git a/resources/assets/enderio/textures/gui/inhibitor.png b/resources/assets/enderio/textures/gui/23/inhibitor.png similarity index 100% rename from resources/assets/enderio/textures/gui/inhibitor.png rename to resources/assets/enderio/textures/gui/23/inhibitor.png diff --git a/resources/assets/enderio/textures/gui/inventorypanel.png b/resources/assets/enderio/textures/gui/23/inventorypanel.png similarity index 100% rename from resources/assets/enderio/textures/gui/inventorypanel.png rename to resources/assets/enderio/textures/gui/23/inventorypanel.png diff --git a/resources/assets/enderio/textures/gui/itemFilter.png b/resources/assets/enderio/textures/gui/23/itemFilter.png similarity index 100% rename from resources/assets/enderio/textures/gui/itemFilter.png rename to resources/assets/enderio/textures/gui/23/itemFilter.png diff --git a/resources/assets/enderio/textures/gui/killerJoe.png b/resources/assets/enderio/textures/gui/23/killerJoe.png similarity index 100% rename from resources/assets/enderio/textures/gui/killerJoe.png rename to resources/assets/enderio/textures/gui/23/killerJoe.png diff --git a/resources/assets/enderio/textures/gui/painter.png b/resources/assets/enderio/textures/gui/23/painter.png similarity index 100% rename from resources/assets/enderio/textures/gui/painter.png rename to resources/assets/enderio/textures/gui/23/painter.png diff --git a/resources/assets/enderio/textures/gui/powerMonitor.png b/resources/assets/enderio/textures/gui/23/powerMonitor.png similarity index 100% rename from resources/assets/enderio/textures/gui/powerMonitor.png rename to resources/assets/enderio/textures/gui/23/powerMonitor.png diff --git a/resources/assets/enderio/textures/gui/poweredSpawner.png b/resources/assets/enderio/textures/gui/23/poweredSpawner.png similarity index 100% rename from resources/assets/enderio/textures/gui/poweredSpawner.png rename to resources/assets/enderio/textures/gui/23/poweredSpawner.png diff --git a/resources/assets/enderio/textures/gui/sliceAndSplice.png b/resources/assets/enderio/textures/gui/23/sliceAndSplice.png similarity index 100% rename from resources/assets/enderio/textures/gui/sliceAndSplice.png rename to resources/assets/enderio/textures/gui/23/sliceAndSplice.png diff --git a/resources/assets/enderio/textures/gui/soulFuser.png b/resources/assets/enderio/textures/gui/23/soulFuser.png similarity index 100% rename from resources/assets/enderio/textures/gui/soulFuser.png rename to resources/assets/enderio/textures/gui/23/soulFuser.png diff --git a/resources/assets/enderio/textures/gui/stirlingGenerator.png b/resources/assets/enderio/textures/gui/23/stirlingGenerator.png similarity index 100% rename from resources/assets/enderio/textures/gui/stirlingGenerator.png rename to resources/assets/enderio/textures/gui/23/stirlingGenerator.png diff --git a/resources/assets/enderio/textures/gui/tank.png b/resources/assets/enderio/textures/gui/23/tank.png similarity index 100% rename from resources/assets/enderio/textures/gui/tank.png rename to resources/assets/enderio/textures/gui/23/tank.png diff --git a/resources/assets/enderio/textures/gui/telePad.png b/resources/assets/enderio/textures/gui/23/telePad.png similarity index 100% rename from resources/assets/enderio/textures/gui/telePad.png rename to resources/assets/enderio/textures/gui/23/telePad.png diff --git a/resources/assets/enderio/textures/gui/transceiver.png b/resources/assets/enderio/textures/gui/23/transceiver.png similarity index 100% rename from resources/assets/enderio/textures/gui/transceiver.png rename to resources/assets/enderio/textures/gui/23/transceiver.png diff --git a/resources/assets/enderio/textures/gui/travelAccessable.png b/resources/assets/enderio/textures/gui/23/travelAccessable.png similarity index 100% rename from resources/assets/enderio/textures/gui/travelAccessable.png rename to resources/assets/enderio/textures/gui/23/travelAccessable.png diff --git a/resources/assets/enderio/textures/gui/travelAuth.png b/resources/assets/enderio/textures/gui/23/travelAuth.png similarity index 100% rename from resources/assets/enderio/textures/gui/travelAuth.png rename to resources/assets/enderio/textures/gui/23/travelAuth.png diff --git a/resources/assets/enderio/textures/gui/vacumChest.png b/resources/assets/enderio/textures/gui/23/vacumChest.png similarity index 100% rename from resources/assets/enderio/textures/gui/vacumChest.png rename to resources/assets/enderio/textures/gui/23/vacumChest.png diff --git a/resources/assets/enderio/textures/gui/vat.png b/resources/assets/enderio/textures/gui/23/vat.png similarity index 100% rename from resources/assets/enderio/textures/gui/vat.png rename to resources/assets/enderio/textures/gui/23/vat.png diff --git a/resources/assets/enderio/textures/gui/weatherObelisk.png b/resources/assets/enderio/textures/gui/23/weatherObelisk.png similarity index 100% rename from resources/assets/enderio/textures/gui/weatherObelisk.png rename to resources/assets/enderio/textures/gui/23/weatherObelisk.png diff --git a/resources/assets/enderio/textures/gui/zombieGenerator.png b/resources/assets/enderio/textures/gui/23/zombieGenerator.png similarity index 100% rename from resources/assets/enderio/textures/gui/zombieGenerator.png rename to resources/assets/enderio/textures/gui/23/zombieGenerator.png diff --git a/src/main/java/crazypants/enderio/conduit/gui/GuiExternalConnection.java b/src/main/java/crazypants/enderio/conduit/gui/GuiExternalConnection.java index c59559ff..af09ab0e 100644 --- a/src/main/java/crazypants/enderio/conduit/gui/GuiExternalConnection.java +++ b/src/main/java/crazypants/enderio/conduit/gui/GuiExternalConnection.java @@ -18,7 +18,6 @@ import org.lwjgl.opengl.GL11; import com.enderio.core.api.client.gui.ITabPanel; import com.enderio.core.api.client.render.IWidgetIcon; -import com.enderio.core.client.gui.GuiContainerBase; import com.enderio.core.client.render.RenderUtil; import cpw.mods.fml.common.Optional; @@ -31,9 +30,10 @@ import crazypants.enderio.conduit.me.IMEConduit; import crazypants.enderio.conduit.oc.IOCConduit; import crazypants.enderio.conduit.power.IPowerConduit; import crazypants.enderio.conduit.redstone.IRedstoneConduit; +import crazypants.enderio.gui.GuiContainerBaseEIO; import crazypants.enderio.gui.IconEIO; -public class GuiExternalConnection extends GuiContainerBase { +public class GuiExternalConnection extends GuiContainerBaseEIO { private static final int TAB_HEIGHT = 24; @@ -67,7 +67,7 @@ public class GuiExternalConnection extends GuiContainerBase { private final ExternalConnectionContainer container; public GuiExternalConnection(InventoryPlayer playerInv, IConduitBundle bundle, ForgeDirection dir) { - super(new ExternalConnectionContainer(playerInv, bundle, dir)); + super(new ExternalConnectionContainer(playerInv, bundle, dir), "externalConduitConnection", "itemFilter"); container = (ExternalConnectionContainer) inventorySlots; this.playerInv = playerInv; this.bundle = bundle; @@ -186,7 +186,7 @@ public class GuiExternalConnection extends GuiContainerBase { tes.draw(); - RenderUtil.bindTexture("enderio:textures/gui/externalConduitConnection.png"); + bindGuiTexture(); drawTexturedModalRect(sx, sy, 0, 0, this.xSize, this.ySize); RenderUtil.bindTexture(IconEIO.TEXTURE); diff --git a/src/main/java/crazypants/enderio/conduit/gui/LiquidSettings.java b/src/main/java/crazypants/enderio/conduit/gui/LiquidSettings.java index 48cf15fd..e9182249 100644 --- a/src/main/java/crazypants/enderio/conduit/gui/LiquidSettings.java +++ b/src/main/java/crazypants/enderio/conduit/gui/LiquidSettings.java @@ -271,7 +271,7 @@ public class LiquidSettings extends BaseSettingsPanel { } GL11.glColor3f(1, 1, 1); - RenderUtil.bindTexture("enderio:textures/gui/itemFilter.png"); + gui.bindGuiTexture(1); gui.drawTexturedModalRect(gui.getGuiLeft(), gui.getGuiTop() + 55, 0, 55, gui.getXSize(), 145); FontRenderer fr = gui.getFontRenderer(); @@ -283,7 +283,7 @@ public class LiquidSettings extends BaseSettingsPanel { x = gui.getGuiLeft() + filterX; y = gui.getGuiTop() + filterY; GL11.glColor3f(1, 1, 1); - RenderUtil.bindTexture("enderio:textures/gui/externalConduitConnection.png"); + gui.bindGuiTexture(); gui.drawTexturedModalRect(x, y, 24, 238, 90, 18); FluidFilter filter = eConduit.getFilter(gui.getDir(), isInput); diff --git a/src/main/java/crazypants/enderio/conduit/gui/item/BasicItemFilterGui.java b/src/main/java/crazypants/enderio/conduit/gui/item/BasicItemFilterGui.java index 81d241c2..1fb6ca14 100644 --- a/src/main/java/crazypants/enderio/conduit/gui/item/BasicItemFilterGui.java +++ b/src/main/java/crazypants/enderio/conduit/gui/item/BasicItemFilterGui.java @@ -8,12 +8,12 @@ import com.enderio.core.client.gui.GuiContainerBase; import com.enderio.core.client.gui.button.CycleButton; import com.enderio.core.client.gui.button.IconButton; import com.enderio.core.client.gui.button.ToggleButton; -import com.enderio.core.client.render.RenderUtil; import crazypants.enderio.EnderIO; import crazypants.enderio.conduit.gui.GuiExternalConnection; import crazypants.enderio.conduit.item.filter.FuzzyMode; import crazypants.enderio.conduit.item.filter.ItemFilter; +import crazypants.enderio.gui.GuiContainerBaseEIO; import crazypants.enderio.gui.IconEIO; public class BasicItemFilterGui implements IItemFilterGui { @@ -25,7 +25,7 @@ public class BasicItemFilterGui implements IItemFilterGui { private static final int ID_STICKY = GuiExternalConnection.nextButtonId(); private static final int ID_FUZZY = GuiExternalConnection.nextButtonId(); - private final GuiContainerBase gui; + private final GuiContainerBaseEIO gui; private final ToggleButton useMetaB; private final ToggleButton useNbtB; @@ -44,11 +44,12 @@ public class BasicItemFilterGui implements IItemFilterGui { private int xOffset; private int yOffset; - public BasicItemFilterGui(GuiContainerBase gui, IItemFilterContainer filterContainer, boolean isStickyModeAvailable) { + public BasicItemFilterGui(GuiContainerBaseEIO gui, IItemFilterContainer filterContainer, boolean isStickyModeAvailable) { this(gui, filterContainer, isStickyModeAvailable, 32, 68, 0); } - public BasicItemFilterGui(GuiContainerBase gui, IItemFilterContainer filterContainer, boolean isStickyModeAvailable, int xOffset, int yOffset, + public BasicItemFilterGui(GuiContainerBaseEIO gui, IItemFilterContainer filterContainer, boolean isStickyModeAvailable, + int xOffset, int yOffset, int buttonIdOffset) { this.gui = gui; this.isStickyModeAvailable = isStickyModeAvailable; @@ -186,7 +187,7 @@ public class BasicItemFilterGui implements IItemFilterGui { @Override public void renderCustomOptions(int top, float par1, int par2, int par3) { GL11.glColor3f(1, 1, 1); - RenderUtil.bindTexture("enderio:textures/gui/itemFilter.png"); + gui.bindGuiTexture(1); gui.drawTexturedModalRect(gui.getGuiLeft() + xOffset, gui.getGuiTop() + yOffset, 0, 238, 18 * 5, 18); if(filter.isAdvanced()) { gui.drawTexturedModalRect(gui.getGuiLeft() + xOffset, gui.getGuiTop() + yOffset + 20, 0, 238, 18 * 5, 18); diff --git a/src/main/java/crazypants/enderio/conduit/gui/item/ItemSettings.java b/src/main/java/crazypants/enderio/conduit/gui/item/ItemSettings.java index 2cb42f61..748401ff 100644 --- a/src/main/java/crazypants/enderio/conduit/gui/item/ItemSettings.java +++ b/src/main/java/crazypants/enderio/conduit/gui/item/ItemSettings.java @@ -368,7 +368,7 @@ public class ItemSettings extends BaseSettingsPanel { return; } - RenderUtil.bindTexture("enderio:textures/gui/itemFilter.png"); + gui.bindGuiTexture(1); gui.drawTexturedModalRect(gui.getGuiLeft(), gui.getGuiTop() + 55, 0, 55, gui.getXSize(), 145); FontRenderer fr = gui.getFontRenderer(); @@ -387,13 +387,13 @@ public class ItemSettings extends BaseSettingsPanel { } else { //draw speed upgrade slot GL11.glColor3f(1, 1, 1); - RenderUtil.bindTexture("enderio:textures/gui/itemFilter.png"); + gui.bindGuiTexture(1); gui.drawTexturedModalRect(gui.getGuiLeft() + 9 + 18, gui.getGuiTop() + 46, 94, 238, 18, 18); } //filter upgrade slot GL11.glColor3f(1, 1, 1); - RenderUtil.bindTexture("enderio:textures/gui/itemFilter.png"); + gui.bindGuiTexture(1); gui.drawTexturedModalRect(gui.getGuiLeft() + 9, gui.getGuiTop() + 46, 94, 220, 18, 18); //function upgrade slot diff --git a/src/main/java/crazypants/enderio/conduit/gui/item/ModItemFilterGui.java b/src/main/java/crazypants/enderio/conduit/gui/item/ModItemFilterGui.java index af8860c4..75bfa5a4 100644 --- a/src/main/java/crazypants/enderio/conduit/gui/item/ModItemFilterGui.java +++ b/src/main/java/crazypants/enderio/conduit/gui/item/ModItemFilterGui.java @@ -104,7 +104,7 @@ public class ModItemFilterGui implements IItemFilterGui { @Override public void renderCustomOptions(int top, float par1, int par2, int par3) { GL11.glColor3f(1, 1, 1); - RenderUtil.bindTexture("enderio:textures/gui/externalConduitConnection.png"); + gui.bindGuiTexture(); for(Rectangle r : inputBounds) { //slot gui.drawTexturedModalRect(gui.getGuiLeft() + r.x - 1, gui.getGuiTop() + r.y - 1, 24, 214, 18, 18); diff --git a/src/main/java/crazypants/enderio/gui/GuiContainerBaseEIO.java b/src/main/java/crazypants/enderio/gui/GuiContainerBaseEIO.java new file mode 100644 index 00000000..a4d93ca7 --- /dev/null +++ b/src/main/java/crazypants/enderio/gui/GuiContainerBaseEIO.java @@ -0,0 +1,40 @@ +package crazypants.enderio.gui; + +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.inventory.Container; +import net.minecraft.util.ResourceLocation; + +import com.enderio.core.client.gui.GuiContainerBase; +import com.enderio.core.client.render.RenderUtil; + +import crazypants.enderio.EnderIO; + +public abstract class GuiContainerBaseEIO extends GuiContainerBase { + + private static final String TEXTURE_PATH = ":textures/gui/23/"; + private static final String TEXTURE_EXT = ".png"; + + private final List guiTextures = new ArrayList(); + + public GuiContainerBaseEIO(Container par1Container, String... guiTexture) { + super(par1Container); + for (String string : guiTexture) { + guiTextures.add(new ResourceLocation(EnderIO.DOMAIN + TEXTURE_PATH + string + TEXTURE_EXT)); + } + } + + public void bindGuiTexture() { + bindGuiTexture(0); + } + + public void bindGuiTexture(int id) { + RenderUtil.bindTexture(getGuiTexture(id)); + } + + protected ResourceLocation getGuiTexture(int id) { + return guiTextures.size() > id ? guiTextures.get(id) : null; + } + +} diff --git a/src/main/java/crazypants/enderio/machine/alloy/GuiAlloySmelter.java b/src/main/java/crazypants/enderio/machine/alloy/GuiAlloySmelter.java index cd9b9321..45267fc1 100644 --- a/src/main/java/crazypants/enderio/machine/alloy/GuiAlloySmelter.java +++ b/src/main/java/crazypants/enderio/machine/alloy/GuiAlloySmelter.java @@ -26,7 +26,7 @@ public class GuiAlloySmelter extends GuiPoweredMachineBase { protected static final int SMELT_MODE_BUTTON_ID = 76; public GuiAlloySmelter(InventoryPlayer par1InventoryPlayer, TileAlloySmelter furnaceInventory) { - super(furnaceInventory, new ContainerAlloySmelter(par1InventoryPlayer, furnaceInventory)); + super(furnaceInventory, new ContainerAlloySmelter(par1InventoryPlayer, furnaceInventory), "alloySmelter"); vanillaFurnaceButton = new IIconButton(getFontRenderer(), SMELT_MODE_BUTTON_ID, 0, 0, null, RenderUtil.BLOCK_TEX); vanillaFurnaceButton.setSize(BUTTON_SIZE, BUTTON_SIZE); @@ -94,7 +94,7 @@ public class GuiAlloySmelter extends GuiPoweredMachineBase { @Override protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - RenderUtil.bindTexture("enderio:textures/gui/alloySmelter.png"); + bindGuiTexture(); int sx = guiLeft; int sy = guiTop; diff --git a/src/main/java/crazypants/enderio/machine/buffer/GuiBuffer.java b/src/main/java/crazypants/enderio/machine/buffer/GuiBuffer.java index 41d5beb5..31d9e156 100644 --- a/src/main/java/crazypants/enderio/machine/buffer/GuiBuffer.java +++ b/src/main/java/crazypants/enderio/machine/buffer/GuiBuffer.java @@ -18,8 +18,8 @@ import crazypants.enderio.network.PacketHandler; public class GuiBuffer extends GuiPoweredMachineBase { - private static final String TEXTURE_SIMPLE = "enderio:textures/gui/buffer.png"; - private static final String TEXTURE_FULL = "enderio:textures/gui/buffer_full.png"; + private static final String TEXTURE_SIMPLE = "buffer"; + private static final String TEXTURE_FULL = "buffer_full"; private TextFieldEnder maxInput; private TextFieldEnder maxOutput; @@ -27,12 +27,10 @@ public class GuiBuffer extends GuiPoweredMachineBase { private int lastInput, lastOutput; public GuiBuffer(InventoryPlayer par1InventoryPlayer, TileBuffer te) { - super(te, new ContainerBuffer(par1InventoryPlayer, te)); + super(te, new ContainerBuffer(par1InventoryPlayer, te), TEXTURE_SIMPLE, TEXTURE_FULL); redstoneButton.setPosition(isFull() ? 153 : 120, 24); configB.setPosition(isFull() ? 153 : 120, 42); - FontRenderer fnt = Minecraft.getMinecraft().fontRenderer; - if(te.hasPower()) { int x = (isFull() ? 20 : 58); int y = guiTop + 27; @@ -137,13 +135,13 @@ public class GuiBuffer extends GuiPoweredMachineBase { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - RenderUtil.bindTexture(isFull() ? TEXTURE_FULL : TEXTURE_SIMPLE); + bindGuiTexture(isFull() ? 1 : 0); int sx = (width - xSize) / 2; int sy = (height - ySize) / 2; drawTexturedModalRect(sx, sy, 0, 0, xSize, ySize); - RenderUtil.bindTexture(TEXTURE_SIMPLE); + bindGuiTexture(); if(getTileEntity().hasPower()) { drawPowerBg(sx, sy); @@ -171,6 +169,7 @@ public class GuiBuffer extends GuiPoweredMachineBase { return getTileEntity().hasInventory() && getTileEntity().hasPower(); } + @Override public void renderSlotHighlights(IoMode mode) { if (!getTileEntity().hasInventory()) { return; diff --git a/src/main/java/crazypants/enderio/machine/capbank/GuiCapBank.java b/src/main/java/crazypants/enderio/machine/capbank/GuiCapBank.java index a4bd916e..ad695970 100644 --- a/src/main/java/crazypants/enderio/machine/capbank/GuiCapBank.java +++ b/src/main/java/crazypants/enderio/machine/capbank/GuiCapBank.java @@ -13,7 +13,6 @@ import net.minecraft.util.EnumChatFormatting; import org.lwjgl.opengl.GL11; -import com.enderio.core.client.gui.GuiContainerBase; import com.enderio.core.client.gui.widget.GuiToolTip; import com.enderio.core.client.gui.widget.TextFieldEnder; import com.enderio.core.client.render.RenderUtil; @@ -21,6 +20,7 @@ import com.enderio.core.common.util.BlockCoord; import com.enderio.core.common.vecmath.VecmathUtil; import crazypants.enderio.EnderIO; +import crazypants.enderio.gui.GuiContainerBaseEIO; import crazypants.enderio.gui.RedstoneModeButton; import crazypants.enderio.machine.IRedstoneModeControlable; import crazypants.enderio.machine.IoMode; @@ -34,7 +34,7 @@ import crazypants.enderio.machine.gui.GuiPoweredMachineBase; import crazypants.enderio.machine.power.PowerDisplayUtil; import crazypants.enderio.network.PacketHandler; -public class GuiCapBank extends GuiContainerBase { +public class GuiCapBank extends GuiContainerBaseEIO { private static final CapBankClientNetwork NULL_NETWORK = new CapBankClientNetwork(-1); @@ -76,7 +76,7 @@ public class GuiCapBank extends GuiContainerBase { private final ContainerCapBank container; public GuiCapBank(Entity player, InventoryPlayer playerInv, TileCapBank te) { - super(new ContainerCapBank(playerInv, te)); + super(new ContainerCapBank(playerInv, te), "capacitorBank"); capBank = te; container = (ContainerCapBank) inventorySlots; @@ -240,7 +240,7 @@ public class GuiCapBank extends GuiContainerBase { requestStateUpdate(); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - RenderUtil.bindTexture("enderio:textures/gui/capacitorBank.png"); + bindGuiTexture(); int sx = (width - xSize) / 2; int sy = (height - ySize) / 2; diff --git a/src/main/java/crazypants/enderio/machine/crafter/GuiCrafter.java b/src/main/java/crazypants/enderio/machine/crafter/GuiCrafter.java index 557924bf..bbc427cc 100644 --- a/src/main/java/crazypants/enderio/machine/crafter/GuiCrafter.java +++ b/src/main/java/crazypants/enderio/machine/crafter/GuiCrafter.java @@ -26,7 +26,7 @@ public class GuiCrafter extends GuiPoweredMachineBase { private final ToggleButton bufferSizeB; public GuiCrafter(InventoryPlayer par1InventoryPlayer, TileCrafter te) { - super(te, new ContainerCrafter(par1InventoryPlayer, te)); + super(te, new ContainerCrafter(par1InventoryPlayer, te), "crafter"); xSize = getXSize(); int x = getXSize() - 5 - 16; @@ -98,7 +98,7 @@ public class GuiCrafter extends GuiPoweredMachineBase { @Override protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - RenderUtil.bindTexture("enderio:textures/gui/crafter.png"); + bindGuiTexture(); int sx = (width - xSize) / 2; int sy = (height - ySize) / 2; diff --git a/src/main/java/crazypants/enderio/machine/crusher/GuiCrusher.java b/src/main/java/crazypants/enderio/machine/crusher/GuiCrusher.java index 1299a7ae..a8d58551 100644 --- a/src/main/java/crazypants/enderio/machine/crusher/GuiCrusher.java +++ b/src/main/java/crazypants/enderio/machine/crusher/GuiCrusher.java @@ -14,7 +14,7 @@ import crazypants.enderio.machine.gui.GuiPoweredMachineBase; public class GuiCrusher extends GuiPoweredMachineBase { public GuiCrusher(InventoryPlayer par1InventoryPlayer, TileCrusher inventory) { - super(inventory, new ContainerCrusher(par1InventoryPlayer, inventory)); + super(inventory, new ContainerCrusher(par1InventoryPlayer, inventory), "crusher"); addToolTip(new GuiToolTip(new Rectangle(142, 23, 5, 17), "") { @Override @@ -34,7 +34,7 @@ public class GuiCrusher extends GuiPoweredMachineBase { @Override protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - RenderUtil.bindTexture("enderio:textures/gui/crusher.png"); + bindGuiTexture(); drawTexturedModalRect(guiLeft, guiTop, 0, 0, this.xSize, this.ySize); diff --git a/src/main/java/crazypants/enderio/machine/enchanter/GuiEnchanter.java b/src/main/java/crazypants/enderio/machine/enchanter/GuiEnchanter.java index 6a950fa0..8ce49ee4 100644 --- a/src/main/java/crazypants/enderio/machine/enchanter/GuiEnchanter.java +++ b/src/main/java/crazypants/enderio/machine/enchanter/GuiEnchanter.java @@ -7,22 +7,21 @@ import net.minecraft.entity.player.InventoryPlayer; import org.lwjgl.opengl.GL11; -import com.enderio.core.client.gui.GuiContainerBase; import com.enderio.core.client.gui.button.IconButton; import com.enderio.core.client.render.RenderUtil; import crazypants.enderio.EnderIO; +import crazypants.enderio.gui.GuiContainerBaseEIO; import crazypants.enderio.gui.IconEIO; -import crazypants.enderio.machine.obelisk.attractor.ContainerAttractor; -public class GuiEnchanter extends GuiContainerBase { +public class GuiEnchanter extends GuiContainerBaseEIO { private TileEnchanter te; private ContainerEnchanter container; private IconButton recipeButton; public GuiEnchanter(EntityPlayer player, InventoryPlayer inventory, TileEnchanter te) { - super(new ContainerEnchanter(player, inventory, te)); + super(new ContainerEnchanter(player, inventory, te), "enchanter"); container = (ContainerEnchanter)inventorySlots; this.te = te; @@ -42,7 +41,7 @@ public class GuiEnchanter extends GuiContainerBase { @Override protected void drawGuiContainerBackgroundLayer(float var1, int var2, int var3) { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - RenderUtil.bindTexture("enderio:textures/gui/enchanter.png"); + bindGuiTexture(); int sx = (width - xSize) / 2; int sy = (height - ySize) / 2; drawTexturedModalRect(sx, sy, 0, 0, this.xSize, this.ySize); @@ -60,7 +59,7 @@ public class GuiEnchanter extends GuiContainerBase { col = 8453920; //all good } else { col = 16736352; //not enough levels - RenderUtil.bindTexture("enderio:textures/gui/enchanter.png"); + bindGuiTexture(); drawTexturedModalRect(sx + 99, sy + 33, 176, 0, 28, 21); } String s = I18n.format("container.repair.cost", new Object[] {Integer.valueOf(curCost)}); diff --git a/src/main/java/crazypants/enderio/machine/farm/GuiFarmStation.java b/src/main/java/crazypants/enderio/machine/farm/GuiFarmStation.java index 3495361a..211a8fb7 100644 --- a/src/main/java/crazypants/enderio/machine/farm/GuiFarmStation.java +++ b/src/main/java/crazypants/enderio/machine/farm/GuiFarmStation.java @@ -24,7 +24,7 @@ public class GuiFarmStation extends GuiPoweredMachineBase { private static final int LOCK_ID = 1234; public GuiFarmStation(InventoryPlayer par1InventoryPlayer, TileFarmStation machine) { - super(machine, new FarmStationContainer(par1InventoryPlayer, machine)); + super(machine, new FarmStationContainer(par1InventoryPlayer, machine), "farmStation"); setYSize(ySize + 3); } @@ -65,7 +65,7 @@ public class GuiFarmStation extends GuiPoweredMachineBase { @Override protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - RenderUtil.bindTexture("enderio:textures/gui/farmStation.png"); + bindGuiTexture(); int sx = (width - xSize) / 2; int sy = (height - ySize) / 2; @@ -80,7 +80,7 @@ public class GuiFarmStation extends GuiPoweredMachineBase { fr.drawString("NE", sx + 73, sy + 66, ColorUtil.getARGB(1f,1f,0.35f,1f), true); GL11.glDisable(GL11.GL_BLEND); - RenderUtil.bindTexture("enderio:textures/gui/farmStation.png"); + bindGuiTexture(); super.drawGuiContainerBackgroundLayer(par1, par2, par3); } diff --git a/src/main/java/crazypants/enderio/machine/generator/combustion/GuiCombustionGenerator.java b/src/main/java/crazypants/enderio/machine/generator/combustion/GuiCombustionGenerator.java index b49d6184..1aac62a7 100644 --- a/src/main/java/crazypants/enderio/machine/generator/combustion/GuiCombustionGenerator.java +++ b/src/main/java/crazypants/enderio/machine/generator/combustion/GuiCombustionGenerator.java @@ -21,7 +21,7 @@ import crazypants.enderio.machine.power.PowerDisplayUtil; public class GuiCombustionGenerator extends GuiPoweredMachineBase { public GuiCombustionGenerator(InventoryPlayer par1InventoryPlayer, TileCombustionGenerator te) { - super(te, new ContainerCombustionEngine(par1InventoryPlayer, te)); + super(te, new ContainerCombustionEngine(par1InventoryPlayer, te), "combustionGen"); addToolTip(new GuiToolTip(new Rectangle(114, 21, 15, 47), "") { @@ -79,7 +79,7 @@ public class GuiCombustionGenerator extends GuiPoweredMachineBase { public GuiStirlingGenerator(InventoryPlayer par1InventoryPlayer, TileEntityStirlingGenerator te) { - super(te, new StirlingGeneratorContainer(par1InventoryPlayer, te)); + super(te, new StirlingGeneratorContainer(par1InventoryPlayer, te), "stirlingGenerator"); final StirlingGeneratorContainer c = (StirlingGeneratorContainer)inventorySlots; Rectangle r = new Rectangle(c.getUpgradeOffset(), new Dimension(16, 16)); @@ -85,7 +85,7 @@ public class GuiStirlingGenerator extends GuiPoweredMachineBase { public GuiZombieGenerator(InventoryPlayer inventory, final TileZombieGenerator tileEntity) { - super(tileEntity, new ContainerZombieGenerator(inventory, tileEntity)); + super(tileEntity, new ContainerZombieGenerator(inventory, tileEntity), "zombieGenerator"); addToolTip(new GuiToolTip(new Rectangle(80, 21, 15, 47), "") { @@ -61,7 +61,7 @@ public class GuiZombieGenerator extends GuiPoweredMachineBase extends GuiContainerBase { +public abstract class GuiMachineBase extends GuiContainerBaseEIO { public static final Vector4f PUSH_COLOR = new Vector4f(0.8f, 0.4f, 0.1f, 0.5f); public static final Vector4f PULL_COLOR = new Vector4f(0.1f, 0.4f, 0.8f, 0.5f); @@ -50,8 +50,8 @@ public abstract class GuiMachineBase extends Gu protected List progressTooltips; protected int lastProgressTooltipValue = -1; - protected GuiMachineBase(T machine, Container par1Container) { - super(par1Container); + protected GuiMachineBase(T machine, Container par1Container, String... guiTexture) { + super(par1Container, guiTexture); tileEntity = machine; xSize = getXSize(); diff --git a/src/main/java/crazypants/enderio/machine/gui/GuiPoweredMachineBase.java b/src/main/java/crazypants/enderio/machine/gui/GuiPoweredMachineBase.java index 99cf7173..868dc940 100644 --- a/src/main/java/crazypants/enderio/machine/gui/GuiPoweredMachineBase.java +++ b/src/main/java/crazypants/enderio/machine/gui/GuiPoweredMachineBase.java @@ -21,8 +21,8 @@ public abstract class GuiPoweredMachineBase { private final Rectangle btnAddStoredRecipe = new Rectangle(); public GuiInventoryPanel(TileInventoryPanel te, Container container) { - super(te, container); + super(te, container, "inventorypanel"); redstoneButton.visible = false; configB.visible = false; @@ -283,7 +283,7 @@ public class GuiInventoryPanel extends GuiMachineBase { @Override protected void drawGuiContainerBackgroundLayer(float par1, int mouseX, int mouseY) { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - RenderUtil.bindTexture("enderio:textures/gui/inventorypanel.png"); + bindGuiTexture(); int sx = guiLeft; int sy = guiTop; diff --git a/src/main/java/crazypants/enderio/machine/killera/GuiKillerJoe.java b/src/main/java/crazypants/enderio/machine/killera/GuiKillerJoe.java index b3069203..0f9d0940 100644 --- a/src/main/java/crazypants/enderio/machine/killera/GuiKillerJoe.java +++ b/src/main/java/crazypants/enderio/machine/killera/GuiKillerJoe.java @@ -31,7 +31,7 @@ public class GuiKillerJoe extends GuiMachineBase { private IconButton xp10B; public GuiKillerJoe(InventoryPlayer inventory, final TileKillerJoe tileEntity) { - super(tileEntity, new ContainerKillerJoe(inventory, tileEntity)); + super(tileEntity, new ContainerKillerJoe(inventory, tileEntity), "killerJoe"); addToolTip(new GuiToolTip(new Rectangle(18, 11, 15, 47), "") { @@ -98,7 +98,7 @@ public class GuiKillerJoe extends GuiMachineBase { @Override protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - RenderUtil.bindTexture("enderio:textures/gui/killerJoe.png"); + bindGuiTexture(); int sx = (width - xSize) / 2; int sy = (height - ySize) / 2; drawTexturedModalRect(sx, sy, 0, 0, xSize, ySize); diff --git a/src/main/java/crazypants/enderio/machine/monitor/GuiPowerMonitor.java b/src/main/java/crazypants/enderio/machine/monitor/GuiPowerMonitor.java index d2a12f40..e973d64c 100644 --- a/src/main/java/crazypants/enderio/machine/monitor/GuiPowerMonitor.java +++ b/src/main/java/crazypants/enderio/machine/monitor/GuiPowerMonitor.java @@ -1,5 +1,8 @@ package crazypants.enderio.machine.monitor; +import static crazypants.enderio.machine.power.PowerDisplayUtil.formatPower; +import static crazypants.enderio.machine.power.PowerDisplayUtil.formatPowerFloat; + import java.awt.Color; import java.awt.Rectangle; import java.text.NumberFormat; @@ -13,7 +16,6 @@ import net.minecraft.item.ItemStack; import org.lwjgl.opengl.GL11; -import com.enderio.core.client.gui.GuiContainerBase; import com.enderio.core.client.gui.button.CheckBox; import com.enderio.core.client.gui.widget.GuiToolTip; import com.enderio.core.client.gui.widget.TextFieldEnder; @@ -21,13 +23,13 @@ import com.enderio.core.client.render.ColorUtil; import com.enderio.core.client.render.RenderUtil; import crazypants.enderio.EnderIO; +import crazypants.enderio.gui.GuiContainerBaseEIO; import crazypants.enderio.gui.IconEIO; import crazypants.enderio.machine.ContainerNoInv; import crazypants.enderio.machine.power.PowerDisplayUtil; import crazypants.enderio.network.PacketHandler; -import static crazypants.enderio.machine.power.PowerDisplayUtil.*; -public class GuiPowerMonitor extends GuiContainerBase { +public class GuiPowerMonitor extends GuiContainerBaseEIO { private static final NumberFormat INT_NF = NumberFormat.getIntegerInstance(); @@ -73,7 +75,7 @@ public class GuiPowerMonitor extends GuiContainerBase { private String noNetworkError; public GuiPowerMonitor(InventoryPlayer playerInv, final TilePowerMonitor te) { - super(new ContainerNoInv(te)); + super(new ContainerNoInv(te), "powerMonitor"); this.te = te; xSize = WIDTH; ySize = HEIGHT; @@ -179,7 +181,7 @@ public class GuiPowerMonitor extends GuiContainerBase { protected void drawGuiContainerBackgroundLayer(float ptick, int mouseX, int mouseY) { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - RenderUtil.bindTexture("enderio:textures/gui/powerMonitor.png"); + bindGuiTexture(); int sx = (width - xSize) / 2; int sy = (height - ySize) / 2; diff --git a/src/main/java/crazypants/enderio/machine/obelisk/attractor/GuiAttractor.java b/src/main/java/crazypants/enderio/machine/obelisk/attractor/GuiAttractor.java index 4eda03fb..95ed25e4 100644 --- a/src/main/java/crazypants/enderio/machine/obelisk/attractor/GuiAttractor.java +++ b/src/main/java/crazypants/enderio/machine/obelisk/attractor/GuiAttractor.java @@ -26,7 +26,7 @@ public class GuiAttractor extends GuiPoweredMachineBase { private final ToggleButton showRangeB; public GuiAttractor(InventoryPlayer par1InventoryPlayer, TileAttractor te) { - super(te, new ContainerAttractor(par1InventoryPlayer, te)); + super(te, new ContainerAttractor(par1InventoryPlayer, te), "attractor"); int x = getXSize() - 5 - BUTTON_SIZE; showRangeB = new ToggleButton(this, RANGE_ID, x, 44, IconEIO.PLUS, IconEIO.MINUS); @@ -58,7 +58,7 @@ public class GuiAttractor extends GuiPoweredMachineBase { @Override protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - RenderUtil.bindTexture("enderio:textures/gui/attractor.png"); + bindGuiTexture(); int sx = (width - xSize) / 2; int sy = (height - ySize) / 2; diff --git a/src/main/java/crazypants/enderio/machine/obelisk/aversion/GuiAversionObelisk.java b/src/main/java/crazypants/enderio/machine/obelisk/aversion/GuiAversionObelisk.java index de2f7f9f..ddff09ab 100644 --- a/src/main/java/crazypants/enderio/machine/obelisk/aversion/GuiAversionObelisk.java +++ b/src/main/java/crazypants/enderio/machine/obelisk/aversion/GuiAversionObelisk.java @@ -25,7 +25,7 @@ public class GuiAversionObelisk extends GuiPoweredMachineBase { public GuiInhibitorObelisk(TileInhibitorObelisk machine, Container container) { - super(machine, container); + super(machine, container, "inhibitor"); } @Override protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - RenderUtil.bindTexture("enderio:textures/gui/inhibitor.png"); + bindGuiTexture(); int sx = (width - xSize) / 2; int sy = (height - ySize) / 2; diff --git a/src/main/java/crazypants/enderio/machine/obelisk/weather/GuiWeatherObelisk.java b/src/main/java/crazypants/enderio/machine/obelisk/weather/GuiWeatherObelisk.java index b0fc1dc8..461bb290 100644 --- a/src/main/java/crazypants/enderio/machine/obelisk/weather/GuiWeatherObelisk.java +++ b/src/main/java/crazypants/enderio/machine/obelisk/weather/GuiWeatherObelisk.java @@ -22,11 +22,10 @@ import crazypants.enderio.network.PacketHandler; public class GuiWeatherObelisk extends GuiPoweredMachineBase { - private static final ResourceLocation texture = new ResourceLocation("enderio:textures/gui/weatherObelisk.png"); private static final NumberFormat fmt = NumberFormat.getNumberInstance(); public GuiWeatherObelisk(InventoryPlayer inventory, TileWeatherObelisk tileEntity) { - super(tileEntity, new ContainerWeatherObelisk(inventory, tileEntity)); + super(tileEntity, new ContainerWeatherObelisk(inventory, tileEntity), "weatherObelisk"); addProgressTooltip(79, 29, 18, 31); } @@ -82,7 +81,7 @@ public class GuiWeatherObelisk extends GuiPoweredMachineBase @Override protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { - this.mc.renderEngine.bindTexture(texture); + bindGuiTexture(); this.drawTexturedModalRect(getGuiLeft(), getGuiTop(), 0, 0, getXSize(), getYSize()); diff --git a/src/main/java/crazypants/enderio/machine/obelisk/xp/GuiExperienceObelisk.java b/src/main/java/crazypants/enderio/machine/obelisk/xp/GuiExperienceObelisk.java index e2203719..dcf3b2db 100644 --- a/src/main/java/crazypants/enderio/machine/obelisk/xp/GuiExperienceObelisk.java +++ b/src/main/java/crazypants/enderio/machine/obelisk/xp/GuiExperienceObelisk.java @@ -30,7 +30,7 @@ public class GuiExperienceObelisk extends GuiMachineBase private IconButton mmm; public GuiExperienceObelisk(InventoryPlayer playerInv, TileExperienceObelisk te) { - super(te, new ContainerNoInv(te)); + super(te, new ContainerNoInv(te), "experianceObelisk"); ySize = 115; int spacing = 5; @@ -130,7 +130,7 @@ public class GuiExperienceObelisk extends GuiMachineBase @Override protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - RenderUtil.bindTexture("enderio:textures/gui/experianceObelisk.png"); + bindGuiTexture(); int sx = (width - xSize) / 2; int sy = (height - ySize) / 2; diff --git a/src/main/java/crazypants/enderio/machine/painter/GuiPainter.java b/src/main/java/crazypants/enderio/machine/painter/GuiPainter.java index 8337e66f..2ce89b81 100644 --- a/src/main/java/crazypants/enderio/machine/painter/GuiPainter.java +++ b/src/main/java/crazypants/enderio/machine/painter/GuiPainter.java @@ -15,7 +15,7 @@ import crazypants.enderio.machine.gui.GuiPoweredMachineBase; public class GuiPainter extends GuiPoweredMachineBase { public GuiPainter(InventoryPlayer par1InventoryPlayer, TileEntityPainter te) { - super(te, new PainterContainer(par1InventoryPlayer, te)); + super(te, new PainterContainer(par1InventoryPlayer, te), "painter"); addProgressTooltip(88, 34, 24, 16); } @@ -27,7 +27,7 @@ public class GuiPainter extends GuiPoweredMachineBase { @Override protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - RenderUtil.bindTexture("enderio:textures/gui/painter.png"); + bindGuiTexture(); int k = guiLeft; int l = guiTop; diff --git a/src/main/java/crazypants/enderio/machine/power/GuiCapacitorBank.java b/src/main/java/crazypants/enderio/machine/power/GuiCapacitorBank.java index 0b1c3b7d..21f2f87a 100644 --- a/src/main/java/crazypants/enderio/machine/power/GuiCapacitorBank.java +++ b/src/main/java/crazypants/enderio/machine/power/GuiCapacitorBank.java @@ -21,6 +21,7 @@ import com.enderio.core.client.render.RenderUtil; import com.enderio.core.common.util.BlockCoord; import crazypants.enderio.EnderIO; +import crazypants.enderio.gui.GuiContainerBaseEIO; import crazypants.enderio.gui.IconEIO; import crazypants.enderio.gui.RedstoneModeButton; import crazypants.enderio.machine.IRedstoneModeControlable; @@ -30,7 +31,7 @@ import crazypants.enderio.machine.gui.GuiOverlayIoConfig; import crazypants.enderio.machine.gui.GuiPoweredMachineBase; import crazypants.enderio.network.PacketHandler; -public class GuiCapacitorBank extends GuiContainerBase { +public class GuiCapacitorBank extends GuiContainerBaseEIO { protected static final int INPUT_BUTTON_ID = 18; protected static final int OUTPUT_BUTTON_ID = 37; @@ -63,7 +64,7 @@ public class GuiCapacitorBank extends GuiContainerBase { private IconButton configB; public GuiCapacitorBank(Entity player, InventoryPlayer playerInv, TileCapacitorBank te) { - super(new ContainerCapacitorBank(player, playerInv, te)); + super(new ContainerCapacitorBank(player, playerInv, te), "capacitorBank"); this.capBank = te; xSize = 176 + 42; @@ -259,7 +260,7 @@ public class GuiCapacitorBank extends GuiContainerBase { protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - RenderUtil.bindTexture("enderio:textures/gui/capacitorBank.png"); + bindGuiTexture(); int sx = (width - xSize) / 2; int sy = (height - ySize) / 2; diff --git a/src/main/java/crazypants/enderio/machine/slicensplice/GuiSliceAndSplice.java b/src/main/java/crazypants/enderio/machine/slicensplice/GuiSliceAndSplice.java index ddf8f999..18fe95e6 100644 --- a/src/main/java/crazypants/enderio/machine/slicensplice/GuiSliceAndSplice.java +++ b/src/main/java/crazypants/enderio/machine/slicensplice/GuiSliceAndSplice.java @@ -12,7 +12,7 @@ import crazypants.enderio.machine.killera.ContainerKillerJoe; public class GuiSliceAndSplice extends GuiPoweredMachineBase { public GuiSliceAndSplice(InventoryPlayer par1InventoryPlayer, TileSliceAndSplice te) { - super(te, new ContainerSliceAndSplice(par1InventoryPlayer, te)); + super(te, new ContainerSliceAndSplice(par1InventoryPlayer, te), "sliceAndSplice"); addProgressTooltip(103, 49, 24, 16); } @@ -30,7 +30,7 @@ public class GuiSliceAndSplice extends GuiPoweredMachineBase @Override protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - RenderUtil.bindTexture("enderio:textures/gui/sliceAndSplice.png"); + bindGuiTexture(); int k = guiLeft; int l = guiTop; diff --git a/src/main/java/crazypants/enderio/machine/soul/GuiSoulBinder.java b/src/main/java/crazypants/enderio/machine/soul/GuiSoulBinder.java index 33a5208e..12f70bd4 100644 --- a/src/main/java/crazypants/enderio/machine/soul/GuiSoulBinder.java +++ b/src/main/java/crazypants/enderio/machine/soul/GuiSoulBinder.java @@ -25,7 +25,7 @@ public class GuiSoulBinder extends GuiPoweredMachineBase { private final IconButton usePlayerXP; public GuiSoulBinder(InventoryPlayer par1InventoryPlayer, TileSoulBinder te) { - super(te, new ContainerSoulBinder(par1InventoryPlayer, te)); + super(te, new ContainerSoulBinder(par1InventoryPlayer, te), "soulFuser"); usePlayerXP = new IconButton(this, PLAYER_XP_ID, 125, 57, IconEIO.XP); usePlayerXP.visible = false; usePlayerXP.setToolTip("Use Player XP"); @@ -59,7 +59,7 @@ public class GuiSoulBinder extends GuiPoweredMachineBase { @Override protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - RenderUtil.bindTexture("enderio:textures/gui/soulFuser.png"); + bindGuiTexture(); int k = guiLeft; int l = guiTop; @@ -77,7 +77,7 @@ public class GuiSoulBinder extends GuiPoweredMachineBase { ExperienceBarRenderer.render(this, getGuiLeft() + 56, getGuiTop() + 68, 65, binder.getContainer(), binder.getCurrentlyRequiredLevel()); - RenderUtil.bindTexture("enderio:textures/gui/soulFuser.png"); + bindGuiTexture(); super.drawGuiContainerBackgroundLayer(par1, par2, par3); } diff --git a/src/main/java/crazypants/enderio/machine/spawner/GuiPoweredSpawner.java b/src/main/java/crazypants/enderio/machine/spawner/GuiPoweredSpawner.java index 12936d28..8c570c4b 100644 --- a/src/main/java/crazypants/enderio/machine/spawner/GuiPoweredSpawner.java +++ b/src/main/java/crazypants/enderio/machine/spawner/GuiPoweredSpawner.java @@ -27,7 +27,7 @@ public class GuiPoweredSpawner extends GuiPoweredMachineBase private String header; public GuiPoweredSpawner(InventoryPlayer par1InventoryPlayer, TilePoweredSpawner te) { - super(te, new ContainerPoweredSpawner(par1InventoryPlayer, te)); + super(te, new ContainerPoweredSpawner(par1InventoryPlayer, te), "poweredSpawner"); modeB = MultiIconButton.createRightArrowButton(this, 8888, 115, 10); modeB.setSize(10, 16); @@ -77,7 +77,7 @@ public class GuiPoweredSpawner extends GuiPoweredMachineBase @Override protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - RenderUtil.bindTexture("enderio:textures/gui/poweredSpawner.png"); + bindGuiTexture(); int sx = (width - xSize) / 2; int sy = (height - ySize) / 2; @@ -97,7 +97,7 @@ public class GuiPoweredSpawner extends GuiPoweredMachineBase int y = sy + fr.FONT_HEIGHT + 6; fr.drawStringWithShadow(header, x, y, ColorUtil.getRGB(Color.WHITE)); - RenderUtil.bindTexture("enderio:textures/gui/poweredSpawner.png"); + bindGuiTexture(); if(spawnMode) { drawTexturedModalRect(sx + 80, sy + 34, 207, 0, 17, 15); diff --git a/src/main/java/crazypants/enderio/machine/tank/GuiTank.java b/src/main/java/crazypants/enderio/machine/tank/GuiTank.java index 248b837c..347d364e 100644 --- a/src/main/java/crazypants/enderio/machine/tank/GuiTank.java +++ b/src/main/java/crazypants/enderio/machine/tank/GuiTank.java @@ -55,7 +55,7 @@ public class GuiTank extends GuiMachineBase { private CycleButton voidBut; public GuiTank(InventoryPlayer par1InventoryPlayer, TileTank te) { - super(te, new ContainerTank(par1InventoryPlayer, te)); + super(te, new ContainerTank(par1InventoryPlayer, te), "tank"); addToolTip(new GuiToolTip(new Rectangle(80, 21, 16, 47), "") { @@ -120,7 +120,7 @@ public class GuiTank extends GuiMachineBase { @Override protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - RenderUtil.bindTexture("enderio:textures/gui/tank.png"); + bindGuiTexture(); int sx = (width - xSize) / 2; int sy = (height - ySize) / 2; diff --git a/src/main/java/crazypants/enderio/machine/transceiver/gui/FilterTab.java b/src/main/java/crazypants/enderio/machine/transceiver/gui/FilterTab.java index 02049e42..3bb0dd12 100644 --- a/src/main/java/crazypants/enderio/machine/transceiver/gui/FilterTab.java +++ b/src/main/java/crazypants/enderio/machine/transceiver/gui/FilterTab.java @@ -86,7 +86,7 @@ public class FilterTab implements ITabPanel { GL11.glColor3f(1, 1, 1); //Inventory - RenderUtil.bindTexture("enderio:textures/gui/transceiver.png"); + parent.bindGuiTexture(); Point invRoot = container.getPlayerInventoryOffset(); parent.drawTexturedModalRect(left + invRoot.x - 1, top + invRoot.y - 1, 24, 180, 162, 76); diff --git a/src/main/java/crazypants/enderio/machine/transceiver/gui/GeneralTab.java b/src/main/java/crazypants/enderio/machine/transceiver/gui/GeneralTab.java index ee7a667a..c4a5b00d 100644 --- a/src/main/java/crazypants/enderio/machine/transceiver/gui/GeneralTab.java +++ b/src/main/java/crazypants/enderio/machine/transceiver/gui/GeneralTab.java @@ -82,7 +82,7 @@ public class GeneralTab implements ITabPanel { GL11.glColor3f(1, 1, 1); //Inventory - RenderUtil.bindTexture("enderio:textures/gui/transceiver.png"); + parent.bindGuiTexture(); Point invRoot = container.getPlayerInventoryOffset(); parent.drawTexturedModalRect(left + invRoot.x - 1, top + invRoot.y - 1, 24, 180, 162, 76); @@ -103,7 +103,7 @@ public class GeneralTab implements ITabPanel { parent.renderSlotHighlights(); //Power - RenderUtil.bindTexture("enderio:textures/gui/transceiver.png"); + parent.bindGuiTexture(); GL11.glColor3f(1, 1, 1); x = left + parent.getPowerX() - 1; diff --git a/src/main/java/crazypants/enderio/machine/transceiver/gui/GuiTransceiver.java b/src/main/java/crazypants/enderio/machine/transceiver/gui/GuiTransceiver.java index f601588a..c62fdbf8 100644 --- a/src/main/java/crazypants/enderio/machine/transceiver/gui/GuiTransceiver.java +++ b/src/main/java/crazypants/enderio/machine/transceiver/gui/GuiTransceiver.java @@ -32,7 +32,7 @@ public class GuiTransceiver extends GuiPoweredMachineBase { GeneralTab generalTab; public GuiTransceiver(InventoryPlayer par1InventoryPlayer, TileTransceiver te) { - super(te, new ContainerTransceiver(par1InventoryPlayer, te)); + super(te, new ContainerTransceiver(par1InventoryPlayer, te), "transceiver", "itemFilter"); generalTab = new GeneralTab(this); tabs.add(generalTab); @@ -211,7 +211,7 @@ public class GuiTransceiver extends GuiPoweredMachineBase { tes.draw(); - RenderUtil.bindTexture("enderio:textures/gui/transceiver.png"); + bindGuiTexture(); drawTexturedModalRect(sx, sy, 0, 0, xSize, ySize); super.drawGuiContainerBackgroundLayer(par1, par2, par3); diff --git a/src/main/java/crazypants/enderio/machine/vacuum/GuiVacuumChest.java b/src/main/java/crazypants/enderio/machine/vacuum/GuiVacuumChest.java index 54f84109..4566c5a8 100644 --- a/src/main/java/crazypants/enderio/machine/vacuum/GuiVacuumChest.java +++ b/src/main/java/crazypants/enderio/machine/vacuum/GuiVacuumChest.java @@ -11,7 +11,6 @@ import net.minecraft.item.ItemStack; import org.lwjgl.opengl.GL11; -import com.enderio.core.client.gui.GuiContainerBase; import com.enderio.core.client.gui.button.MultiIconButton; import com.enderio.core.client.gui.button.ToggleButton; import com.enderio.core.client.gui.widget.GhostSlot; @@ -23,12 +22,12 @@ import com.enderio.core.common.util.BlockCoord; import crazypants.enderio.EnderIO; import crazypants.enderio.conduit.item.filter.ItemFilter; +import crazypants.enderio.gui.GuiContainerBaseEIO; import crazypants.enderio.gui.IconEIO; import crazypants.enderio.gui.RedstoneModeButton; -import crazypants.enderio.machine.killera.ContainerKillerJoe; import crazypants.enderio.network.PacketHandler; -public class GuiVacuumChest extends GuiContainerBase { +public class GuiVacuumChest extends GuiContainerBaseEIO { private static final int RANGE_LEFT = 145; private static final int RANGE_TOP = 86; @@ -57,7 +56,7 @@ public class GuiVacuumChest extends GuiContainerBase { private final String headerInventory; public GuiVacuumChest(EntityPlayer player, InventoryPlayer inventory, TileVacuumChest te) { - super(new ContainerVacuumChest(player, inventory, te)); + super(new ContainerVacuumChest(player, inventory, te), "vacumChest"); this.te = te; ySize = 206; @@ -175,7 +174,7 @@ public class GuiVacuumChest extends GuiContainerBase { @Override protected void drawGuiContainerBackgroundLayer(float par1, int mouseX, int mouseY) { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - RenderUtil.bindTexture("enderio:textures/gui/vacumChest.png"); + bindGuiTexture(); int sx = (width - xSize) / 2; int sy = (height - ySize) / 2; drawTexturedModalRect(sx, sy, 0, 0, this.xSize, this.ySize); diff --git a/src/main/java/crazypants/enderio/machine/vat/GuiVat.java b/src/main/java/crazypants/enderio/machine/vat/GuiVat.java index b55ed668..35bb2997 100644 --- a/src/main/java/crazypants/enderio/machine/vat/GuiVat.java +++ b/src/main/java/crazypants/enderio/machine/vat/GuiVat.java @@ -25,12 +25,12 @@ import crazypants.enderio.network.PacketHandler; public class GuiVat extends GuiPoweredMachineBase { - private static final String GUI_TEXTURE = "enderio:textures/gui/vat.png"; + private static final String GUI_TEXTURE = "vat"; private final IconButton dump1, dump2; public GuiVat(InventoryPlayer inventory, TileVat te) { - super(te, new ContainerVat(inventory, te)); + super(te, new ContainerVat(inventory, te), GUI_TEXTURE); addToolTip(new GuiToolTip(new Rectangle(30, 12, 15, 47), "") { @@ -99,7 +99,7 @@ public class GuiVat extends GuiPoweredMachineBase { @Override protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - RenderUtil.bindTexture(GUI_TEXTURE); + bindGuiTexture(); drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize); TileVat vat = getTileEntity(); @@ -154,7 +154,7 @@ public class GuiVat extends GuiPoweredMachineBase { } } - RenderUtil.bindTexture(GUI_TEXTURE); + bindGuiTexture(); super.drawGuiContainerBackgroundLayer(par1, par2, par3); } @@ -174,7 +174,7 @@ public class GuiVat extends GuiPoweredMachineBase { GL11.glDisable(GL11.GL_BLEND); GL11.glColor4f(1, 1, 1, 1); - RenderUtil.bindTexture(GUI_TEXTURE); + bindGuiTexture(); drawTexturedModalRect(x, y, 0, 256 - 28, 26, 28); } diff --git a/src/main/java/crazypants/enderio/teleport/GuiTravelAccessable.java b/src/main/java/crazypants/enderio/teleport/GuiTravelAccessable.java index 2b1ea200..a7ad7013 100644 --- a/src/main/java/crazypants/enderio/teleport/GuiTravelAccessable.java +++ b/src/main/java/crazypants/enderio/teleport/GuiTravelAccessable.java @@ -10,7 +10,6 @@ import net.minecraft.world.World; import org.lwjgl.opengl.GL11; -import com.enderio.core.client.gui.GuiContainerBase; import com.enderio.core.client.gui.button.CheckBox; import com.enderio.core.client.gui.widget.TextFieldEnder; import com.enderio.core.client.render.ColorUtil; @@ -20,11 +19,12 @@ import com.enderio.core.common.util.BlockCoord; import crazypants.enderio.EnderIO; import crazypants.enderio.api.teleport.ITravelAccessable; import crazypants.enderio.api.teleport.ITravelAccessable.AccessMode; +import crazypants.enderio.gui.GuiContainerBaseEIO; import crazypants.enderio.network.PacketHandler; import crazypants.enderio.teleport.packet.PacketAccessMode; import crazypants.enderio.teleport.packet.PacketLabel; -public class GuiTravelAccessable extends GuiContainerBase { +public class GuiTravelAccessable extends GuiContainerBaseEIO { private static final int ID_PUBLIC = 0; private static final int ID_PRIVATE = 1; @@ -52,7 +52,7 @@ public class GuiTravelAccessable extends GuiContainerBase { } public GuiTravelAccessable(ContainerTravelAccessable container) { - super(container); + super(container, "travelAccessable"); this.te = container.ta; this.world = container.world; @@ -137,7 +137,7 @@ public class GuiTravelAccessable extends GuiContainerBase { @Override public void drawGuiContainerBackgroundLayer(float f, int i, int j) { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - RenderUtil.bindTexture("enderio:textures/gui/travelAccessable.png"); + bindGuiTexture(); int sx = (width - xSize) / 2; int sy = (height - ySize) / 2; @@ -196,7 +196,7 @@ public class GuiTravelAccessable extends GuiContainerBase { super.drawForegroundImpl(mouseX, mouseY); if(te.getAccessMode() != AccessMode.PROTECTED) { - RenderUtil.bindTexture("enderio:textures/gui/travelAccessable.png"); + bindGuiTexture(); GL11.glColor4f(1, 1, 1, 0.75f); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); diff --git a/src/main/java/crazypants/enderio/teleport/GuiTravelAuth.java b/src/main/java/crazypants/enderio/teleport/GuiTravelAuth.java index 27f21aec..04045d4f 100644 --- a/src/main/java/crazypants/enderio/teleport/GuiTravelAuth.java +++ b/src/main/java/crazypants/enderio/teleport/GuiTravelAuth.java @@ -10,16 +10,16 @@ import net.minecraft.world.World; import org.lwjgl.opengl.GL11; -import com.enderio.core.client.gui.GuiContainerBase; import com.enderio.core.client.render.ColorUtil; import com.enderio.core.client.render.RenderUtil; import com.enderio.core.common.network.MessageTileNBT; import crazypants.enderio.EnderIO; import crazypants.enderio.api.teleport.ITravelAccessable; +import crazypants.enderio.gui.GuiContainerBaseEIO; import crazypants.enderio.network.PacketHandler; -public class GuiTravelAuth extends GuiContainerBase { +public class GuiTravelAuth extends GuiContainerBaseEIO { private final String title; private final ITravelAccessable ta; @@ -28,7 +28,7 @@ public class GuiTravelAuth extends GuiContainerBase { private final EntityPlayer player; public GuiTravelAuth(EntityPlayer player, ITravelAccessable te, World world) { - super(new ContainerTravelAuth(player.inventory)); + super(new ContainerTravelAuth(player.inventory), "travelAuth"); this.ta = te; title = EnderIO.lang.localize("gui.travelAccessable.enterCode"); this.player = player; @@ -76,7 +76,7 @@ public class GuiTravelAuth extends GuiContainerBase { @Override public void drawGuiContainerBackgroundLayer(float f, int mx, int my) { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - RenderUtil.bindTexture("enderio:textures/gui/travelAuth.png"); + bindGuiTexture(); int sx = (width - xSize) / 2; int sy = (height - ySize) / 2; drawTexturedModalRect(sx, sy, 0, 0, this.xSize, this.ySize); diff --git a/src/main/java/crazypants/enderio/teleport/telepad/GuiTelePad.java b/src/main/java/crazypants/enderio/teleport/telepad/GuiTelePad.java index 0f63d3a9..770241a9 100644 --- a/src/main/java/crazypants/enderio/teleport/telepad/GuiTelePad.java +++ b/src/main/java/crazypants/enderio/teleport/telepad/GuiTelePad.java @@ -13,7 +13,6 @@ import net.minecraft.world.World; import org.lwjgl.opengl.GL11; -import com.enderio.core.client.gui.GuiContainerBase; import com.enderio.core.client.gui.widget.GuiToolTip; import com.enderio.core.client.gui.widget.TextFieldEnder; import com.enderio.core.client.render.RenderUtil; @@ -24,11 +23,12 @@ import com.google.common.collect.Lists; import crazypants.enderio.EnderIO; import crazypants.enderio.GuiHandler; import crazypants.enderio.config.Config; +import crazypants.enderio.gui.GuiContainerBaseEIO; import crazypants.enderio.gui.IconEIO; import crazypants.enderio.machine.power.PowerDisplayUtil; import crazypants.enderio.network.PacketHandler; -public class GuiTelePad extends GuiContainerBase implements IToggleableGui { +public class GuiTelePad extends GuiContainerBaseEIO implements IToggleableGui { private static final int ID_SWITCH_BUTTON = 95; private static final int ID_TELEPORT_BUTTON = 96; @@ -52,7 +52,7 @@ public class GuiTelePad extends GuiContainerBase implements IToggleableGui { public static int SWITCH_X = 155, SWITCH_Y = 5; public GuiTelePad(InventoryPlayer playerInv, TileTelePad te, World world) { - super(new ContainerTelePad(playerInv)); + super(new ContainerTelePad(playerInv), "telePad"); this.world = world; this.te = te; ySize += 34; @@ -161,7 +161,7 @@ public class GuiTelePad extends GuiContainerBase implements IToggleableGui { @Override protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - RenderUtil.bindTexture("enderio:textures/gui/telePad.png"); + bindGuiTexture(); int sx = (width - xSize) / 2; int sy = (height - ySize) / 2;