Better error passing from early to game client launch.

This commit is contained in:
cpw committed 2018-10-04 00:57:08 -04:00
1 parent c6e7bbe18b
commit d5e04dbcb5
16 files changed
+183 -119

No files matched your search

@@ -60,7 +60,7 @@ public class ModLoader
this.loadingModList = FMLLoader.getLoadingModList();
this.modClassLoader = new ModLoadingClassLoader(this.launchClassLoader);
this.loadingExceptions = FMLLoader.getLoadingModList().
getErrors().stream().map(ModLoadingException::fromEarlyException).collect(Collectors.toList());
getErrors().stream().flatMap(ModLoadingException::fromEarlyException).collect(Collectors.toList());
Thread.currentThread().setContextClassLoader(this.modClassLoader);
}
@@ -75,9 +75,6 @@ public class ModLoader
}
public void loadMods() {
if (!this.loadingExceptions.isEmpty()) {
throw new LoadingFailedException(loadingExceptions);
}
final ModList modList = ModList.of(loadingModList.getModFiles().stream().map(ModFileInfo::getFile).collect(Collectors.toList()), loadingModList.getMods());
ModContainer forgeModContainer;
try
@@ -88,9 +85,12 @@ public class ModLoader
catch (ClassNotFoundException | IllegalAccessException | NoSuchMethodException | InstantiationException | InvocationTargetException e)
{
LOGGER.error(CORE,"Unable to load the Forge Mod Container", e);
loadingExceptions.add(new ModLoadingException(DefaultModInfos.forgeModInfo, ModLoadingStage.CONSTRUCT, "fml.modloading.failedtoloadforge", e));
loadingExceptions.add(new ModLoadingException(DefaultModInfos.forgeModInfo, ModLoadingStage.VALIDATE, "fml.modloading.failedtoloadforge", e));
forgeModContainer = null;
}
if (!this.loadingExceptions.isEmpty()) {
throw new LoadingFailedException(loadingExceptions);
}
final Stream<ModContainer> modContainerStream = loadingModList.getModFiles().stream().
map(ModFileInfo::getFile).
map(mf -> buildMods(mf, modClassLoader)).