From c0a6800447fdb87e266acfb47f35b5f765c74fe3 Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Thu, 2 Dec 2021 16:53:40 +0100 Subject: add select circuit gui for machine and circuits itself (#773) also fixed some issue with basic machine gui introduced in 9d42b299def1c41bbc7a1f01efe445be28f54399 also retrofitted volumetric flask to use the new INetworkUpdatableItem and GT_Packet_UpdateItem, deprecating MessageSetFlaskCapacity in the meanwhile. To open the gui for machine, shift-left-click the circuit slot To open the gui for circuit, click any block (need to be sneaking if it's chest, furnace, etc) with the circuit held in hand. Signed-off-by: Glease <4586901+Glease@users.noreply.github.com> Co-authored-by: Glease <4586901+Glease@users.noreply.github.com> --- .../java/gregtech/common/gui/GT_GUIContainerVolumetricFlask.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/main/java/gregtech/common/gui') diff --git a/src/main/java/gregtech/common/gui/GT_GUIContainerVolumetricFlask.java b/src/main/java/gregtech/common/gui/GT_GUIContainerVolumetricFlask.java index 6d346fc445..85fe2171b0 100644 --- a/src/main/java/gregtech/common/gui/GT_GUIContainerVolumetricFlask.java +++ b/src/main/java/gregtech/common/gui/GT_GUIContainerVolumetricFlask.java @@ -4,6 +4,7 @@ package gregtech.common.gui; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.GT_Values; +import gregtech.api.net.GT_Packet_UpdateItem; import gregtech.common.items.GT_VolumetricFlask; import gregtech.common.net.MessageSetFlaskCapacity; import net.minecraft.client.Minecraft; @@ -11,6 +12,7 @@ import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiTextField; import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL11; @@ -119,7 +121,9 @@ public final class GT_GUIContainerVolumetricFlask extends GuiContainer { protected void actionPerformed(GuiButton btn) { try { if (btn == apply) { - GT_Values.NW.sendToServer(new MessageSetFlaskCapacity(Integer.parseInt(amount.getText()), Minecraft.getMinecraft().thePlayer)); + NBTTagCompound tag = new NBTTagCompound(); + tag.setInteger("cap", Integer.parseInt(amount.getText())); + GT_Values.NW.sendToServer(new GT_Packet_UpdateItem(tag)); mc.thePlayer.closeScreen(); } -- cgit