use of com.teamabnormals.blueprint.core.util.modification.TargetedModifier in project blueprint by team-abnormals.
the class ChunkGeneratorModificationManager method apply.
@Override
protected void apply(Map<ResourceLocation, JsonElement> map, ResourceManager resourceManager, ProfilerFiller profilerFiller) {
RegistryOps<JsonElement> registryOps = this.registryOps;
int loadedModifiers = 0;
for (Map.Entry<ResourceLocation, JsonElement> entry : map.entrySet()) {
try {
TargetedModifier<ChunkGenerator, RegistryOps<JsonElement>, RegistryOps<JsonElement>> targetedModifier = TargetedModifier.deserialize(entry.getValue().getAsJsonObject(), registryOps, ChunkGeneratorModifiers.REGISTRY);
this.modifiers.computeIfAbsent(targetedModifier.getPriority(), __ -> new LinkedList<>()).add(targetedModifier);
loadedModifiers++;
} catch (IllegalArgumentException | JsonParseException exception) {
Blueprint.LOGGER.error("Parsing error loading Chunk Generator Modifier: {}", entry.getKey(), exception);
}
}
Blueprint.LOGGER.info("Chunk Generator Modification Manager has loaded {} modifiers", loadedModifiers);
}
Aggregations