use of org.spongepowered.common.advancement.SpongeTreeLayout in project SpongeCommon by SpongePowered.
the class MixinAdvancementTreeNode method onLayout.
@Inject(method = "layout", at = @At("RETURN"))
private static void onLayout(Advancement root, CallbackInfo ci) {
final AdvancementTree advancementTree = ((org.spongepowered.api.advancement.Advancement) root).getTree().get();
final TreeLayout layout = new SpongeTreeLayout((SpongeAdvancementTree) advancementTree);
SpongeImpl.postEvent(SpongeEventFactory.createAdvancementTreeEventGenerateLayout(Sponge.getCauseStackManager().getCurrentCause(), layout, advancementTree));
}
use of org.spongepowered.common.advancement.SpongeTreeLayout in project SpongeCommon by SpongePowered.
the class TreeNodePositionMixin method impl$onLayout.
@Inject(method = "run", at = @At("RETURN"))
private static void impl$onLayout(Advancement root, CallbackInfo ci) {
final AdvancementTree advancementTree = ((org.spongepowered.api.advancement.Advancement) root).tree().get();
final TreeLayout layout = new SpongeTreeLayout(advancementTree);
final Cause cause = PhaseTracker.getCauseStackManager().currentCause();
final AdvancementTreeEvent.GenerateLayout event = SpongeEventFactory.createAdvancementTreeEventGenerateLayout(cause, layout, advancementTree);
SpongeCommon.post(event);
}
Aggregations