Fix dumplisteners missing folder creation

This commit is contained in:
Shane Freeder 2022-12-06 04:02:44 +00:00
parent 96fdafd935
commit 407a445aac
No known key found for this signature in database
GPG key ID: A3F61EA5A085289C

View file

@ -27,10 +27,10 @@ index 724592234e2a178a518f6ab7d09c3180780371a7..92154550b41b2e1d03deb1271b71bb3b
.flatMap(entry -> entry.getKey().stream().map(s -> Map.entry(s, entry.getValue()))) .flatMap(entry -> entry.getKey().stream().map(s -> Map.entry(s, entry.getValue())))
diff --git a/src/main/java/io/papermc/paper/command/subcommands/DumpListenersCommand.java b/src/main/java/io/papermc/paper/command/subcommands/DumpListenersCommand.java diff --git a/src/main/java/io/papermc/paper/command/subcommands/DumpListenersCommand.java b/src/main/java/io/papermc/paper/command/subcommands/DumpListenersCommand.java
new file mode 100644 new file mode 100644
index 0000000000000000000000000000000000000000..c80485b9b0c189820687b3a8ff66a855a4b1efa7 index 0000000000000000000000000000000000000000..aa44d4685de3caee4131449bead7a084868ff976
--- /dev/null --- /dev/null
+++ b/src/main/java/io/papermc/paper/command/subcommands/DumpListenersCommand.java +++ b/src/main/java/io/papermc/paper/command/subcommands/DumpListenersCommand.java
@@ -0,0 +1,171 @@ @@ -0,0 +1,172 @@
+package io.papermc.paper.command.subcommands; +package io.papermc.paper.command.subcommands;
+ +
+import com.destroystokyo.paper.util.SneakyThrow; +import com.destroystokyo.paper.util.SneakyThrow;
@ -93,6 +93,7 @@ index 0000000000000000000000000000000000000000..c80485b9b0c189820687b3a8ff66a855
+ private void dumpToFile(final CommandSender sender) { + private void dumpToFile(final CommandSender sender) {
+ final File file = new File("debug/listeners-" + final File file = new File("debug/listeners-"
+ + DateTimeFormatter.ofPattern("yyyy-MM-dd_HH.mm.ss").format(LocalDateTime.now()) + ".txt"); + + DateTimeFormatter.ofPattern("yyyy-MM-dd_HH.mm.ss").format(LocalDateTime.now()) + ".txt");
+ file.getParentFile().mkdirs();
+ try (final PrintWriter writer = new PrintWriter(file)) { + try (final PrintWriter writer = new PrintWriter(file)) {
+ for (final String eventClass : eventClassNames()) { + for (final String eventClass : eventClassNames()) {
+ final HandlerList handlers; + final HandlerList handlers;