Force all client modloader ticks to occur at render end
This commit is contained in:
parent
aec5bbb50f
commit
ce71f85095
2 changed files with 11 additions and 1 deletions
|
@ -29,6 +29,7 @@ public class BaseModTicker implements ITickHandler
|
|||
|
||||
private BaseMod mod;
|
||||
private EnumSet<TickType> ticks;
|
||||
private boolean clockTickTrigger;
|
||||
|
||||
|
||||
BaseModTicker(BaseMod mod)
|
||||
|
@ -56,6 +57,15 @@ public class BaseModTicker implements ITickHandler
|
|||
|
||||
private void tickBaseMod(EnumSet<TickType> types, boolean end, Object... tickData)
|
||||
{
|
||||
if (end && types.contains(TickType.GAME) && ticks.contains(TickType.GAME))
|
||||
{
|
||||
clockTickTrigger = true;
|
||||
}
|
||||
if (end && clockTickTrigger && (types.contains(TickType.RENDER) || FMLCommonHandler.instance().getSide().isServer()))
|
||||
{
|
||||
types.add(TickType.GAME);
|
||||
types.remove(TickType.RENDER);
|
||||
}
|
||||
for (TickType type : types)
|
||||
{
|
||||
if (!ticks.contains(type))
|
||||
|
|
|
@ -35,7 +35,7 @@ public class ModLoaderHelper
|
|||
BaseModTicker ticker = mlmc.getTickHandler();
|
||||
EnumSet<TickType> ticks = ticker.ticks();
|
||||
// If we're enabled and we don't want clock ticks we get render ticks
|
||||
if (enable && !useClock && FMLCommonHandler.instance().getSide().isClient()) {
|
||||
if (enable) {
|
||||
ticks.add(TickType.RENDER);
|
||||
} else {
|
||||
ticks.remove(TickType.RENDER);
|
||||
|
|
Loading…
Reference in a new issue