Fix problem with duplicate mods caused by duplicate classes found during scan.

File Scan results are now sets.

Signed-off-by: cpw <cpw+github@weeksfamily.ca>
This commit is contained in:
cpw committed 2019-02-27 23:34:23 -05:00
1 parent dd7e7fc122
commit 7f1ea578d6
4 files changed
+10 -3

No files matched your search

@@ -95,7 +95,7 @@ public class FMLJavaModLanguageProvider implements IModLanguageProvider
.filter(ad -> ad.getAnnotationType().equals(MODANNOTATION))
.peek(ad -> LOGGER.debug(SCAN, "Found @Mod class {} with id {}", ad.getClassType().getClassName(), ad.getAnnotationData().get("value")))
.map(ad -> new FMLModTarget(ad.getClassType().getClassName(), (String)ad.getAnnotationData().get("value")))
.collect(Collectors.toMap(FMLModTarget::getModId, Function.identity()));
.collect(Collectors.toMap(FMLModTarget::getModId, Function.identity(), (a,b)->a));
scanResult.addLanguageLoader(modTargetMap);
};
}