Class AbstractMultiTasksAdvancement
- Direct Known Subclasses:
MultiTasksAdvancement
AbstractMultiTasksAdvancement
class abstracts the implementation of any multi-tasks advancement,
providing a standard supported by the API.
A multi-task advancement is an advancement that separates its progression into different progressions (one per task).
An implementation of a task is TaskAdvancement
, which works with any AbstractMultiTasksAdvancement
,
whereas an implementation of AbstractMultiTasksAdvancement
is MultiTasksAdvancement
.
-
Field Summary
Fields inherited from class com.fren_gor.ultimateAdvancementAPI.advancement.BaseAdvancement
parent
Fields inherited from class com.fren_gor.ultimateAdvancementAPI.advancement.Advancement
advancementTab, display, key, maxProgression
-
Constructor Summary
ConstructorDescriptionAbstractMultiTasksAdvancement
(@NotNull String key, @NotNull AdvancementDisplay display, @NotNull Advancement parent) Creates anAbstractMultiTasksAdvancement
with maximum progression of1
.AbstractMultiTasksAdvancement
(@NotNull String key, @NotNull AdvancementDisplay display, @NotNull Advancement parent, @Range(from=1, to=Integer.MAX_VALUE) int maxProgression) Creates anAbstractMultiTasksAdvancement
. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
reloadTasks
(@NotNull TeamProgression progression, @Nullable Player player, boolean giveRewards) Reloads and updates the tasks to the provided team members.void
reloadTasks
(@NotNull UUID uuid) Reloads and updates the tasks to the provided player's team members.void
reloadTasks
(@NotNull UUID uuid, boolean giveRewards) Reloads and updates the tasks to the provided player's team members.void
reloadTasks
(@NotNull Player player) Reloads and updates the tasks to the provided player's team members.void
reloadTasks
(@NotNull Player player, boolean giveRewards) Reloads and updates the tasks to the provided player's team members.Methods inherited from class com.fren_gor.ultimateAdvancementAPI.advancement.BaseAdvancement
getNMSWrapper, getParent, validateRegister
Methods inherited from class com.fren_gor.ultimateAdvancementAPI.advancement.Advancement
displayToastToPlayer, equals, getAdvancementTab, getAnnounceMessage, getDisplay, getKey, getMaxProgression, getProgression, getProgression, getProgression, giveReward, grant, grant, handlePlayer, hashCode, incrementProgression, incrementProgression, incrementProgression, incrementProgression, incrementProgression, incrementProgression, incrementProgression, incrementProgression, incrementProgression, isGranted, isGranted, isGranted, isValid, isVisible, isVisible, isVisible, onDispose, onGrant, onRegister, onUpdate, registerEvent, registerEvent, revoke, setProgression, setProgression, setProgression, setProgression, setProgression, toString
-
Constructor Details
-
AbstractMultiTasksAdvancement
public AbstractMultiTasksAdvancement(@NotNull @NotNull String key, @NotNull @NotNull AdvancementDisplay display, @NotNull @NotNull Advancement parent) Creates anAbstractMultiTasksAdvancement
with maximum progression of1
.- Parameters:
key
- The unique key of the advancement. It must be unique among the other advancements of the tab.display
- The display information of this advancement.parent
- The parent of this advancement.
-
AbstractMultiTasksAdvancement
public AbstractMultiTasksAdvancement(@NotNull @NotNull String key, @NotNull @NotNull AdvancementDisplay display, @NotNull @NotNull Advancement parent, @Range(from=1, to=Integer.MAX_VALUE) int maxProgression) Creates anAbstractMultiTasksAdvancement
.- Parameters:
key
- The unique key of the advancement. It must be unique among the other advancements of the tab.display
- The display information of this advancement.parent
- The parent of this advancement.maxProgression
- The maximum progression of the task.
-
-
Method Details
-
reloadTasks
Reloads and updates the tasks to the provided player's team members.This method should be invoked when the progression of a task changes.
If the advancement gets completed, advancement rewards will be given.
- Parameters:
player
- The player responsible for the task's progression update.
-
reloadTasks
Reloads and updates the tasks to the provided player's team members.This method should be invoked when the progression of a task changes.
If the advancement gets completed, advancement rewards will be given.
- Parameters:
uuid
- TheUUID
of the player responsible for the task's progression update.
-
reloadTasks
Reloads and updates the tasks to the provided player's team members.This method should be invoked when the progression of a task changes.
- Parameters:
player
- The player responsible for the task's progression update.giveRewards
- Whether to give the player the advancement rewards if the advancement gets completed.
-
reloadTasks
Reloads and updates the tasks to the provided player's team members.This method should be invoked when the progression of a task changes.
- Parameters:
uuid
- TheUUID
of the player responsible for the task's progression update.giveRewards
- Whether to give the player the advancement rewards if the advancement gets completed.
-
reloadTasks
protected abstract void reloadTasks(@NotNull @NotNull TeamProgression progression, @Nullable @Nullable Player player, boolean giveRewards) Reloads and updates the tasks to the provided team members.This method should be invoked when the progression of a task changes.
- Parameters:
progression
- TheTeamProgression
of the team.player
- The player responsible for the task's progression update, ornull
if there's not. In this case, the implementation can choose a random online member.
-