diff --git a/src/fmllauncher/java/net/minecraftforge/fml/loading/ModSorter.java b/src/fmllauncher/java/net/minecraftforge/fml/loading/ModSorter.java index bb613313e..86a9ec3bf 100644 --- a/src/fmllauncher/java/net/minecraftforge/fml/loading/ModSorter.java +++ b/src/fmllauncher/java/net/minecraftforge/fml/loading/ModSorter.java @@ -50,6 +50,7 @@ public class ModSorter private List modFiles; private List sortedList; private Map modIdNameLookup; + private List forgeAndMC; private ModSorter(final List modFiles) { @@ -63,7 +64,7 @@ public class ModSorter ms.buildUniqueList(); } catch (EarlyLoadingException e) { // We cannot build any list with duped mods. We have to abort immediately and report it - return LoadingModList.of(Collections.emptyList(), Collections.emptyList(), e); + return LoadingModList.of(ms.forgeAndMC, ms.forgeAndMC.stream().map(mf->(ModInfo)mf.getModInfos().get(0)).collect(Collectors.toList()), e); } // try and locate languages and validate dependencies List missingLangs = ms.findLanguages(); @@ -71,7 +72,7 @@ public class ModSorter final List failedList = Stream.concat(missingLangs.stream(), missingDeps.stream()).collect(Collectors.toList()); // if we miss one or the other, we abort now if (!failedList.isEmpty()) { - return LoadingModList.of(Collections.emptyList(), Collections.emptyList(), new EarlyLoadingException("failure to validate mod list", null, failedList)); + return LoadingModList.of(ms.forgeAndMC, ms.forgeAndMC.stream().map(mf->(ModInfo)mf.getModInfos().get(0)).collect(Collectors.toList()), new EarlyLoadingException("failure to validate mod list", null, failedList)); } else { // Otherwise, lets try and sort the modlist and proceed EarlyLoadingException earlyLoadingException = null; @@ -181,6 +182,11 @@ public class ModSorter .stream() .collect(Collectors.groupingBy(mf -> mf.getModInfos().get(0).getModId())); + // Capture forge and MC here, so we can keep them for later + forgeAndMC = new ArrayList<>(); + forgeAndMC.add((ModFile)modFilesByFirstId.get("minecraft").get(0)); + forgeAndMC.add((ModFile)modFilesByFirstId.get("forge").get(0)); + // Select the newest by artifact version sorting of non-unique files thus identified this.modFiles = modFilesByFirstId.entrySet().stream() .map(this::selectNewestModInfo)