Class CustomAdvancementProgress
java.lang.Object
com.github.darksoulq.abyssallib.world.advancement.CustomAdvancementProgress
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 Summary
ConstructorsConstructorDescriptionCustomAdvancementProgress(Advancement advancement, org.bukkit.entity.Player player, org.bukkit.advancement.AdvancementProgress bukkitProgress) Constructs a new CustomAdvancementProgress wrapper. -
Method Summary
Modifier and TypeMethodDescriptionvoidawardCriterion(String criterion) Awards a specific criterion to the player.Retrieves the custom advancement instance.Retrieves a collection of all criteria identifiers already awarded to the player.getDateAwarded(String criterion) Retrieves the date and time a specific criterion was awarded.org.bukkit.entity.PlayerRetrieves the player whose progress is being tracked.Retrieves a collection of criteria identifiers still required for completion.booleanisDone()Checks if all criteria for this advancement have been met.voidrevokeCriterion(String criterion) Revokes a specific criterion from the player, effectively resetting that part of the progress.
-
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 customAdvancementinstance.player- ThePlayermaking progress.bukkitProgress- The actual Bukkit progress object.
-
-
Method Details
-
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
Playerinstance.
-
isDone
public boolean isDone()Checks if all criteria for this advancement have been met.- Returns:
- True if the advancement is fully completed.
-
getAwardedCriteria
Retrieves a collection of all criteria identifiers already awarded to the player.- Returns:
- A
Collectionof awarded criterion names.
-
getRemainingCriteria
Retrieves a collection of criteria identifiers still required for completion.- Returns:
- A
Collectionof remaining criterion names.
-
getDateAwarded
-
awardCriterion
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
Revokes a specific criterion from the player, effectively resetting that part of the progress.- Parameters:
criterion- The name of the criterion to revoke.
-