Configurable TPS Catchup

This commit is contained in:
William Blake Galbreath
2025-01-05 15:42:33 -08:00
committed by granny
parent 417ddf761e
commit 676b9dbb76
3 changed files with 18 additions and 37 deletions

View File

@@ -16,6 +16,19 @@
tickSection = currentTime;
}
// Paper end - further improve server tick loop
@@ -1260,6 +_,12 @@
profilerFiller.popPush("nextTickWait");
this.mayHaveDelayedTasks = true;
this.delayedTasksMaxNextTickTimeNanos = Math.max(Util.getNanos() + l, this.nextTickTimeNanos);
+ // Purpur start - Configurable TPS Catchup
+ if (!org.purpurmc.purpur.PurpurConfig.tpsCatchup /*|| !gg.pufferfish.pufferfish.PufferfishConfig.tpsCatchup*/) { // Purpur - Configurable TPS Catchup
+ this.nextTickTimeNanos = currentTime + l;
+ this.delayedTasksMaxNextTickTimeNanos = nextTickTimeNanos;
+ }
+ // Purpur end - Configurable TPS Catchup
this.startMeasuringTaskExecutionTime();
this.waitUntilNextTick();
this.finishMeasuringTaskExecutionTime();
@@ -1854,7 +_,7 @@
@DontObfuscate

View File

@@ -232,4 +232,9 @@ public class PurpurConfig {
loggerSuppressUnrecognizedRecipeErrors = getBoolean("settings.logger.suppress-unrecognized-recipe-errors", loggerSuppressUnrecognizedRecipeErrors);
loggerSuppressSetBlockFarChunk = getBoolean("settings.logger.suppress-setblock-in-far-chunk-errors", loggerSuppressSetBlockFarChunk);
}
public static boolean tpsCatchup = true;
private static void tpsCatchup() {
tpsCatchup = getBoolean("settings.tps-catchup", tpsCatchup);
}
}