use of org.spongepowered.common.bridge.advancements.AdvancementBridge in project SpongeCommon by SpongePowered.
the class SpongeAdvancementBuilder method build0.
@Override
public Advancement build0() {
final Tuple<Map<String, Criterion>, String[][]> result = SpongeCriterionUtil.toVanillaCriteriaData(this.criterion);
final AdvancementRewards rewards = AdvancementRewards.EMPTY;
final ResourceLocation resourceLocation = (ResourceLocation) (Object) key;
final net.minecraft.advancements.DisplayInfo displayInfo = this.displayInfo == null ? null : new net.minecraft.advancements.DisplayInfo(ItemStackUtil.fromSnapshotToNative(this.displayInfo.icon()), SpongeAdventure.asVanilla(this.displayInfo.title()), SpongeAdventure.asVanilla(this.displayInfo.description()), this.backgroundPath, (FrameType) (Object) this.displayInfo.type(), this.displayInfo.doesShowToast(), this.displayInfo.doesAnnounceToChat(), this.displayInfo.isHidden());
final net.minecraft.advancements.Advancement parent = (net.minecraft.advancements.Advancement) this.parent;
final Advancement advancement = (Advancement) new net.minecraft.advancements.Advancement(resourceLocation, parent, displayInfo, rewards, result.first(), result.second());
((AdvancementBridge) advancement).bridge$setCriterion(this.criterion);
return advancement;
}
Aggregations