From 6c0bb614258a88940ed486c77eaca70b2d6487b7 Mon Sep 17 00:00:00 2001 From: Christian Date: Sat, 20 Apr 2013 22:55:56 -0400 Subject: [PATCH] Fix a small modloader compatibility derp: closes #222 --- fml/client/cpw/mods/fml/client/FMLClientHandler.java | 11 +++++++++++ fml/client/net/minecraft/src/ModLoader.java | 4 +--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/fml/client/cpw/mods/fml/client/FMLClientHandler.java b/fml/client/cpw/mods/fml/client/FMLClientHandler.java index ba09dd3ad..5b08c1d5a 100644 --- a/fml/client/cpw/mods/fml/client/FMLClientHandler.java +++ b/fml/client/cpw/mods/fml/client/FMLClientHandler.java @@ -528,4 +528,15 @@ public class FMLClientHandler implements IFMLSidedHandler // Show error screen warnIDMismatch(s, false); } + + /** + * Is this GUI type open? + * + * @param gui The type of GUI to test for + * @return if a GUI of this type is open + */ + public boolean isGUIOpen(Class gui) + { + return client.field_71462_r != null && client.field_71462_r.getClass().equals(gui); + } } diff --git a/fml/client/net/minecraft/src/ModLoader.java b/fml/client/net/minecraft/src/ModLoader.java index 4bfced18c..4a0fb57d3 100644 --- a/fml/client/net/minecraft/src/ModLoader.java +++ b/fml/client/net/minecraft/src/ModLoader.java @@ -541,7 +541,7 @@ public class ModLoader @SideOnly(CLIENT) public static boolean isGUIOpen(Class gui) { - return FMLClientHandler.instance().getClient().field_71462_r != null && FMLClientHandler.instance().getClient().field_71462_r.equals(gui); + return FMLClientHandler.instance().isGUIOpen(gui); } /** @@ -810,14 +810,12 @@ public class ModLoader @Deprecated public static void serverChat(String text) { - //TODO } @Deprecated @SideOnly(CLIENT) public static void serverLogin(NetClientHandler handler, Packet1Login loginPacket) { - //TODO } public static void serverSendPacket(NetServerHandler handler, Packet packet)