From 4790ab51e079b86935baedc7b95d21395856b807 Mon Sep 17 00:00:00 2001 From: AlgorithmX2 Date: Sun, 27 Jul 2014 12:31:25 -0500 Subject: [PATCH] Fixed Bug: #0737 - Searching and crafting --- container/implementations/ContainerCraftConfirm.java | 10 ++++++++++ core/sync/packets/PacketSwitchGuis.java | 9 ++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/container/implementations/ContainerCraftConfirm.java b/container/implementations/ContainerCraftConfirm.java index 596bbd58..b55e4de7 100644 --- a/container/implementations/ContainerCraftConfirm.java +++ b/container/implementations/ContainerCraftConfirm.java @@ -34,6 +34,7 @@ import appeng.core.AELog; import appeng.core.sync.GuiBridge; import appeng.core.sync.network.NetworkHandler; import appeng.core.sync.packets.PacketMEInventoryUpdate; +import appeng.core.sync.packets.PacketSwitchGuis; import appeng.helpers.WirelessTerminalGuiObject; import appeng.parts.reporting.PartCraftingTerminal; import appeng.parts.reporting.PartPatternTerminal; @@ -326,6 +327,15 @@ public class ContainerCraftConfirm extends AEBaseContainer autoStart = false; if ( g != null && OriginalGui != null && openContext != null ) { + try + { + NetworkHandler.instance.sendTo( new PacketSwitchGuis( OriginalGui ), (EntityPlayerMP) invPlayer.player ); + } + catch (IOException e) + { + // :( + } + TileEntity te = openContext.w.getTileEntity( openContext.x, openContext.y, openContext.z ); Platform.openGUI( invPlayer.player, te, openContext.side, OriginalGui ); } diff --git a/core/sync/packets/PacketSwitchGuis.java b/core/sync/packets/PacketSwitchGuis.java index fd4ee425..f9629074 100644 --- a/core/sync/packets/PacketSwitchGuis.java +++ b/core/sync/packets/PacketSwitchGuis.java @@ -42,12 +42,19 @@ public class PacketSwitchGuis extends AppEngPacket } } + @Override + public void clientPacketData(INetworkInfo network, AppEngPacket packet, EntityPlayer player) + { + AEBaseGui.switchingGuis = true; + } + // api public PacketSwitchGuis(GuiBridge newGui) throws IOException { this.newGui = newGui; - AEBaseGui.switchingGuis = true; + if ( Platform.isClient() ) + AEBaseGui.switchingGuis = true; ByteBuf data = Unpooled.buffer();