Files
Purpur/patches/server/0057-Configurable-TPS-Catchup.patch
BillyGalbreath af2dd61af0 Updated Upstream (Paper, Tuinity, & Airplane)
Upstream has released updates that appear to apply and compile correctly

Paper Changes:
3dcbdc73b Fix force upgrade patch (#5699)
dab6ec6cd List all missing hard depends not just first (#5673)
aed5031e3 Fix/Optimize world and light datafixes (#5693)
719040d92 [Auto] Updated Upstream (CraftBukkit)
6c183f1ae [Auto] Updated Upstream (CraftBukkit)

Tuinity Changes:
f88659c8e Fix and optimise world force upgrading

Airplane Changes:
7f3b09178 Move check
040fa19eb Better checking for useless move packets
5fab6a257 Improvements to fluid & profiler patches
046ae543c Improve hopper performance via bitset
4a221843f Update Upstream (Tuinity)
2021-05-21 04:41:03 -05:00

40 lines
2.2 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 8a11047d0e60d20c83f2013b5e1488fe08152142..ac21ebf5d835fb34dbaad5f3c40cc5aeb6153231 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1135,7 +1135,13 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
this.a(this::canSleepForTick);
this.methodProfiler.exitEnter("nextTickWait");
this.X = true;
- this.W = Math.max(SystemUtils.getMonotonicMillis() + 50L, this.nextTick);
+ // Purpur start - tps catchup
+ if (net.pl3x.purpur.PurpurConfig.tpsCatchup) {
+ this.W = Math.max(SystemUtils.getMonotonicMillis() + 50L, this.nextTick);
+ } else {
+ this.W = this.nextTick = curTime / 1000000L + 50L;
+ }
+ // Purpur end - tps catchup
this.sleepForTick();
this.methodProfiler.exit();
this.methodProfiler.b();
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
index 892f72c89af1b550305e2771f1ff5f470941faf8..0d16eaeea8b38329ffd6859b3ef93562a8fb86ce 100644
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
@@ -190,4 +190,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);
+ }
}