Class McbsGoal
java.lang.Object
com.thecsdev.betterstats.api.mcbs.model.goal.McbsGoal
- All Implemented Interfaces:
Cloneable
- Direct Known Subclasses:
McbsSivGoal
Represents a goal that a user seeks to accomplish for a given
McbsFile.
Each goal has a progress value that ranges from 0 to 1, where 1 indicates that the goal is completed.
The progress of a goal is determined by the implementation of the
getProgress(McbsFile) method.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@NotNull McbsGoalclone()@NotNull net.minecraft.network.chat.ComponentReturns the user-friendy display text for what the goal's "objective" is.
For example "Mine 100 Stone" or "Kill 30 Zombie" or "Travel 500 meters".abstract doublegetProgress(@NotNull McbsFile mcbsFile) Returns a value ranging from 0 to 1, that indicates current progress towards completing the goal.abstract @NotNull net.minecraft.network.chat.ComponentgetProgressText(@NotNull McbsFile mcbsFile) Returns visual user-friendly text that indicates current progress towards completing the goal.final @NotNull McbsGoalType<?> getType()Returns theMcbsGoalTypeof thisMcbsGoal.final boolean
-
Field Details
-
CODEC
-
-
Constructor Details
-
McbsGoal
public McbsGoal(@NotNull @NotNull McbsGoalType<?> type) throws NullPointerException, IllegalArgumentException Creates anMcbsGoalinstance.- Parameters:
type- The correspondingMcbsGoalTypeinstance.- Throws:
NullPointerException- If the argument isnull.IllegalArgumentException- IfMcbsGoalType.getBaseClass()does not matchthis.Object.getClass().
-
-
Method Details
-
clone
- Overrides:
clonein classObject- Throws:
IllegalStateException
-
getType
Returns theMcbsGoalTypeof thisMcbsGoal. -
getProgress
@Contract(pure=true) public abstract double getProgress(@NotNull @NotNull McbsFile mcbsFile) throws NullPointerException Returns a value ranging from 0 to 1, that indicates current progress towards completing the goal. A value of 1 indicates that the goal is completed.- Parameters:
mcbsFile- TheMcbsFileto check the progress for.- Throws:
NullPointerException- If the argument isnull.
-
getProgressText
@Contract(pure=true) @NotNull public abstract @NotNull net.minecraft.network.chat.Component getProgressText(@NotNull @NotNull McbsFile mcbsFile) throws NullPointerException Returns visual user-friendly text that indicates current progress towards completing the goal. For example "15 / 25" or "1 / 3" and so on.- Parameters:
mcbsFile- TheMcbsFileto get the progress text for.- Throws:
NullPointerException- If the argument isnull.
-
isDone
- Parameters:
mcbsFile- TheMcbsFileto check the progress for.
-
getObjectiveText
@Contract(pure=true) @Virtual @NotNull public @NotNull net.minecraft.network.chat.Component getObjectiveText()Returns the user-friendy display text for what the goal's "objective" is.
For example "Mine 100 Stone" or "Kill 30 Zombie" or "Travel 500 meters".This differs from
McbsGoalType.getName()in the fact that goal type name is a generic name that applies to all correspondingMcbsGoalinstances.- See Also:
-