mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-20 01:47:42 +01:00
Component related conveniences
This commit is contained in:
@@ -1,39 +0,0 @@
|
||||
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 34e364afff8cfe060244e5dd7cc0c34033dc6945..c5f1141d46acca284f5489d68d3b628e669950cb 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -1255,7 +1255,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 bb134c5f14b0d52e1e4ffeee20c2cc9293126d22..052eb37087b5f97d92c00944968c13fec343d5a3 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
@@ -192,4 +192,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