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@f7e3976 Revert "Legacy data should look for legacy materials (Fixes #6618)" (Fixes #6664) PaperMC/Paper@ce1e7e8 Fix jline relocation (#6677) PaperMC/Paper@3e8fb21 Suggest PlayerPostRespawnEvent if changing player state (#6679) PaperMC/Paper@2b404b0 Fix nullability on Block#breakNaturally (#6651) PaperMC/Paper@8ee9bdd Fix stacktrace deobf where thrownProxy got initialized before rewriting (#6684) PaperMC/Paper@fce7905 Option to prevent NBT copy in smithing recipes (#6671) PaperMC/Paper@3b2b835 Fix click event when vanilla scoreboard name coloring is enabled (#6652) PaperMC/Paper@425edfa More CommandBlock API (#5746) PaperMC/Paper@6847f57 Improve ItemStack#editMeta (#6502) PaperMC/Paper@6703c13 Preserve overstacked loot (#5943) PaperMC/Paper@0032236 Make Levels Use Correct Spawn Settings (#6419) PaperMC/Paper@4a27a4a Update head rotation in missing places (#5481) PaperMC/Paper@ebfd70b Use null for null resource pack prompts (#6572) PaperMC/Paper@826acaf Fix plugin provides load order (#6687) PaperMC/Paper@f905057 Prevent unintended light block manipulation (#6601) PaperMC/Paper@45c4f90 Readd root/admin user detection (#6593) PaperMC/Paper@e8830b2 Revert "Readd root/admin user detection (#6593)" (#6699) PaperMC/Paper@cc38c16 Updated Upstream (Bukkit/CraftBukkit) (#6638) PaperMC/Paper@7dd7c0c [ci skip] update issue template to remove checkboxes and add datapacks (#6702) PaperMC/Paper@bde7b98 Make legacyRenderer a ViewerUnaware renderer (#6691) PaperMC/Paper@e391591 Update paperweight to 1.1.12 (#6653) PaperMC/Paper@e14aff9 Don't count named piglins and hoglins towards mob cap (#6452) PaperMC/Paper@a978f41 Start console thread after PaperConfig & MinecraftServer.console are initialized (#6716) PaperMC/Paper@b1f0cbd [ci skip] Remove redundant/broken readme badges (#6715) PaperMC/Paper@e3ef498 [ci skip] remove markdown from issue template (#6705) PaperMC/Paper@7ebf08a Handle missing Spawn Egg item meta for 1.17 mobs (#6700) PaperMC/Paper@90f717f Add missing team sidebar display slots (#6690)
58 lines
3.0 KiB
Diff
58 lines
3.0 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 827c079840eb8ad098db60176afa2e06c8ccc86b..85bab8904fd79018fd1a8639e1e77b5219f33ad8 100644
|
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
@@ -306,6 +306,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
public static final int TICK_TIME = 1000000000 / MinecraftServer.TPS;
|
|
private static final int SAMPLE_INTERVAL = 20; // Paper
|
|
public final double[] recentTps = new double[ 3 ];
|
|
+ public boolean lagging = false; // Purpur
|
|
public final SlackActivityAccountant slackActivityAccountant = new SlackActivityAccountant();
|
|
// Spigot end
|
|
public static long currentTickLong = 0L; // Paper
|
|
@@ -1257,6 +1258,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
this.recentTps[1] = tps5.getAverage();
|
|
this.recentTps[2] = tps15.getAverage();
|
|
// Paper end
|
|
+ lagging = recentTps[0] < net.pl3x.purpur.PurpurConfig.laggingThreshold; // Purpur
|
|
tickSection = curTime;
|
|
}
|
|
// Spigot end
|
|
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
|
index bc5f937e7480d954680c7b9f1d698aff3e28665d..c0e7027ad804d7b801ef8cb94963c113c95735d1 100644
|
|
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
|
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
|
@@ -188,6 +188,11 @@ public class PurpurConfig {
|
|
if (!co.aikar.timings.TimingsManager.hiddenConfigs.contains("server-ip")) co.aikar.timings.TimingsManager.hiddenConfigs.add("server-ip");
|
|
}
|
|
|
|
+ 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;
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
|
index 11686b723e405996072086af82b1d5559dde7b3e..d82b7f25875ceef538b613af6091c9a13d40e67b 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
|
@@ -2701,5 +2701,10 @@ public final class CraftServer implements Server {
|
|
public String getServerName() {
|
|
return this.getProperties().serverName;
|
|
}
|
|
+
|
|
+ @Override
|
|
+ public boolean isLagging() {
|
|
+ return getServer().lagging;
|
|
+ }
|
|
// Purpur end
|
|
}
|