From dc9a7f6ad5f162023e77f8d171c06c671183a589 Mon Sep 17 00:00:00 2001 From: Minecraftschurli Date: Tue, 9 Nov 2021 23:27:17 +0100 Subject: [PATCH] Fix the hopefully last issue with GAMELIBRARY loading (#8162) --- .../main/java/net/minecraftforge/fml/loading/ModSorter.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fmlloader/src/main/java/net/minecraftforge/fml/loading/ModSorter.java b/fmlloader/src/main/java/net/minecraftforge/fml/loading/ModSorter.java index 3f7056ab64..3472c95fc3 100644 --- a/fmlloader/src/main/java/net/minecraftforge/fml/loading/ModSorter.java +++ b/fmlloader/src/main/java/net/minecraftforge/fml/loading/ModSorter.java @@ -92,6 +92,7 @@ public class ModSorter AtomicInteger counter = new AtomicInteger(); Map infos = modFiles.stream() .map(ModFile::getModFileInfo) + .filter(ModFileInfo.class::isInstance) .collect(toMap(Function.identity(), e -> counter.incrementAndGet())); infos.keySet().forEach(i -> graph.addNode((ModFileInfo) i)); modFiles.stream() @@ -150,9 +151,9 @@ public class ModSorter private void buildUniqueList() { - // Collect mod files by first modid in the file. This will be used for deduping purposes + // Collect mod files by module name. This will be used for deduping purposes final Map> modFilesByFirstId = modFiles.stream() - .collect(groupingBy(mf -> mf.getModInfos().get(0).getModId())); + .collect(groupingBy(mf -> mf.getModFileInfo().moduleName())); // Capture forge and MC here, so we can keep them for later forgeAndMC = new ArrayList<>();