diff --git a/src/main/java/techreborn/client/gui/GuiBlastFurnace.java b/src/main/java/techreborn/client/gui/GuiBlastFurnace.java index 7cd71f073..4e07574a4 100644 --- a/src/main/java/techreborn/client/gui/GuiBlastFurnace.java +++ b/src/main/java/techreborn/client/gui/GuiBlastFurnace.java @@ -69,7 +69,7 @@ public class GuiBlastFurnace extends GuiContainer { int l = (this.height - this.ySize) / 2; this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); - if (hasMultiBlock) { + if (containerBlastFurnace.heat == 0) { GuiUtil.drawTooltipBox(k + 30, l + 50 + 12 - 0, 114, 10); this.fontRendererObj.drawString(I18n.translateToLocal("techreborn.message.missingmultiblock"), k + 38, l + 52 + 12 - 0, -1); @@ -147,10 +147,6 @@ public class GuiBlastFurnace extends GuiContainer { addComponent(1, 3, -1, ModBlocks.machineCasing.getDefaultState(), multiblock); addComponent(1, 3, 1, ModBlocks.machineCasing.getDefaultState(), multiblock); - addComponent(1, 4, 0, ModBlocks.LESUStorage.getDefaultState(), multiblock); - addComponent(1, 4, 1, ModBlocks.LESU.getDefaultState(), multiblock); - addComponent(1, 4, 2, ModBlocks.alloyFurnace.getDefaultState(), multiblock); - MultiblockSet set = new MultiblockSet(multiblock); ClientProxy.multiblockRenderEvent.setMultiblock(set); ClientProxy.multiblockRenderEvent.parent = new Location(blastfurnace.getPos().getX(), diff --git a/src/main/java/techreborn/client/gui/GuiFusionReactor.java b/src/main/java/techreborn/client/gui/GuiFusionReactor.java index ca5b63fba..5f98dc4c0 100644 --- a/src/main/java/techreborn/client/gui/GuiFusionReactor.java +++ b/src/main/java/techreborn/client/gui/GuiFusionReactor.java @@ -4,10 +4,17 @@ import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.EnumFacing; import net.minecraft.util.ResourceLocation; +import net.minecraft.util.math.BlockPos; import net.minecraft.util.text.translation.I18n; +import reborncore.client.multiblock.MultiblockSet; +import reborncore.common.misc.Location; +import reborncore.common.multiblock.CoordTriplet; import reborncore.common.powerSystem.PowerSystem; +import techreborn.client.ClientMultiBlocks; import techreborn.client.container.ContainerFusionReactor; +import techreborn.proxies.ClientProxy; import techreborn.tiles.fusionReactor.TileEntityFusionController; import java.io.IOException; @@ -46,23 +53,23 @@ public class GuiFusionReactor extends GuiContainer { public void initGui() { int k = (this.width - this.xSize) / 2; int l = (this.height - this.ySize) / 2; - // GuiButton button = new GuiButton(212, k + this.xSize - 24, l + 4, 20, - // 20, ""); - // buttonList.add(button); + GuiButton button = new GuiButton(212, k + this.xSize - 24, l + 4, 20, + 20, ""); + buttonList.add(button); super.initGui(); - // CoordTriplet coordinates = new - // CoordTriplet(fusionController.getPos().getX() - - // (EnumFacing.getFront(fusionController.getFacingInt()).getFrontOffsetX() - // * 2), fusionController.getPos().getY() - 1, - // fusionController.getPos().getZ() - - // (EnumFacing.getFront(fusionController.getFacingInt()).getFrontOffsetZ() - // * 2)); - // if(coordinates.equals(ClientProxy.multiblockRenderEvent.anchor)){ - // ClientProxy.multiblockRenderEvent.setMultiblock(null); - // button.displayString = "B"; - // } else { - // button.displayString = "A"; - // } + BlockPos coordinates = new + BlockPos(fusionController.getPos().getX() - + (EnumFacing.getFront(fusionController.getFacingInt()).getFrontOffsetX() + * 2), fusionController.getPos().getY() - 1, + fusionController.getPos().getZ() - + (EnumFacing.getFront(fusionController.getFacingInt()).getFrontOffsetZ() + * 2)); + if (coordinates.equals(ClientProxy.multiblockRenderEvent.anchor)) { + ClientProxy.multiblockRenderEvent.setMultiblock(null); + button.displayString = "B"; + } else { + button.displayString = "A"; + } } @Override @@ -89,26 +96,25 @@ public class GuiFusionReactor extends GuiContainer { @Override public void actionPerformed(GuiButton button) throws IOException { super.actionPerformed(button); - // if(button.id == 212){ - // if(ClientProxy.multiblockRenderEvent.currentMultiblock == null){ - // {//This code here makes a basic multiblock and then sets to the - // selected one. - // MultiblockSet set = new MultiblockSet(ClientMultiBlocks.reactor); - // ClientProxy.multiblockRenderEvent.setMultiblock(set); - // ClientProxy.multiblockRenderEvent.partent = new - // Location(fusionController.getPos().getX(), - // fusionController.getPos().getY(), fusionController.getPos().getZ(), - // fusionController.getWorld()); - // ClientProxy.multiblockRenderEvent.anchor = new - // CoordTriplet(fusionController.getPos().getX() , - // fusionController.getPos().getY() -1 , - // fusionController.getPos().getZ()); - // } - // button.displayString = "A"; - // } else { - // ClientProxy.multiblockRenderEvent.setMultiblock(null); - // button.displayString = "B"; - // } - // } + if (button.id == 212) { + if (ClientProxy.multiblockRenderEvent.currentMultiblock == null) { + //This code here makes a basic multiblock and then sets to theselected one. + MultiblockSet set = new MultiblockSet(ClientMultiBlocks.reactor); + ClientProxy.multiblockRenderEvent.setMultiblock(set); + ClientProxy.multiblockRenderEvent.parent = new + Location(fusionController.getPos().getX(), + fusionController.getPos().getY(), fusionController.getPos().getZ(), + fusionController.getWorld()); + ClientProxy.multiblockRenderEvent.anchor = new + BlockPos(fusionController.getPos().getX(), + fusionController.getPos().getY() - 1, + fusionController.getPos().getZ()); + + button.displayString = "A"; + } else { + ClientProxy.multiblockRenderEvent.setMultiblock(null); + button.displayString = "B"; + } + } } } diff --git a/src/main/java/techreborn/proxies/ClientProxy.java b/src/main/java/techreborn/proxies/ClientProxy.java index 297f18e23..fbd232613 100644 --- a/src/main/java/techreborn/proxies/ClientProxy.java +++ b/src/main/java/techreborn/proxies/ClientProxy.java @@ -114,7 +114,7 @@ public class ClientProxy extends CommonProxy { //MinecraftForge.EVENT_BUS.register(new VersionCheckerClient()); MinecraftForge.EVENT_BUS.register(new StackToolTipEvent()); multiblockRenderEvent = new MultiblockRenderEvent(); - // MinecraftForge.EVENT_BUS.register(multiblockRenderEvent); + MinecraftForge.EVENT_BUS.register(multiblockRenderEvent); // TODO FIX ME ClientRegistry.registerKeyBinding(KeyBindings.config); ClientMultiBlocks.init();