improve mod collection
All checks were successful
Publish to snapshot maven / build (push) Successful in 18s

This commit is contained in:
moehreag 2024-06-11 00:06:08 +02:00
parent 3ecd0ba812
commit 5a65161113

View file

@ -153,11 +153,8 @@ public class FrogLoaderImpl implements FrogLoader {
}
private Map<String, ModProperties> collectMods() {
Collection<ModProperties> properties = plugins.stream().map(FrogPlugin::getMods).reduce(new HashSet<>(), (s1, s2) -> {
s1.addAll(s2);
return s1;
});
return properties.stream().collect(Collectors.toMap(ModProperties::id, m -> m));
return plugins.stream().map(FrogPlugin::getMods).flatMap(Collection::stream)
.collect(Collectors.toMap(ModProperties::id, m -> m));
}
private Collection<String> collectModIds() {