use of org.lanternpowered.server.network.vanilla.message.type.play.MessagePlayOutSelectAdvancementTree in project LanternServer by LanternPowered.
the class LanternPlayer method registerKeys.
@Override
public void registerKeys() {
super.registerKeys();
final ValueCollection c = getValueCollection();
((ElementKeyRegistration<?, Optional<AdvancementTree>>) c.get(LanternKeys.OPEN_ADVANCEMENT_TREE).get()).addListener((oldElement, newElement) -> {
if (getWorld() != null) {
this.session.send(new MessagePlayOutSelectAdvancementTree(newElement.map(AdvancementTree::getId).orElse(null)));
}
});
}
Aggregations