Files
Purpur/patches/server/0057-Configurable-TPS-Catchup.patch
William Blake Galbreath 2040a9ac8a Updated Upstream (Paper & Tuinity)
Upstream has released updates that appear to apply and compile correctly

Paper Changes:
8fe5611 Fix Player#playerListName nullability annotation (#6089)
8827886 Add back linking to Adventure Javadoc (#6088)
6ea4da4 AbstractSkeleton should extend RangedEntity (#6087)
a831634 add Optimize Light Engine patch (#5863)
56fd1a2 Update to Minecraft 1.17.1 (#6097)
f8d6cbd Deobfuscate stacktraces in sync load info (#6103)

Tuinity Changes:
5065deb Make CollisionContext initialisation lazy
388bdf5 Optimise ActivationRange#activateEntities again
2310a94 Update to 1.17.1
2021-07-07 04:05:03 -05:00

40 lines
2.3 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <blake.galbreath@gmail.com>
Date: Thu, 26 Mar 2020 19:06:22 -0500
Subject: [PATCH] Configurable TPS Catchup
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 53d429eec63448f5e30ffb7026d49579264bd705..c96feac8afa0e0ea05513692d1e937ae7cbecd66 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1263,7 +1263,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.tickServer(this::haveTime);
this.profiler.popPush("nextTickWait");
this.mayHaveDelayedTasks = true;
- this.delayedTasksMaxNextTickTime = Math.max(Util.getMillis() + 50L, this.nextTickTime);
+ // Purpur start - tps catchup
+ if (net.pl3x.purpur.PurpurConfig.tpsCatchup) {
+ this.delayedTasksMaxNextTickTime = Math.max(Util.getMillis() + 50L, this.nextTickTime);
+ } else {
+ this.delayedTasksMaxNextTickTime = this.nextTickTime = curTime / 1000000L + 50L;
+ }
+ // Purpur end - tps catchup
this.waitUntilNextTick();
this.profiler.pop();
this.endMetricsRecordingTick();
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
index 297c3d4427cfff2355f7ec5b276b4273584a56ac..0ae18dfbd6ea05737cd456762da32efe3a51aef8 100644
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
@@ -219,4 +219,9 @@ public class PurpurConfig {
loggerSuppressInitLegacyMaterialError = getBoolean("settings.logger.suppress-init-legacy-material-errors", loggerSuppressInitLegacyMaterialError);
loggerSuppressIgnoredAdvancementWarnings = getBoolean("settings.logger.suppress-ignored-advancement-warnings", loggerSuppressIgnoredAdvancementWarnings);
}
+
+ public static boolean tpsCatchup = true;
+ private static void tpsCatchup() {
+ tpsCatchup = getBoolean("settings.tps-catchup", tpsCatchup);
+ }
}