Class CustomAdvancementProgress

java.lang.Object
com.github.darksoulq.abyssallib.world.advancement.CustomAdvancementProgress

public class CustomAdvancementProgress extends Object
A wrapper for player-specific advancement progress. This class links the custom Advancement logic with the underlying Bukkit AdvancementProgress, handling reward granting upon completion.
  • Constructor Details

    • CustomAdvancementProgress

      public CustomAdvancementProgress(Advancement advancement, org.bukkit.entity.Player player, org.bukkit.advancement.AdvancementProgress bukkitProgress)
      Constructs a new CustomAdvancementProgress wrapper.
      Parameters:
      advancement - The custom Advancement instance.
      player - The Player making progress.
      bukkitProgress - The actual Bukkit progress object.
  • Method Details

    • getAdvancement

      public Advancement getAdvancement()
      Retrieves the custom advancement instance.
      Returns:
      The associated Advancement.
    • getPlayer

      public org.bukkit.entity.Player getPlayer()
      Retrieves the player whose progress is being tracked.
      Returns:
      The Player instance.
    • isDone

      public boolean isDone()
      Checks if all criteria for this advancement have been met.
      Returns:
      True if the advancement is fully completed.
    • getAwardedCriteria

      public Collection<String> getAwardedCriteria()
      Retrieves a collection of all criteria identifiers already awarded to the player.
      Returns:
      A Collection of awarded criterion names.
    • getRemainingCriteria

      public Collection<String> getRemainingCriteria()
      Retrieves a collection of criteria identifiers still required for completion.
      Returns:
      A Collection of remaining criterion names.
    • getDateAwarded

      public Date getDateAwarded(String criterion)
      Retrieves the date and time a specific criterion was awarded.
      Parameters:
      criterion - The name of the criterion to check.
      Returns:
      The Date of award, or null if not yet awarded.
    • awardCriterion

      public void awardCriterion(String criterion)
      Awards a specific criterion to the player. If this award completes the advancement, all registered rewards are granted automatically.
      Parameters:
      criterion - The name of the criterion to award.
    • revokeCriterion

      public void revokeCriterion(String criterion)
      Revokes a specific criterion from the player, effectively resetting that part of the progress.
      Parameters:
      criterion - The name of the criterion to revoke.