Class CustomStatisticCriterion
java.lang.Object
com.github.darksoulq.abyssallib.world.advancement.criterion.CustomStatisticCriterion
- All Implemented Interfaces:
AdvancementCriterion
An advancement criterion evaluating a custom statistic tracked in the AbyssalLib database.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Codec<CustomStatisticCriterion> The codec used for serializing and deserializing the custom statistic criterion.static final CriterionType<CustomStatisticCriterion> The registered type definition for the custom statistic criterion. -
Constructor Summary
ConstructorsConstructorDescriptionCustomStatisticCriterion(Statistic stat, int threshold) Constructs a new CustomStatisticCriterion. -
Method Summary
Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface AdvancementCriterion
isMet
-
Field Details
-
CODEC
The codec used for serializing and deserializing the custom statistic criterion. -
TYPE
The registered type definition for the custom statistic criterion.
-
-
Constructor Details
-
CustomStatisticCriterion
Constructs a new CustomStatisticCriterion.- Parameters:
stat- The statistic to track.threshold- The required value.
-
-
Method Details
-
getType
Description copied from interface:AdvancementCriterionRetrieves the type definition associated with this specific criterion instance. This is used for identifying the logic and serialization codec.- Specified by:
getTypein interfaceAdvancementCriterion- Returns:
- The
CriterionTypecharacterizing this instance.
-
isMet
public boolean isMet(org.bukkit.entity.Player player) Checks if the player has accumulated the required statistic amount.- Specified by:
isMetin interfaceAdvancementCriterion- Parameters:
player- The player to evaluate.- Returns:
- True if the condition is met.
-