Fix a small modloader compatibility derp: closes #222

This commit is contained in:
Christian 2013-04-20 22:55:56 -04:00
parent e204d580a8
commit 6c0bb61425
2 changed files with 12 additions and 3 deletions

View file

@ -528,4 +528,15 @@ public class FMLClientHandler implements IFMLSidedHandler
// Show error screen // Show error screen
warnIDMismatch(s, false); 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<? extends GuiScreen> gui)
{
return client.field_71462_r != null && client.field_71462_r.getClass().equals(gui);
}
} }

View file

@ -541,7 +541,7 @@ public class ModLoader
@SideOnly(CLIENT) @SideOnly(CLIENT)
public static boolean isGUIOpen(Class<? extends GuiScreen> gui) public static boolean isGUIOpen(Class<? extends GuiScreen> 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 @Deprecated
public static void serverChat(String text) public static void serverChat(String text)
{ {
//TODO
} }
@Deprecated @Deprecated
@SideOnly(CLIENT) @SideOnly(CLIENT)
public static void serverLogin(NetClientHandler handler, Packet1Login loginPacket) public static void serverLogin(NetClientHandler handler, Packet1Login loginPacket)
{ {
//TODO
} }
public static void serverSendPacket(NetServerHandler handler, Packet packet) public static void serverSendPacket(NetServerHandler handler, Packet packet)