mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
🎉🎉 1/4 OF THE PATCHES ARE DONE 🎉🎉
This commit is contained in:
39
patches/server/0055-Configurable-TPS-Catchup.patch
Normal file
39
patches/server/0055-Configurable-TPS-Catchup.patch
Normal file
@@ -0,0 +1,39 @@
|
||||
From 0000000000000000000000000000000000000000 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
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 33c0fad3f0a7283d193eb23afd210c0d912b5c2d..98b7ccbd1ee4d14fde0cdea2c08c432709fa6e56 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -1182,7 +1182,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
this.tickServer(this::haveTime);
|
||||
this.profiler.popPush("nextTickWait");
|
||||
this.mayHaveDelayedTasks = true;
|
||||
- this.delayedTasksMaxNextTickTime = Math.max(Util.getMillis() + 50L, this.nextTickTime);
|
||||
+ // Purpur start - tps catchup
|
||||
+ if (net.pl3x.purpur.PurpurConfig.tpsCatchup) {
|
||||
+ this.delayedTasksMaxNextTickTime = Math.max(Util.getMillis() + 50L, this.nextTickTime);
|
||||
+ } else {
|
||||
+ this.delayedTasksMaxNextTickTime = this.nextTickTime = curTime / 1000000L + 50L;
|
||||
+ }
|
||||
+ // Purpur end - tps catchup
|
||||
this.waitUntilNextTick();
|
||||
this.profiler.pop();
|
||||
this.endMetricsRecordingTick();
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
index 561c27bc5c23e3761018b8475ad1512d880418fc..3e70e16c5d1e515295efe7cbe6b718e388c01903 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
@@ -188,4 +188,9 @@ public class PurpurConfig {
|
||||
loggerSuppressInitLegacyMaterialError = getBoolean("settings.logger.suppress-init-legacy-material-errors", loggerSuppressInitLegacyMaterialError);
|
||||
loggerSuppressIgnoredAdvancementWarnings = getBoolean("settings.logger.suppress-ignored-advancement-warnings", loggerSuppressIgnoredAdvancementWarnings);
|
||||
}
|
||||
+
|
||||
+ public static boolean tpsCatchup = true;
|
||||
+ private static void tpsCatchup() {
|
||||
+ tpsCatchup = getBoolean("settings.tps-catchup", tpsCatchup);
|
||||
+ }
|
||||
}
|
||||
Reference in New Issue
Block a user