diff --git a/src/main/java/techreborn/client/gui/GuiBlastFurnace.java b/src/main/java/techreborn/client/gui/GuiBlastFurnace.java index c956f8580..0c1210b28 100644 --- a/src/main/java/techreborn/client/gui/GuiBlastFurnace.java +++ b/src/main/java/techreborn/client/gui/GuiBlastFurnace.java @@ -1,13 +1,19 @@ package techreborn.client.gui; +import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.resources.I18n; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.ChunkCoordinates; import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; import techreborn.client.GuiUtil; import techreborn.client.container.ContainerBlastFurnace; +import techreborn.client.multiblock.Multiblock; +import techreborn.client.multiblock.MultiblockSet; +import techreborn.init.ModBlocks; import techreborn.lib.ModInfo; +import techreborn.proxies.ClientProxy; import techreborn.tiles.TileBlastFurnace; @@ -31,6 +37,8 @@ public class GuiBlastFurnace 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 + 4, l + 6, 20, 20, ""); + buttonList.add(button); super.initGui(); } @@ -69,4 +77,60 @@ public class GuiBlastFurnace extends GuiContainer { } this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752); } + + @Override + public void actionPerformed(GuiButton button) { + 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. + Multiblock multiblock = new Multiblock(); + multiblock.addComponent(0, 0, 0, ModBlocks.MachineCasing, 0); + multiblock.addComponent(1, 0, 0, ModBlocks.MachineCasing, 0); + multiblock.addComponent(0, 0, 1, ModBlocks.MachineCasing, 0); + multiblock.addComponent(-1, 0, 0, ModBlocks.MachineCasing, 0); + multiblock.addComponent(0, 0, -1, ModBlocks.MachineCasing, 0); + multiblock.addComponent(-1, 0, -1, ModBlocks.MachineCasing, 0); + multiblock.addComponent(-1, 0, 1, ModBlocks.MachineCasing, 0); + multiblock.addComponent(1, 0, -1, ModBlocks.MachineCasing, 0); + multiblock.addComponent(1, 0, 1, ModBlocks.MachineCasing, 0); + + multiblock.addComponent(1, 1, 0, ModBlocks.MachineCasing, 0); + multiblock.addComponent(0, 1, 1, ModBlocks.MachineCasing, 0); + multiblock.addComponent(-1, 1, 0, ModBlocks.MachineCasing, 0); + multiblock.addComponent(0, 1, -1, ModBlocks.MachineCasing, 0); + multiblock.addComponent(-1, 1, -1, ModBlocks.MachineCasing, 0); + multiblock.addComponent(-1, 1, 1, ModBlocks.MachineCasing, 0); + multiblock.addComponent(1, 1, -1, ModBlocks.MachineCasing, 0); + multiblock.addComponent(1, 1, 1, ModBlocks.MachineCasing, 0); + + multiblock.addComponent(1, 2, 0, ModBlocks.MachineCasing, 0); + multiblock.addComponent(0, 2, 1, ModBlocks.MachineCasing, 0); + multiblock.addComponent(-1, 2, 0, ModBlocks.MachineCasing, 0); + multiblock.addComponent(0, 2, -1, ModBlocks.MachineCasing, 0); + multiblock.addComponent(-1, 2, -1, ModBlocks.MachineCasing, 0); + multiblock.addComponent(-1, 2, 1, ModBlocks.MachineCasing, 0); + multiblock.addComponent(1, 2, -1, ModBlocks.MachineCasing, 0); + multiblock.addComponent(1, 2, 1, ModBlocks.MachineCasing, 0); + + multiblock.addComponent(1, 3, 0, ModBlocks.MachineCasing, 0); + multiblock.addComponent(0, 3, 1, ModBlocks.MachineCasing, 0); + multiblock.addComponent(-1, 3, 0, ModBlocks.MachineCasing, 0); + multiblock.addComponent(0, 3, -1, ModBlocks.MachineCasing, 0); + multiblock.addComponent(-1, 3, -1, ModBlocks.MachineCasing, 0); + multiblock.addComponent(-1, 3, 1, ModBlocks.MachineCasing, 0); + multiblock.addComponent(1, 3, -1, ModBlocks.MachineCasing, 0); + multiblock.addComponent(1, 3, 1, ModBlocks.MachineCasing, 0); + + MultiblockSet set = new MultiblockSet(multiblock); + ClientProxy.multiblockRenderEvent.setMultiblock(set); + ClientProxy.multiblockRenderEvent.anchor = new ChunkCoordinates(blastfurnace.xCoord + 2, blastfurnace.yCoord - 1, blastfurnace.zCoord); + } + button.displayString = "A"; + } else { + ClientProxy.multiblockRenderEvent.setMultiblock(null); + button.displayString = "B"; + } + } + } } diff --git a/src/main/java/techreborn/pda/pages/BasePage.java b/src/main/java/techreborn/pda/pages/BasePage.java index dbd3bb993..cb52eb599 100644 --- a/src/main/java/techreborn/pda/pages/BasePage.java +++ b/src/main/java/techreborn/pda/pages/BasePage.java @@ -2,6 +2,8 @@ package techreborn.pda.pages; import java.awt.Button; +import org.lwjgl.opengl.GL11; + import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiScreen; @@ -80,7 +82,6 @@ public class BasePage extends GuiScreen { } public void renderOverlayComponents(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY){ - } public void drawScreen(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) { diff --git a/src/main/java/techreborn/pda/pages/ItemsPage.java b/src/main/java/techreborn/pda/pages/ItemsPage.java index eed484cd6..84e3c1fb5 100644 --- a/src/main/java/techreborn/pda/pages/ItemsPage.java +++ b/src/main/java/techreborn/pda/pages/ItemsPage.java @@ -2,6 +2,8 @@ package techreborn.pda.pages; import java.awt.Color; +import org.lwjgl.opengl.GL11; + import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.renderer.entity.RenderItem; diff --git a/src/main/java/techreborn/pda/pages/MultiBlockPage.java b/src/main/java/techreborn/pda/pages/MultiBlockPage.java index 59b9793b0..0b27e6155 100644 --- a/src/main/java/techreborn/pda/pages/MultiBlockPage.java +++ b/src/main/java/techreborn/pda/pages/MultiBlockPage.java @@ -43,6 +43,7 @@ public class MultiBlockPage extends TitledPage{ @Override public void renderOverlayComponents(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) { super.renderOverlayComponents(minecraft, offsetX, offsetY, mouseX, mouseY); + drawCenteredString(fontRendererObj, ttl("techreborn.pda.multiblock.decripion"), offsetX + 128, offsetY + 20, Color.white.getRGB()); } @Override