Paper/patches/server/0682-Clear-SyncLoadInfo.patch
Shane Freeder aa52bf9e33
Remove "Implement-Chunk-Priority-Urgency-System-for-Chunks" (Fixes #5980)
Mojang made some changes to priorities in 1.17 and it seems that these changes
conflict with the changes made in this patch, which in some cases appears to
cause excessive rescheduling of tasks.

This, however, is not confirmed as such but seems to be the behavior that we're
seeing to cause this issue, if mojang has adopted the changes we suggested,
then a good chunk of this patch may be unneeded, but, this needs a much better
look than I'm currently able to do
2021-08-14 14:55:55 +01:00

41 lines
2.0 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Tom <cryptite@gmail.com>
Date: Fri, 26 Feb 2021 16:10:53 -0600
Subject: [PATCH] Clear SyncLoadInfo
This patch merely adds the extra argument "clear" after /paper syncloadinfo to clear currently stored syncload info.
diff --git a/src/main/java/com/destroystokyo/paper/PaperCommand.java b/src/main/java/com/destroystokyo/paper/PaperCommand.java
index 847ff34a56b7477996901662c25f50b79262f4e1..ba8395435482fc4d6e02fc86794cdb0d35d4399c 100644
--- a/src/main/java/com/destroystokyo/paper/PaperCommand.java
+++ b/src/main/java/com/destroystokyo/paper/PaperCommand.java
@@ -205,6 +205,13 @@ public class PaperCommand extends Command {
sender.sendMessage(ChatColor.RED + "This command requires the server startup flag '-Dpaper.debug-sync-loads=true' to be set.");
return;
}
+
+ if (args.length > 1 && args[1].equals("clear")) {
+ SyncLoadFinder.clear();
+ sender.sendMessage(ChatColor.GRAY + "Sync load data cleared.");
+ return;
+ }
+
File file = new File(new File(new File("."), "debug"),
"sync-load-info" + DateTimeFormatter.ofPattern("yyyy-MM-dd_HH.mm.ss").format(LocalDateTime.now()) + ".txt");
file.getParentFile().mkdirs();
diff --git a/src/main/java/com/destroystokyo/paper/io/SyncLoadFinder.java b/src/main/java/com/destroystokyo/paper/io/SyncLoadFinder.java
index 524f33371b9de1d4dd6972fe59ffbe1804d7c5f3..0bb4aaa546939b67a5d22865190f30478a9337c1 100644
--- a/src/main/java/com/destroystokyo/paper/io/SyncLoadFinder.java
+++ b/src/main/java/com/destroystokyo/paper/io/SyncLoadFinder.java
@@ -26,6 +26,10 @@ public class SyncLoadFinder {
public final Long2IntOpenHashMap coordinateTimes = new Long2IntOpenHashMap();
}
+ public static void clear() {
+ SYNC_LOADS.clear();
+ }
+
public static void logSyncLoad(final Level world, final int chunkX, final int chunkZ) {
if (!ENABLED) {
return;