mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
Upstream has released updates that appears to apply and compile correctly Paper Changes: cffe4c07 Scheduling an async task timer creates a non-repeating task (#3543) e224f0bd Fix issues with SIGTERM not shutting down gracefully - Fixes #3062 c7112d06 Ensure chunk gen tasks return to main thread before completing futures
48 lines
2.3 KiB
Diff
48 lines
2.3 KiB
Diff
From ac18ff5c4486e7622546829a55e3dc884de1c07e 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 9052d4475d..517d7a9006 100644
|
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
@@ -988,6 +988,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
|
|
|