Tweak ticking YET AGAIN. Should fire a solitary GUILOAD tick right as the game screen loads.

Hopefully fixes worldload tick issue too
This commit is contained in:
Christian 2012-07-04 00:16:30 -04:00
parent 53c2b50212
commit decbe8ba7c
3 changed files with 17 additions and 2 deletions

View file

@ -163,6 +163,8 @@ public class FMLClientHandler implements IFMLSidedHandler
private OptifineModContainer optifineContainer;
private boolean guiLoaded;
public void onPreLoad(Minecraft minecraft)
{
client = minecraft;
@ -293,7 +295,7 @@ public class FMLClientHandler implements IFMLSidedHandler
loadTextures(fallbackTexturePack);
firstTick = false;
}
FMLCommonHandler.instance().tickStart(EnumSet.of(TickType.WORLDLOAD,TickType.GUILOAD));
FMLCommonHandler.instance().tickStart(EnumSet.of(TickType.WORLDLOAD));
}
}
@ -304,6 +306,12 @@ public class FMLClientHandler implements IFMLSidedHandler
public void onRenderTickEnd(float partialTickTime)
{
if (!guiLoaded)
{
FMLCommonHandler.instance().rescheduleTicks();
FMLCommonHandler.instance().tickStart(EnumSet.of(TickType.GUILOAD), partialTickTime, client.field_6313_p);
guiLoaded = true;
}
FMLCommonHandler.instance().tickEnd(EnumSet.of(TickType.RENDER,TickType.GUI), partialTickTime, client.field_6313_p);
}
/**

View file

@ -53,7 +53,7 @@ public abstract class BaseMod implements cpw.mods.fml.common.modloader.BaseMod
public final boolean doTickInGUI(TickType tick, boolean tickEnd, Object minecraftInstance, Object... data)
{
Minecraft mc = (Minecraft) minecraftInstance;
if (tickEnd && ( tick==TickType.RENDER || tick==TickType.GAME )) {
if (tickEnd && ( tick==TickType.RENDER || tick==TickType.GAME ) || tick == TickType.GUILOAD) {
return onTickInGUI((Float) data[0], mc, mc.field_6313_p);
}
return true;

View file

@ -43,8 +43,10 @@ public class ModLoaderHelper
// If we're enabled but we want clock ticks, or we're server side we get game ticks
if (enable && (useClock || FMLCommonHandler.instance().getSide().isServer())) {
ticks.add(TickType.GAME);
ticks.add(TickType.WORLDLOAD);
} else {
ticks.remove(TickType.GAME);
ticks.remove(TickType.WORLDLOAD);
}
}
@ -55,14 +57,19 @@ public class ModLoaderHelper
// If we're enabled and we don't want clock ticks we get render ticks
if (enable && !useClock) {
ticks.add(TickType.RENDER);
ticks.add(TickType.GUILOAD);
} else {
ticks.remove(TickType.RENDER);
}
// If we're enabled but we want clock ticks, or we're server side we get world ticks
if (enable && useClock) {
ticks.add(TickType.GAME);
ticks.add(TickType.GUILOAD);
ticks.add(TickType.WORLDLOAD);
} else {
ticks.remove(TickType.GAME);
ticks.remove(TickType.GUILOAD);
ticks.remove(TickType.WORLDLOAD);
}
}