From 5cd82f16f21108ad6754e9e4298bd81909bb8948 Mon Sep 17 00:00:00 2001 From: cpw Date: Sun, 12 May 2019 13:07:17 -0400 Subject: [PATCH] Fix #5735 by pushing new build. Shutdown Forge eventbus when errors occur. Closes #5711 Also, improve logging so warnings, errors and fatals are always shown, regardless of marker. Signed-off-by: cpw --- src/main/java/net/minecraftforge/fml/ModLoader.java | 4 ++-- .../java/net/minecraftforge/fml/client/ClientModLoader.java | 3 +++ src/main/resources/log4j2.xml | 1 + src/main/resources/log4j2_server.xml | 1 + 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/minecraftforge/fml/ModLoader.java b/src/main/java/net/minecraftforge/fml/ModLoader.java index 75a18564d..9920938d5 100644 --- a/src/main/java/net/minecraftforge/fml/ModLoader.java +++ b/src/main/java/net/minecraftforge/fml/ModLoader.java @@ -148,12 +148,12 @@ public class ModLoader private void dispatchAndHandleError(LifecycleEventProvider event) { if (!loadingExceptions.isEmpty()) { - LOGGER.error("Skipping lifecycle event {}, {} errors found.", event, loadingExceptions.size()); + LOGGER.error(LOADING,"Skipping lifecycle event {}, {} errors found.", event, loadingExceptions.size()); } else { event.dispatch(this::accumulateErrors); } if (!loadingExceptions.isEmpty()) { - LOGGER.fatal("Failed to complete lifecycle event {}, {} errors found", event, loadingExceptions.size()); + LOGGER.fatal(LOADING,"Failed to complete lifecycle event {}, {} errors found", event, loadingExceptions.size()); throw new LoadingFailedException(loadingExceptions); } } diff --git a/src/main/java/net/minecraftforge/fml/client/ClientModLoader.java b/src/main/java/net/minecraftforge/fml/client/ClientModLoader.java index c975698e4..3c5cb6053 100644 --- a/src/main/java/net/minecraftforge/fml/client/ClientModLoader.java +++ b/src/main/java/net/minecraftforge/fml/client/ClientModLoader.java @@ -28,6 +28,7 @@ import net.minecraft.resources.ResourcePackList; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.common.ForgeConfig; +import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.fml.LoadingFailedException; import net.minecraftforge.fml.LogicalSidedProvider; import net.minecraftforge.fml.ModLoader; @@ -61,6 +62,7 @@ public class ClientModLoader try { ModLoader.get().loadMods(); } catch (LoadingFailedException e) { + MinecraftForge.EVENT_BUS.shutdown(); error = e; } ResourcePackLoader.loadResourcePacks(defaultResourcePacks); @@ -71,6 +73,7 @@ public class ClientModLoader try { ModLoader.get().finishMods(); } catch (LoadingFailedException e) { + MinecraftForge.EVENT_BUS.shutdown(); if (error == null) error = e; } loading = false; diff --git a/src/main/resources/log4j2.xml b/src/main/resources/log4j2.xml index b787260b0..28cbfac7b 100644 --- a/src/main/resources/log4j2.xml +++ b/src/main/resources/log4j2.xml @@ -1,6 +1,7 @@ + diff --git a/src/main/resources/log4j2_server.xml b/src/main/resources/log4j2_server.xml index b475688c2..54d81f0ff 100644 --- a/src/main/resources/log4j2_server.xml +++ b/src/main/resources/log4j2_server.xml @@ -1,6 +1,7 @@ +