Fix crash when crashing during modloading. Fix GuiModList being weird.

Signed-off-by: cpw <cpw+github@weeksfamily.ca>
This commit is contained in:
cpw committed 2019-06-23 14:37:05 -04:00
1 parent 9067dbf6a0
commit be415091cd
3 files changed
+8 -4

No files matched your search

@@ -143,6 +143,8 @@ public class ModLoader
statusConsumer.ifPresent(c->c.accept("Loading mods"));
final ModList modList = ModList.of(loadingModList.getModFiles().stream().map(ModFileInfo::getFile).collect(Collectors.toList()), loadingModList.getMods());
if (!this.loadingExceptions.isEmpty()) {
LOGGER.fatal(CORE, "Error during pre-loading phase", loadingExceptions.get(0));
modList.setLoadedMods(Collections.emptyList());
throw new LoadingFailedException(loadingExceptions);
}
statusConsumer.ifPresent(c->c.accept("Building Mod List"));
@@ -152,7 +154,8 @@ public class ModLoader
flatMap(Collection::stream).
collect(Collectors.toList());
if (!loadingExceptions.isEmpty()) {
LOGGER.fatal(CORE, "Failed to initialize mod containers");
LOGGER.fatal(CORE, "Failed to initialize mod containers", loadingExceptions.get(0));
modList.setLoadedMods(Collections.emptyList());
throw new LoadingFailedException(loadingExceptions);
}
modList.setLoadedMods(modContainers);