Files
Purpur/patches/server/0102-Configurable-TPS-Catchup.patch
William Blake Galbreath 2243be4513 Updated Upstream (Paper)
Upstream has released updates that appears to apply and compile correctly

Paper Changes:
c096fe19 Port 20w15a Villager AI optimizations
832687de Restore preventing saving bad entities patch to full effect
df8eedee Restore Optimize Pathfinding patch
97b1cc36 Allow shutting down server during a watchdog hang gracefully
06044e24 Async command map building
2020-04-12 17:33:46 -05:00

48 lines
2.3 KiB
Diff

From 63b89fe8a5e82165fa5faa9eb95692ec8a1fdf63 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
---
src/main/java/net/minecraft/server/MinecraftServer.java | 7 +++++++
src/main/java/net/pl3x/purpur/PurpurConfig.java | 5 +++++
2 files changed, 12 insertions(+)
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index e3c326c340..cebb45ec76 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -961,6 +961,13 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
this.methodProfiler.exitEnter("nextTickWait");
this.ac = true;
this.ab = Math.max(SystemUtils.getMonotonicMillis() + 50L, this.nextTick);
+ // Purpur start - tps catchup
+ if (net.pl3x.purpur.PurpurConfig.tpsCatchup) {
+ this.ab = Math.max(SystemUtils.getMonotonicMillis() + 50L, this.nextTick);
+ } else {
+ this.ab = 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 dd3afd4a57..c55e5c1f27 100644
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
@@ -159,6 +159,11 @@ public class PurpurConfig {
useUPnP = getBoolean("settings.upnp-port-forwarding", useUPnP);
}
+ public static boolean tpsCatchup = true;
+ private static void tpsCatchup() {
+ tpsCatchup = getBoolean("settings.tps-catchup", tpsCatchup);
+ }
+
public static boolean dontSendUselessEntityPackets = false;
private static void dontSendUselessEntityPackets() {
dontSendUselessEntityPackets = getBoolean("settings.dont-send-useless-entity-packets", dontSendUselessEntityPackets);
--
2.24.0