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<>();