Repository navigation
Unredeemed Advancements
When an advancement is granted to a team while no one of that team is online, it becomes unreedemed.
This situation can happen, for example, if an advancement requires to make a tree grows. Since the tree can grow when everyone is offline, in this case it would become unredeemed.
Usually, when an advancement is granted the method Advancement#onGrant(Player player, boolean giveRewards) gets called. That will handle the granting, so it will print the announce message to everybody, send the toast notification and call Advancement#giveReward(Player player).
However, calling onGrant(...) is not possible if the player completing the advancement is offline, because the Player object is not available.
Here, unredeemed advancements comes into play.
If no team members are online, when a granting occours the onGrant(...) method is not called. Instead, the advancement is set unredeemed.
This way, the advancement for that team will result granted (the current progression is equal to the maximum progression), but the onGrant(...) method has not been called yet. It will be called when a player of that team joins the server.
Note that an unredeemed advancement is automatically unset unredeemed when a player of the team joins.
-
UltimateAdvancementAPI#setUnredeemed(...)- Sets an advancement unredeemed for a team; -
UltimateAdvancementAPI#unsetUnredeemed(...)- Remove the unredeemed status to the advancement for a team; -
UltimateAdvancementAPI#isUnredeemed(...)- Gets whether an advancement is unredeemed for a team.
UltimateAdvancementAPI Wiki © 2021 fren_gor, EscanorTargaryen is licensed under CC BY-SA 4.0.
Except where otherwise noted, code snippets inside the wiki are licensed under The Unlicense.