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:
parent
53c2b50212
commit
decbe8ba7c
3 changed files with 17 additions and 2 deletions
|
@ -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);
|
||||
}
|
||||
/**
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue