mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@cc491a3 Finish updating chunk system patch PaperMC/Paper@619d7c9 Add in some patches PaperMC/Paper@902691b Apply last patch PaperMC/Paper@efb4197 Fix final compilation issues PaperMC/Paper@57a5924 Fix boot errors PaperMC/Paper@c1def9d Updated Upstream (CraftBukkit/Spigot) PaperMC/Paper@a0a2e72 fix sculk npe PaperMC/Paper@318a08c add missing block entity type to CraftBlockStates PaperMC/Paper@aed9ef0 Update adventure PaperMC/Paper@9d42879 Fix breaking pots throwing exception PaperMC/Paper@59060aa fix some failing tests PaperMC/Paper@e325e37 add missing call to EntityInsideBlockEvent PaperMC/Paper@8ce5219 Fix inconsistent chunk sending with vanilla PaperMC/Paper@04509f0 Fix crash relating to "Already sent chunk" PaperMC/Paper@c9eb393 Updated Upstream (Bukkit) PaperMC/Paper@21f2d15 Avoid duplicate poi entries from the first section (#9235) PaperMC/Paper@3621d76 Fix collision between AABB and a dot (#8733) PaperMC/Paper@ccb194b Move block farther away for Player#setRotation (#8514) PaperMC/Paper@03c3587 fix not editable sign after openSign PaperMC/Paper@6d74ad1 Finish tests & bad calls PaperMC/Paper@e829a9d Fix javadoc PaperMC/Paper@82c6479 Add back Anti-Xray patch (#9283) PaperMC/Paper@0d969f0 comment out update logic from build.gradle.kts PaperMC/Paper@ea9fdc3 Ignore inline definitions of trim material & pattern PaperMC/Paper@9ada4bd Prevent the rcon thread from attempting connections after shutdown PaperMC/Paper@c9e125f Fix setListenerRange for calibrated sculk sensors PaperMC/Paper@9ebf75d fix some more 1.20 tracking issues PaperMC/Paper@f9fc44f add side to PlayerSignCommandPreprocessEvent PaperMC/Paper@4e3febb fix missing trigger entity for xp orb from breeding PaperMC/Paper@4b5f847 Minimise EntityFertilizeEggEvent and add sniffer (#9280)
58 lines
2.8 KiB
Diff
58 lines
2.8 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
|
Date: Tue, 23 Jul 2019 10:07:16 -0500
|
|
Subject: [PATCH] Lagging threshold
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
index b8ea1f9aa3a486033b6f3d0d150aa21ab6130d53..75d15b7c157fea129a730a0f48ae9ea71f13d533 100644
|
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
@@ -309,6 +309,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
// Spigot end
|
|
public final io.papermc.paper.configuration.PaperConfigurations paperConfigurations;
|
|
public static long currentTickLong = 0L; // Paper
|
|
+ public boolean lagging = false; // Purpur
|
|
|
|
public volatile Thread shutdownThread; // Paper
|
|
public volatile boolean abnormalExit = false; // Paper
|
|
@@ -1156,6 +1157,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
this.recentTps[1] = tps5.getAverage();
|
|
this.recentTps[2] = tps15.getAverage();
|
|
// Paper end
|
|
+ lagging = recentTps[0] < org.purpurmc.purpur.PurpurConfig.laggingThreshold; // Purpur
|
|
tickSection = curTime;
|
|
}
|
|
// Spigot end
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
|
index a11723890dccee913e3c50e46e18d04afe2966e6..0f28b2c5b92a6530ebfccbced082a9cf221b3938 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
|
@@ -2993,5 +2993,10 @@ public final class CraftServer implements Server {
|
|
public String getServerName() {
|
|
return this.getProperties().serverName;
|
|
}
|
|
+
|
|
+ @Override
|
|
+ public boolean isLagging() {
|
|
+ return getServer().lagging;
|
|
+ }
|
|
// Purpur end
|
|
}
|
|
diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
|
index c4bdd22b7fd48c01bf3a136d7bd3a2b20a1e90a2..ebbb60f0ea50b4bfb2eebd3c45efbcce1e986882 100644
|
|
--- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
|
+++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
|
@@ -191,6 +191,11 @@ public class PurpurConfig {
|
|
serverModName = getString("settings.server-mod-name", serverModName);
|
|
}
|
|
|
|
+ public static double laggingThreshold = 19.0D;
|
|
+ private static void tickLoopSettings() {
|
|
+ laggingThreshold = getDouble("settings.lagging-threshold", laggingThreshold);
|
|
+ }
|
|
+
|
|
public static int barrelRows = 3;
|
|
public static boolean enderChestSixRows = false;
|
|
public static boolean enderChestPermissionRows = false;
|