Handle logging during shutdown better on the server, by not

closing the logfile before the server itself has shutdown.

Signed-off-by: cpw <[email protected]>
This commit is contained in:
cpw committed 2019-10-26 16:55:15 -04:00
1 parent e3068d7db2
commit 862289cf56
3 files changed
+14 -4

No files matched your search

@@ -86,6 +86,8 @@ public class ClientModLoader
public static void begin(final Minecraft minecraft, final ResourcePackList<ClientResourcePackInfo> defaultResourcePacks, final IReloadableResourceManager mcResourceManager, DownloadingPackFinder metadataSerializer)
{
// force log4j to shutdown logging in a shutdown hook. This is because we disable default shutdown hook so the server properly logs it's shutdown
Runtime.getRuntime().addShutdownHook(new Thread(LogManager::shutdown));
loading = true;
ClientModLoader.mc = minecraft;
SidedProvider.setClient(()->minecraft);