mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-20 18:07:43 +01:00
Configurable TPS Catchup
This commit is contained in:
47
patches/server/0114-Configurable-TPS-Catchup.patch
Normal file
47
patches/server/0114-Configurable-TPS-Catchup.patch
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
From bf5dc04768695c73902f25408e4975dd5d2e1bb8 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 2ede67d883..e11414b609 100644
|
||||||
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
|
@@ -958,6 +958,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 90a44a539c..316b63d9e6 100644
|
||||||
|
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||||
|
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||||
|
@@ -170,6 +170,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;
|
||||||
|
public static boolean fixItemPositionDesync = false;
|
||||||
|
private static void dontSendUselessEntityPackets() {
|
||||||
|
--
|
||||||
|
2.24.0
|
||||||
|
|
||||||
Reference in New Issue
Block a user