9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2025-12-19 15:09:25 +00:00
Files
Leaf/leaf-server/paper-patches/features/0055-dump-pwt-thread.patch
hayanesuru ac6e483e8d fix async mob spawning TRACKED entities not count (#393)
* fix unloaded and TRACKED entities not count

#392

* move to archived
2025-07-08 22:54:12 +09:00

33 lines
1.9 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: hayanesuru <hayanesuru@outlook.jp>
Date: Sat, 7 Jun 2025 20:33:16 +0900
Subject: [PATCH] dump pwt thread
diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/spigotmc/WatchdogThread.java
index 79eae898539f71a73525ed29d8a752f65f5f67fa..e98279e78c9f5ddbd6dd0cdf48973453304b8e1c 100644
--- a/src/main/java/org/spigotmc/WatchdogThread.java
+++ b/src/main/java/org/spigotmc/WatchdogThread.java
@@ -124,6 +124,21 @@ public class WatchdogThread extends ca.spottedleaf.moonrise.common.util.TickThre
WatchdogThread.dumpThread(ManagementFactory.getThreadMXBean().getThreadInfo(MinecraftServer.getServer().serverThread.threadId(), Integer.MAX_VALUE), logger);
logger.log(Level.SEVERE, "------------------------------");
+ // Leaf start - dump pwt thread
+ logger.log(Level.SEVERE, "Parallel world ticking thread dump");
+ for (Thread thread : org.apache.commons.lang3.ThreadUtils.getAllThreads()) {
+ if (MinecraftServer.getServer().serverThread == thread || thread instanceof WatchdogThread) {
+ continue;
+ }
+ if (thread instanceof ca.spottedleaf.moonrise.common.util.TickThread tickThread) {
+ if (tickThread instanceof ServerLevelTickThread tickThread1) {
+ WatchdogThread.dumpThread(ManagementFactory.getThreadMXBean().getThreadInfo(tickThread1.threadId(), Integer.MAX_VALUE), logger);
+ }
+ }
+ }
+ logger.log(Level.SEVERE, "------------------------------");
+ // Leaf end - dump pwt thread
+
// Paper start - Only print full dump on long timeouts
if (isLongTimeout) {
logger.log(Level.SEVERE, "Entire Thread Dump:");