use of net.minecraft.advancements.Advancement.Builder in project blueprint by team-abnormals.
the class AdvancementModificationManager method apply.
@Override
protected void apply(Map<ResourceLocation, JsonElement> map, ResourceManager resourceManager, ProfilerFiller profiler) {
this.reset();
SelectionSpace unmodifiedAdvancements = this.getUnmodifiedEntries();
for (Map.Entry<ResourceLocation, JsonElement> entry : map.entrySet()) {
ResourceLocation resourcelocation = entry.getKey();
if (resourcelocation.getPath().startsWith("_"))
continue;
try {
TargetedModifier<Builder, Void, DeserializationContext> targetedAdvancementModifier = TargetedModifier.deserialize(entry.getValue().getAsJsonObject(), "advancement", new DeserializationContext(resourcelocation, this.lootPredicateManager), AdvancementModifiers.REGISTRY, true);
this.addModifiers(targetedAdvancementModifier.getTargetSelector().getTargetNames(unmodifiedAdvancements), targetedAdvancementModifier.getPriority(), targetedAdvancementModifier.getConfiguredModifiers());
} catch (IllegalArgumentException | JsonParseException jsonparseexception) {
Blueprint.LOGGER.error("Parsing error loading Advancement Modifier: {}", resourcelocation, jsonparseexception);
}
}
Blueprint.LOGGER.info("Advancement Modification Manager has assigned {} sets of modifiers", this.size());
}
Aggregations