3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-11-16 04:50:05 +01:00
Paper/patches/server/0683-Clear-SyncLoadInfo.patch
MiniDigger 4104545b11 remove system property for book size limits
"It was from a different time before books were as jank as they are now. As time has gone on they've only proven to be worse and worse."
2021-06-17 21:12:40 +02:00

41 Zeilen
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 160f3cdee21d8a3aa2ed726a7fbfce460dff26f3..f8d282b962f2d63e0245797538f67391d47dab0f 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;