Class AbstractMultiTasksAdvancement

Direct Known Subclasses:
MultiTasksAdvancement

public abstract class AbstractMultiTasksAdvancement extends BaseAdvancement
The 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.

  • Constructor Details

    • AbstractMultiTasksAdvancement

      public AbstractMultiTasksAdvancement(@NotNull @NotNull String key, @NotNull @NotNull AdvancementDisplay display, @NotNull @NotNull Advancement parent)
      Creates an AbstractMultiTasksAdvancement with maximum progression of 1.
      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 an AbstractMultiTasksAdvancement.
      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

      public void reloadTasks(@NotNull @NotNull Player player)
      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

      public void reloadTasks(@NotNull @NotNull UUID uuid)
      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 - The UUID of the player responsible for the task's progression update.
    • reloadTasks

      public void reloadTasks(@NotNull @NotNull Player player, boolean giveRewards)
      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

      public void reloadTasks(@NotNull @NotNull UUID uuid, boolean giveRewards)
      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 - The UUID 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 - The TeamProgression of the team.
      player - The player responsible for the task's progression update, or null if there's not. In this case, the implementation can choose a random online member.