mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-19 11:59:25 +00:00
Force all client modloader ticks to occur at render end
This commit is contained in:
1 parent
99ce6e2dee
commit
747c6131bf
2 files changed
+11
-1
No files matched your search
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user