From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Miguel=20Moreno?= 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 index 9a1c27bc7bee1f915675b82717dd82f6dd0f3ee6..bb8381c51bc6b37111b837710da7e1ccbca6df5d 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -1026,6 +1026,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop