Paper/Spigot-Server-Patches/0676-Clear-SyncLoadInfo.patch
Josh Roy be13705177
Updated Upstream (CraftBukkit) (#5484)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

CraftBukkit Changes:
6b8cd9a7 SPIGOT-6207: forcibly drop the items of a converted zombie villager
2021-04-12 02:03:08 +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 4b3efe01750d79bcc27a42b5a145d9aa6b124d18..12313a37ceeb6a0b6a539c38fdba67e5e43d7413 100644
--- a/src/main/java/com/destroystokyo/paper/PaperCommand.java
+++ b/src/main/java/com/destroystokyo/paper/PaperCommand.java
@@ -295,6 +295,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 d381f91cf105bfc01846ada90da8971a3618e784..c51401bcfac0a1e45099af1dd355073c19790476 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 World world, final int chunkX, final int chunkZ) {
if (!ENABLED) {
return;