diff --git a/src/main/java/techreborn/client/gui/GuiAutoCrafting.java b/src/main/java/techreborn/client/gui/GuiAutoCrafting.java index 1ecc031b9..e74555fc8 100644 --- a/src/main/java/techreborn/client/gui/GuiAutoCrafting.java +++ b/src/main/java/techreborn/client/gui/GuiAutoCrafting.java @@ -110,7 +110,7 @@ public class GuiAutoCrafting extends GuiBase { @Override protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException { - if (isPointInRect(145 + getGuiLeft(), 4 + getGuiTop(), 20, 12, mouseX, mouseY)) { + if (isPointInRect(145, 4, 20, 12, mouseX, mouseY)) { NetworkManager.sendToServer(new PacketAutoCraftingTableLock(tileAutoCraftingTable, !tileAutoCraftingTable.locked)); return; } diff --git a/src/main/java/techreborn/client/gui/GuiBlastFurnace.java b/src/main/java/techreborn/client/gui/GuiBlastFurnace.java index 42c352cbd..79e66b506 100644 --- a/src/main/java/techreborn/client/gui/GuiBlastFurnace.java +++ b/src/main/java/techreborn/client/gui/GuiBlastFurnace.java @@ -74,6 +74,9 @@ public class GuiBlastFurnace extends GuiBase { drawOutputSlotBar(92, 36, 2, layer); builder.drawJEIButton(this, 158, 5, layer); + if (hasMultiBlock) { + builder.drawHologramButton(this, 6, 4, mouseX, mouseY, layer); + } } @Override @@ -86,8 +89,7 @@ public class GuiBlastFurnace extends GuiBase { builder.drawBigHeatBar(this, 31, 71, tile.getCachedHeat(), 3230, layer); if (hasMultiBlock) { - addHologramButton(6, 4, 212, layer); - builder.drawHologramButton(this, 6, 4, mouseX, mouseY, layer); + addHologramButton(4, 4, 212, layer); } else { builder.drawMultiblockMissingBar(this, layer); addHologramButton(76, 56, 212, layer); @@ -96,16 +98,6 @@ public class GuiBlastFurnace extends GuiBase { builder.drawMultiEnergyBar(this, 9, 19, (int) tile.getEnergy(), (int) tile.getMaxPower(), mouseX, mouseY, 0, layer); } - public void addHologramButton(int x, int y, int id, Layer layer) { - int factorX = 0; - int factorY = 0; - if (layer == Layer.BACKGROUND) { - factorX = guiLeft; - factorY = guiTop; - } - buttonList.add(new GuiButtonHologram(id, x + factorX, y + factorY, this, layer)); - } - @Override public void actionPerformed(final GuiButton button) throws IOException { super.actionPerformed(button); diff --git a/src/main/java/techreborn/client/gui/GuiDistillationTower.java b/src/main/java/techreborn/client/gui/GuiDistillationTower.java index 81a975bd1..4049bea09 100644 --- a/src/main/java/techreborn/client/gui/GuiDistillationTower.java +++ b/src/main/java/techreborn/client/gui/GuiDistillationTower.java @@ -37,7 +37,6 @@ import reborncore.client.multiblock.Multiblock; import reborncore.client.multiblock.MultiblockRenderEvent; import reborncore.client.multiblock.MultiblockSet; import techreborn.blocks.BlockMachineCasing; -import reborncore.client.gui.builder.widget.GuiButtonHologram; import techreborn.init.TRContent; import techreborn.tiles.machine.multiblock.TileDistillationTower; @@ -81,7 +80,6 @@ public class GuiDistillationTower extends GuiBase { final GuiBase.Layer layer = Layer.FOREGROUND; builder.drawProgressBar(this, tile.getProgressScaled(100), 100, 55, 40, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer); - builder.drawMultiEnergyBar(this, 9, 19, (int) tile.getEnergy(), (int) tile.getMaxPower(), mouseX, mouseY, 0, layer); if (tile.getMutliBlock()) { addHologramButton(6, 4, 212, layer); builder.drawHologramButton(this, 6, 4, mouseX, mouseY, layer); @@ -90,18 +88,10 @@ public class GuiDistillationTower extends GuiBase { addHologramButton(76, 56, 212, layer); builder.drawHologramButton(this, 76, 56, mouseX, mouseY, layer); } + builder.drawMultiEnergyBar(this, 9, 19, (int) tile.getEnergy(), (int) tile.getMaxPower(), mouseX, mouseY, 0, layer); + } - - public void addHologramButton(int x, int y, int id, Layer layer) { - int factorX = 0; - int factorY = 0; - if (layer == Layer.BACKGROUND) { - factorX = guiLeft; - factorY = guiTop; - } - buttonList.add(new GuiButtonHologram(id, x + factorX, y + factorY, this, layer)); - } - + @Override public void actionPerformed(final GuiButton button) throws IOException { super.actionPerformed(button); diff --git a/src/main/java/techreborn/client/gui/GuiFluidReplicator.java b/src/main/java/techreborn/client/gui/GuiFluidReplicator.java index 3f97a4545..eeedd8a13 100644 --- a/src/main/java/techreborn/client/gui/GuiFluidReplicator.java +++ b/src/main/java/techreborn/client/gui/GuiFluidReplicator.java @@ -38,6 +38,7 @@ import reborncore.client.multiblock.MultiblockSet; import techreborn.init.TRContent; import techreborn.tiles.machine.multiblock.TileFluidReplicator; import reborncore.client.gui.builder.widget.GuiButtonHologram; +import techreborn.blocks.BlockMachineCasing; import java.io.IOException; @@ -54,16 +55,6 @@ public class GuiFluidReplicator extends GuiBase { this.tile = tile; } - public void addHologramButton(int x, int y, int id, Layer layer) { - int factorX = 0; - int factorY = 0; - if (layer == Layer.BACKGROUND) { - factorX = guiLeft; - factorY = guiTop; - } - buttonList.add(new GuiButtonHologram(id, x + factorX, y + factorY, this, layer)); - } - public void addComponent(final int x, final int y, final int z, final IBlockState blockState, final Multiblock multiblock) { multiblock.addComponent(new BlockPos(x, y, z), blockState); } @@ -89,6 +80,9 @@ public class GuiFluidReplicator extends GuiBase { drawSlot(124, 55, layer); // JEI button builder.drawJEIButton(this, 158, 5, layer); + if (tile.getMultiBlock()) { + builder.drawHologramButton(this, 6, 4, mouseX, mouseY, layer); + } } @Override @@ -98,15 +92,14 @@ public class GuiFluidReplicator extends GuiBase { builder.drawTank(this, 99, 25, mouseX, mouseY, tile.tank.getFluid(), tile.tank.getCapacity(), tile.tank.isEmpty(), layer); builder.drawProgressBar(this, tile.getProgressScaled(100), 100, 76, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer); - builder.drawMultiEnergyBar(this, 9, 19, (int) tile.getEnergy(), (int) tile.getMaxPower(), mouseX, mouseY, 0, layer); if (tile.getMultiBlock()) { addHologramButton(6, 4, 212, layer); - builder.drawHologramButton(this, 6, 4, mouseX, mouseY, layer); } else { builder.drawMultiblockMissingBar(this, layer); addHologramButton(76, 56, 212, layer); builder.drawHologramButton(this, 76, 56, mouseX, mouseY, layer); } + builder.drawMultiEnergyBar(this, 9, 19, (int) tile.getEnergy(), (int) tile.getMaxPower(), mouseX, mouseY, 0, layer); } // GuiScreen diff --git a/src/main/java/techreborn/client/gui/GuiFusionReactor.java b/src/main/java/techreborn/client/gui/GuiFusionReactor.java index e80fa1b77..40d550a7b 100644 --- a/src/main/java/techreborn/client/gui/GuiFusionReactor.java +++ b/src/main/java/techreborn/client/gui/GuiFusionReactor.java @@ -38,7 +38,6 @@ import reborncore.client.multiblock.MultiblockSet; import reborncore.common.network.NetworkManager; import reborncore.common.powerSystem.PowerSystem; import reborncore.common.util.Torus; -import reborncore.client.gui.builder.widget.GuiButtonHologram; import reborncore.client.gui.builder.widget.GuiButtonUpDown; import techreborn.init.TRContent; import techreborn.packets.PacketFusionControlSize; @@ -67,6 +66,9 @@ public class GuiFusionReactor extends GuiBase { drawOutputSlot(80, 47, layer); builder.drawJEIButton(this, 158, 5, layer); + if (tile.getCoilStatus() > 0) { + builder.drawHologramButton(this, 6, 4, mouseX, mouseY, layer); + } } @@ -79,7 +81,6 @@ public class GuiFusionReactor extends GuiBase { builder.drawProgressBar(this, tile.getProgressScaled(100), 100, 105, 51, mouseX, mouseY, GuiBuilder.ProgressDirection.LEFT, layer); if (tile.getCoilStatus() > 0) { addHologramButton(6, 4, 212, layer); - builder.drawHologramButton(this, 6, 4, mouseX, mouseY, layer); drawCentredString(tile.getStateString(), 20, Color.BLUE.darker().getRGB(), layer); if(tile.state == 2){ drawCentredString( PowerSystem.getLocaliszedPowerFormatted((int) tile.getPowerChange()) + "/t", 30, Color.GREEN.darker().getRGB(), layer); @@ -110,17 +111,7 @@ public class GuiFusionReactor extends GuiBase { builder.drawMultiEnergyBar(this, 9, 19, (int) this.tile.getEnergy(), (int) this.tile.getMaxPower(), mouseX, mouseY, 0, layer); } - - public void addHologramButton(int x, int y, int id, Layer layer) { - int factorX = 0; - int factorY = 0; - if (layer == Layer.BACKGROUND) { - factorX = guiLeft; - factorY = guiTop; - } - buttonList.add(new GuiButtonHologram(id, x + factorX, y + factorY, this, layer)); - } - + @Override public void actionPerformed(final GuiButton button) throws IOException { super.actionPerformed(button); diff --git a/src/main/java/techreborn/client/gui/GuiImplosionCompressor.java b/src/main/java/techreborn/client/gui/GuiImplosionCompressor.java index 97272d0d7..4bfea2e86 100644 --- a/src/main/java/techreborn/client/gui/GuiImplosionCompressor.java +++ b/src/main/java/techreborn/client/gui/GuiImplosionCompressor.java @@ -84,7 +84,6 @@ public class GuiImplosionCompressor extends GuiBase { final GuiBase.Layer layer = Layer.FOREGROUND; builder.drawProgressBar(this, tile.getProgressScaled(100), 100, 71, 40, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer); - builder.drawMultiEnergyBar(this, 9, 19, (int) tile.getEnergy(), (int) tile.getMaxPower(), mouseX, mouseY, 0, layer); if (tile.getMutliBlock()) { addHologramButton(6, 4, 212, layer); } else { @@ -92,16 +91,8 @@ public class GuiImplosionCompressor extends GuiBase { addHologramButton(76, 56, 212, layer); builder.drawHologramButton(this, 76, 56, mouseX, mouseY, layer); } - } + builder.drawMultiEnergyBar(this, 9, 19, (int) tile.getEnergy(), (int) tile.getMaxPower(), mouseX, mouseY, 0, layer); - public void addHologramButton(int x, int y, int id, Layer layer) { - int factorX = 0; - int factorY = 0; - if (layer == Layer.BACKGROUND) { - factorX = guiLeft; - factorY = guiTop; - } - buttonList.add(new GuiButtonHologram(id, x + factorX, y + factorY, this, layer)); } @Override diff --git a/src/main/java/techreborn/client/gui/GuiIndustrialGrinder.java b/src/main/java/techreborn/client/gui/GuiIndustrialGrinder.java index 1a41f0b66..30fd79a38 100644 --- a/src/main/java/techreborn/client/gui/GuiIndustrialGrinder.java +++ b/src/main/java/techreborn/client/gui/GuiIndustrialGrinder.java @@ -78,6 +78,9 @@ public class GuiIndustrialGrinder extends GuiBase { drawSlot(126, 72, layer); builder.drawJEIButton(this, 158, 5, layer); + if (tile.getMultiBlock()) { + builder.drawHologramButton(this, 6, 4, mouseX, mouseY, layer); + } } @Override @@ -87,25 +90,14 @@ public class GuiIndustrialGrinder extends GuiBase { builder.drawProgressBar(this, tile.getProgressScaled(100), 100, 105, 47, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer); builder.drawTank(this, 53, 25, mouseX, mouseY, tile.tank.getFluid(), tile.tank.getCapacity(), tile.tank.isEmpty(), layer); - builder.drawMultiEnergyBar(this, 9, 19, (int) tile.getEnergy(), (int) tile.getMaxPower(), mouseX, mouseY, 0, layer); - if (tile.getMutliBlock()) { + if (tile.getMultiBlock()) { addHologramButton(6, 4, 212, layer); - builder.drawHologramButton(this, 6, 4, mouseX, mouseY, layer); } else { builder.drawMultiblockMissingBar(this, layer); addHologramButton(76, 56, 212, layer); builder.drawHologramButton(this, 76, 56, mouseX, mouseY, layer); } - } - - public void addHologramButton(int x, int y, int id, Layer layer) { - int factorX = 0; - int factorY = 0; - if (layer == Layer.BACKGROUND) { - factorX = guiLeft; - factorY = guiTop; - } - buttonList.add(new GuiButtonHologram(id, x + factorX, y + factorY, this, layer)); + builder.drawMultiEnergyBar(this, 9, 19, (int) tile.getEnergy(), (int) tile.getMaxPower(), mouseX, mouseY, 0, layer); } @Override diff --git a/src/main/java/techreborn/client/gui/GuiIndustrialSawmill.java b/src/main/java/techreborn/client/gui/GuiIndustrialSawmill.java index 3e01b55c9..ee7a53279 100644 --- a/src/main/java/techreborn/client/gui/GuiIndustrialSawmill.java +++ b/src/main/java/techreborn/client/gui/GuiIndustrialSawmill.java @@ -37,7 +37,6 @@ import reborncore.client.multiblock.Multiblock; import reborncore.client.multiblock.MultiblockRenderEvent; import reborncore.client.multiblock.MultiblockSet; import techreborn.blocks.BlockMachineCasing; -import reborncore.client.gui.builder.widget.GuiButtonHologram; import techreborn.init.TRContent; import techreborn.tiles.machine.multiblock.TileIndustrialSawmill; @@ -77,6 +76,9 @@ public class GuiIndustrialSawmill extends GuiBase { drawSlot(126, 61, layer); builder.drawJEIButton(this, 158, 5, layer); + if (tile.getMutliBlock()) { + builder.drawHologramButton(this, 6, 4, mouseX, mouseY, layer); + } } @Override @@ -86,25 +88,14 @@ public class GuiIndustrialSawmill extends GuiBase { builder.drawProgressBar(this, tile.getProgressScaled(100), 100, 105, 47, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer); builder.drawTank(this, 53, 25, mouseX, mouseY, tile.tank.getFluid(), tile.tank.getCapacity(), tile.tank.isEmpty(), layer); - builder.drawMultiEnergyBar(this, 9, 19, (int) tile.getEnergy(), (int) tile.getMaxPower(), mouseX, mouseY, 0, layer); if (tile.getMutliBlock()) { addHologramButton(6, 4, 212, layer); - builder.drawHologramButton(this, 6, 4, mouseX, mouseY, layer); } else { builder.drawMultiblockMissingBar(this, layer); addHologramButton(76, 56, 212, layer); builder.drawHologramButton(this, 76, 56, mouseX, mouseY, layer); } - } - - public void addHologramButton(int x, int y, int id, Layer layer) { - int factorX = 0; - int factorY = 0; - if (layer == Layer.BACKGROUND) { - factorX = guiLeft; - factorY = guiTop; - } - buttonList.add(new GuiButtonHologram(id, x + factorX, y + factorY, this, layer)); + builder.drawMultiEnergyBar(this, 9, 19, (int) tile.getEnergy(), (int) tile.getMaxPower(), mouseX, mouseY, 0, layer); } @Override diff --git a/src/main/java/techreborn/client/gui/GuiRollingMachine.java b/src/main/java/techreborn/client/gui/GuiRollingMachine.java index 0f361ba1e..b6cd49939 100644 --- a/src/main/java/techreborn/client/gui/GuiRollingMachine.java +++ b/src/main/java/techreborn/client/gui/GuiRollingMachine.java @@ -76,7 +76,7 @@ public class GuiRollingMachine extends GuiBase { @Override protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException { - if(isPointInRect(130 + getGuiLeft(), 4 + getGuiTop(), 20, 12, mouseX, mouseY)){ + if(isPointInRect(130, 4, 20, 12, mouseX, mouseY)){ NetworkManager.sendToServer(new PacketRollingMachineLock(rollingMachine, !rollingMachine.locked)); return; } diff --git a/src/main/java/techreborn/client/gui/GuiVacuumFreezer.java b/src/main/java/techreborn/client/gui/GuiVacuumFreezer.java index 3f0b114aa..4cafe8921 100644 --- a/src/main/java/techreborn/client/gui/GuiVacuumFreezer.java +++ b/src/main/java/techreborn/client/gui/GuiVacuumFreezer.java @@ -35,7 +35,6 @@ import reborncore.client.multiblock.Multiblock; import reborncore.client.multiblock.MultiblockRenderEvent; import reborncore.client.multiblock.MultiblockSet; import techreborn.blocks.BlockMachineCasing; -import reborncore.client.gui.builder.widget.GuiButtonHologram; import techreborn.init.TRContent; import techreborn.tiles.machine.multiblock.TileVacuumFreezer; @@ -70,6 +69,9 @@ public class GuiVacuumFreezer extends GuiBase { drawOutputSlot(101, 45, layer); builder.drawJEIButton(this, 158, 5, layer); + if (tile.getMultiBlock()) { + builder.drawHologramButton(this, 6, 4, mouseX, mouseY, layer); + } } @Override @@ -78,27 +80,16 @@ public class GuiVacuumFreezer extends GuiBase { final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND; builder.drawProgressBar(this, tile.getProgressScaled(100), 100, 76, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer); - builder.drawMultiEnergyBar(this, 9, 19, (int) tile.getEnergy(), (int) tile.getMaxPower(), mouseX, mouseY, 0, layer); if (tile.getMultiBlock()) { addHologramButton(6, 4, 212, layer); - builder.drawHologramButton(this, 6, 4, mouseX, mouseY, layer); } else { builder.drawMultiblockMissingBar(this, layer); addHologramButton(76, 56, 212, layer); builder.drawHologramButton(this, 76, 56, mouseX, mouseY, layer); } + builder.drawMultiEnergyBar(this, 9, 19, (int) tile.getEnergy(), (int) tile.getMaxPower(), mouseX, mouseY, 0, layer); } - public void addHologramButton(int x, int y, int id, Layer layer) { - int factorX = 0; - int factorY = 0; - if (layer == Layer.BACKGROUND) { - factorX = guiLeft; - factorY = guiTop; - } - buttonList.add(new GuiButtonHologram(id, x + factorX, y + factorY, this, layer)); - } - @Override public void actionPerformed(final GuiButton button) throws IOException { super.actionPerformed(button); diff --git a/src/main/java/techreborn/tiles/machine/multiblock/TileIndustrialGrinder.java b/src/main/java/techreborn/tiles/machine/multiblock/TileIndustrialGrinder.java index 37e7c65d7..456c999e3 100644 --- a/src/main/java/techreborn/tiles/machine/multiblock/TileIndustrialGrinder.java +++ b/src/main/java/techreborn/tiles/machine/multiblock/TileIndustrialGrinder.java @@ -76,7 +76,7 @@ public class TileIndustrialGrinder extends TileGenericMachine implements IContai this.ticksSinceLastChange = 0; } - public boolean getMutliBlock() { + public boolean getMultiBlock() { if (multiblockChecker == null) { return false; } @@ -117,7 +117,7 @@ public class TileIndustrialGrinder extends TileGenericMachine implements IContai ticksSinceLastChange = 0; } - if (!world.isRemote && getMutliBlock()) { + if (!world.isRemote && getMultiBlock()) { super.update(); } @@ -157,7 +157,7 @@ public class TileIndustrialGrinder extends TileGenericMachine implements IContai // ITileRecipeHandler @Override public boolean canCraft(final TileEntity tile, final IndustrialGrinderRecipe recipe) { - if (!getMutliBlock()) { + if (!getMultiBlock()) { return false; } final FluidStack recipeFluid = recipe.fluidStack;