mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-18 00:47:42 +01:00
Upstream has released updates that appears to apply and compile correctly Paper Changes: ffecc4e2 Revert "Optimize entity list iteration requiring entities be in" 0a4286cc Prevent Fire from loading chunks 07915ea1 Add Player Client Options API (#2883) bc48a317 Optimize entity list iteration requiring entities be in loaded chunks 88092fef Optimize ChunkProviderServer's chunk level checking helper methods 01e8ce8d Forced Watchdog Crash support and Improve Async Shutdown fdb8fe78 Be less strict with vanilla teleport command limits
48 lines
2.3 KiB
Diff
48 lines
2.3 KiB
Diff
From 2279fe808101b3cd719ad86b223ffb54ec601f34 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 6f14ed2726..3c8acd884a 100644
|
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
@@ -976,6 +976,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
|
|
|