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: f29c7ebd Improve async login (#3189) 9fd36824 Fix Citizens Player NPC tracking issue - Fixes #3186 0e72de1c Fix Player Tracking issue during join process. f26362af Load Spawn Chunks Asynchronously and Spiral Out 54f762e2 Load Chunks for Login Asynchronously f2d1b6e5 Clean up duplicate PlayerInitialSpawnEvent c2d022d7 Fix Longstanding Broken behavior of PlayerJoinEvent d0a348b9 Broadcast join messages to console 1ef687a4 Don't crash if player is attempted to be removed from untracked chunk. c11668ac Make sure the chunk conversion task is executed immediately 26fb7cc3 Fix Chunk Post Processing deadlock risk
48 lines
2.3 KiB
Diff
48 lines
2.3 KiB
Diff
From 63bc9e56072e103ae01bd468c4ec3f4fcbf22347 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 7015611dc4..51fc57100e 100644
|
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
@@ -964,6 +964,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
|
|
|