use of org.spongepowered.api.GameRegistry in project LanternServer by LanternPowered.
the class LanternWorldProperties method updateWorldGenModifiers.
public void updateWorldGenModifiers(List<String> modifiers) {
final ImmutableSet.Builder<WorldGeneratorModifier> genModifiers = ImmutableSet.builder();
final GameRegistry registry = Sponge.getRegistry();
for (String modifier : modifiers) {
Optional<WorldGeneratorModifier> genModifier = registry.getType(WorldGeneratorModifier.class, modifier);
if (genModifier.isPresent()) {
genModifiers.add(genModifier.get());
} else {
Lantern.getLogger().error("World generator modifier with id " + modifier + " not found. Missing plugin?");
}
}
this.generatorModifiers = genModifiers.build();
}
Aggregations