mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-20 09:57:43 +01:00
Disable TPS Catchup
This commit is contained in:
57
patches/server/0019-Disable-TPS-Catchup.patch
Normal file
57
patches/server/0019-Disable-TPS-Catchup.patch
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
From 5a57aeeb543cc06d5ded97fa94bf0ad1915f0e16 Mon Sep 17 00:00:00 2001
|
||||||
|
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||||
|
Date: Tue, 21 May 2019 21:32:50 -0500
|
||||||
|
Subject: [PATCH] Disable TPS Catchup
|
||||||
|
|
||||||
|
---
|
||||||
|
src/main/java/net/minecraft/server/MinecraftServer.java | 3 +++
|
||||||
|
src/main/java/net/pl3x/purpur/PurpurConfig.java | 5 +++++
|
||||||
|
2 files changed, 8 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
|
index d4df5bf57..97ea56a28 100644
|
||||||
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
|
@@ -47,6 +47,7 @@ import joptsimple.NonOptionArgumentSpec;
|
||||||
|
import joptsimple.OptionParser;
|
||||||
|
import joptsimple.OptionSet;
|
||||||
|
import joptsimple.OptionSpec;
|
||||||
|
+import net.pl3x.purpur.PurpurConfig;
|
||||||
|
import org.apache.commons.lang3.Validate;
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
|
@@ -854,6 +855,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||||
|
while (this.isRunning) {
|
||||||
|
curTime = System.nanoTime();
|
||||||
|
// Paper start - Further improve server tick loop
|
||||||
|
+ if (!PurpurConfig.disableTPSCatchup) { // Purpur - disable tps catchup
|
||||||
|
wait = TICK_TIME - (curTime - lastTick);
|
||||||
|
if (wait > 0) {
|
||||||
|
if (catchupTime < 2E6) {
|
||||||
|
@@ -873,6 +875,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||||
|
}
|
||||||
|
|
||||||
|
catchupTime = Math.min(MAX_CATCHUP_BUFFER, catchupTime - wait);
|
||||||
|
+ } // Purpur - disable tps catchup
|
||||||
|
if ( ++MinecraftServer.currentTick % SAMPLE_INTERVAL == 0 )
|
||||||
|
{
|
||||||
|
final long diff = curTime - tickSection;
|
||||||
|
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||||
|
index d7236ebd6..688c49bb6 100644
|
||||||
|
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||||
|
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||||
|
@@ -103,6 +103,11 @@ public class PurpurConfig {
|
||||||
|
return config.getString(path, config.getString(path));
|
||||||
|
}
|
||||||
|
|
||||||
|
+ public static boolean disableTPSCatchup = true;
|
||||||
|
+ private static void disableTPSCatchup() {
|
||||||
|
+ disableTPSCatchup = getBoolean("settings.disable-tps-catchup", disableTPSCatchup);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
public static boolean showDuplicateEntityUUIDErrors = true;
|
||||||
|
public static boolean showUnknownAttributeWarnings = true;
|
||||||
|
private static void loggerSettings() {
|
||||||
|
--
|
||||||
|
2.20.1
|
||||||
|
|
||||||
Reference in New Issue
Block a user