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

Paper Changes:
34e5942b Fix timings task name generation for extreme cases - Fixes #3499
5e3bacbc Ensure ThreadDeath propagates fully - Fixes #3521
9fa6ba26 Optimize Light Engine
dfd3848e Use seed based lookup for Treasure Maps - Fixes lag from carto/sunken maps
74dcb3c9 Revert "Fix enchantment costs (#3519)"
6d72ea16 Fix enchantment costs (#3519)
68cc8d79 Maps shouldn't load chunks (#3518)
e7cf34a0 Fix villager trading demand MC-163962 (#3498)
51f9edf2 Change name and id to get from profile in AsyncPlayerPreLoginEvent (#3511)
2020-06-08 15:49:24 -05:00

48 lines
2.3 KiB
Diff

From 8362bf9a2f36566f70e53c7574dc5e1d36658eb2 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 c4f784f3d7..13a3fab573 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -987,6 +987,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 a729e7d204..7bea362132 100644
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
@@ -155,6 +155,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.26.2