2022-08-21 04:57:17 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: =?UTF-8?q?Jos=C3=A9=20Miguel=20Moreno?= <josemmo@pm.me>
|
|
|
|
Date: Sat, 5 Jun 2021 13:45:15 +0200
|
|
|
|
Subject: [PATCH] Fix plugin loggers on server shutdown
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/io/papermc/paper/log/CustomLogManager.java b/src/main/java/io/papermc/paper/log/CustomLogManager.java
|
|
|
|
new file mode 100644
|
|
|
|
index 0000000000000000000000000000000000000000..c1d3bac79bb8b4796c013ff4472f75dcd79602dc
|
|
|
|
--- /dev/null
|
|
|
|
+++ b/src/main/java/io/papermc/paper/log/CustomLogManager.java
|
|
|
|
@@ -0,0 +1,26 @@
|
|
|
|
+package io.papermc.paper.log;
|
|
|
|
+
|
|
|
|
+import java.util.logging.LogManager;
|
|
|
|
+
|
|
|
|
+public class CustomLogManager extends LogManager {
|
|
|
|
+ private static CustomLogManager instance;
|
|
|
|
+
|
|
|
|
+ public CustomLogManager() {
|
|
|
|
+ instance = this;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void reset() {
|
|
|
|
+ // Ignore calls to this method
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private void superReset() {
|
|
|
|
+ super.reset();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public static void forceReset() {
|
|
|
|
+ if (instance != null) {
|
|
|
|
+ instance.superReset();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
2024-09-19 16:36:07 +02:00
|
|
|
index 11b9eb8d7d5f9ad736f2c6784c5d9e745a355093..bef05e09c654794405832ad75c3471f63399dfee 100644
|
2022-08-21 04:57:17 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
2024-09-19 16:36:07 +02:00
|
|
|
@@ -1237,6 +1237,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
2024-01-23 12:06:27 +01:00
|
|
|
} catch (Exception ignored) {
|
|
|
|
}
|
|
|
|
// CraftBukkit end
|
|
|
|
+ io.papermc.paper.log.CustomLogManager.forceReset(); // Paper - Reset loggers after shutdown
|
|
|
|
this.onServerExit();
|
|
|
|
}
|
|
|
|
|
2022-08-21 04:57:17 +02:00
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
|
2024-08-31 20:29:50 +02:00
|
|
|
index 168cbb239ac5d632908f2b0aca82cbcfdc35651f..c1e88c31910e96ef07cece05046c0b55e708b52d 100644
|
2022-08-21 04:57:17 +02:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
|
2024-05-16 02:06:59 +02:00
|
|
|
@@ -19,6 +19,12 @@ public class Main {
|
2022-08-21 04:57:17 +02:00
|
|
|
public static boolean useJline = true;
|
|
|
|
public static boolean useConsole = true;
|
|
|
|
|
2024-01-18 15:56:25 +01:00
|
|
|
+ // Paper start - Reset loggers after shutdown
|
2022-08-21 04:57:17 +02:00
|
|
|
+ static {
|
|
|
|
+ System.setProperty("java.util.logging.manager", "io.papermc.paper.log.CustomLogManager");
|
|
|
|
+ }
|
2024-01-18 15:56:25 +01:00
|
|
|
+ // Paper end - Reset loggers after shutdown
|
2022-08-21 04:57:17 +02:00
|
|
|
+
|
|
|
|
public static void main(String[] args) {
|
|
|
|
// Paper start
|
|
|
|
final String warnWhenLegacyFormattingDetected = String.join(".", "net", "kyori", "adventure", "text", "warnWhenLegacyFormattingDetected");
|