Interface ScoreCriterionProgress
- All Superinterfaces:
CriterionProgress
,Progressable
Represents the progress of a
ScoreAdvancementCriterion
.-
Method Summary
Modifier and TypeMethodDescriptionadd
(int score) Adds the target score value, the score cannot exceed the goal value (goal()
).Gets theAdvancementCriterion
.default int
goal()
Gets the goal value.remove
(int score) Removes the target score value, the score cannot go under zero.int
score()
Gets the score value.set
(int score) Adds the target score value, the score cannot exceed the goal value (goal()
) or be under zero.Methods inherited from interface org.spongepowered.api.advancement.Progressable
achieved, get, grant, revoke
-
Method Details
-
criterion
ScoreAdvancementCriterion criterion()Description copied from interface:CriterionProgress
Gets theAdvancementCriterion
.- Specified by:
criterion
in interfaceCriterionProgress
- Returns:
- The criterion
-
goal
default int goal()Gets the goal value.- Returns:
- The goal value
-
score
int score()Gets the score value.- Returns:
- The score value
-
set
Adds the target score value, the score cannot exceed the goal value (goal()
) or be under zero. The achieved time will be returned if the goal is met.- Parameters:
score
- The score to set- Returns:
- The achieving time, if achieved
-
add
Adds the target score value, the score cannot exceed the goal value (goal()
). The achieved time will be returned if the goal is met.- Parameters:
score
- The score to add- Returns:
- The achieving time, if achieved
-
remove
Removes the target score value, the score cannot go under zero. The achieved time will be returned if the goal is met before.- Parameters:
score
- The score to remove- Returns:
- The old achieving time, if achieved before
-