From 0a8a6018772dcf06f6939acee374406532fd6ff0 Mon Sep 17 00:00:00 2001 From: LexManos Date: Sun, 16 Jun 2019 00:48:38 -0700 Subject: [PATCH] Add temporary hard crash when mods error until we can load our error screen. --- src/main/java/net/minecraftforge/fml/ForgeI18n.java | 2 +- .../net/minecraftforge/fml/client/ClientModLoader.java | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/minecraftforge/fml/ForgeI18n.java b/src/main/java/net/minecraftforge/fml/ForgeI18n.java index 58de941e7..4297d9347 100644 --- a/src/main/java/net/minecraftforge/fml/ForgeI18n.java +++ b/src/main/java/net/minecraftforge/fml/ForgeI18n.java @@ -78,7 +78,7 @@ public class ForgeI18n { } public static String getPattern(final String patternName) { - return i18n.getOrDefault(patternName, patternName); + return i18n == null ? patternName : i18n.getOrDefault(patternName, patternName); } public static void loadLanguageData(final Map properties) { diff --git a/src/main/java/net/minecraftforge/fml/client/ClientModLoader.java b/src/main/java/net/minecraftforge/fml/client/ClientModLoader.java index cfe224dc8..970fcd5ee 100644 --- a/src/main/java/net/minecraftforge/fml/client/ClientModLoader.java +++ b/src/main/java/net/minecraftforge/fml/client/ClientModLoader.java @@ -65,6 +65,7 @@ public class ClientModLoader } catch (LoadingFailedException e) { MinecraftForge.EVENT_BUS.shutdown(); error = e; + TEMP_printLoadingExceptions(e); } ResourcePackLoader.loadResourcePacks(defaultResourcePacks); } @@ -76,6 +77,7 @@ public class ClientModLoader } catch (LoadingFailedException e) { MinecraftForge.EVENT_BUS.shutdown(); if (error == null) error = e; + TEMP_printLoadingExceptions(e); } loading = false; mc.gameSettings.loadOptions(); @@ -116,4 +118,10 @@ public class ClientModLoader { return loading; } + + private static void TEMP_printLoadingExceptions(LoadingFailedException error) + { + error.getErrors().forEach(e -> LOGGER.error("Exception: " + e.formatToString())); + throw new RuntimeException(error); + } }