Some compatibility fixes for Rei's minimap, and tidy up a couple of things

This commit is contained in:
Christian committed 2012-08-16 13:55:42 -04:00
1 parent 400de1d66e
commit af06c97efd
6 files changed
+26 -10

No files matched your search

+13 -1
View File
@@ -34,10 +34,12 @@ public abstract class BaseMod implements cpw.mods.fml.common.modloader.BaseModPr
{
// CALLBACK MECHANISMS
private boolean fml_lastWorld = false;
public final boolean doTickInGame(TickType tick, boolean tickEnd, Object... data)
{
Minecraft mc = FMLClientHandler.instance().getClient();
boolean hasWorld = true;
boolean hasWorld = mc.field_71441_e != null;
// World and render ticks
if (tickEnd && ( tick==TickType.RENDER || tick==TickType.CLIENT ) && hasWorld) {
return onTickInGame((Float) data[0], mc);
@@ -48,6 +50,16 @@ public abstract class BaseMod implements cpw.mods.fml.common.modloader.BaseModPr
public final boolean doTickInGUI(TickType tick, boolean tickEnd, Object... data)
{
Minecraft mc = FMLClientHandler.instance().getClient();
boolean hasWorld = mc.field_71441_e != null;
if (!hasWorld && !fml_lastWorld)
{
fml_lastWorld = true;
}
else if (!hasWorld && fml_lastWorld)
{
return true;
}
if (tickEnd && ( tick==TickType.RENDER || tick==TickType.CLIENT)) {
return onTickInGUI((Float) data[0], mc, mc.field_71462_r);
}