Class McbsSivGoal
java.lang.Object
com.thecsdev.betterstats.api.mcbs.model.goal.McbsGoal
com.thecsdev.betterstats.api.mcbs.model.goal.McbsSivGoal
- All Implemented Interfaces:
Cloneable
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<McbsSivGoal> MapCodecimplementation for serializingMcbsSivGoalinstances.static final net.minecraft.resources.IdentifiergetStatType()value that is used forMcbsSivGoalinstances constructed using the defaultMcbsSivGoal()constructor. -
Constructor Summary
ConstructorsConstructorDescriptionMcbsSivGoal(@NotNull McbsSivGoal copyFrom) McbsSivGoal(@NotNull net.minecraft.resources.Identifier statType, @NotNull net.minecraft.resources.Identifier statSubject, int targetValue) McbsSivGoal(@NotNull net.minecraft.resources.Identifier statType, @NotNull net.minecraft.resources.Identifier statSubject, int fromValue, int targetValue) -
Method Summary
Modifier and TypeMethodDescriptionfinal @NonNull McbsSivGoalclone()final voidcopyFrom(@NotNull McbsSivGoal other) Copies values of all fields from the providedMcbsSivGoalinto thisMcbsSivGoal.final intThe "starting point" value for this goal.final @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".final doublegetProgress(@NotNull McbsFile mcbsFile) Returns a value ranging from 0 to 1, that indicates current progress towards completing the goal.final @NotNull net.minecraft.network.chat.ComponentgetProgressText(@NotNull McbsFile mcbsFile) Returns visual user-friendly text that indicates current progress towards completing the goal.final @NotNull net.minecraft.resources.IdentifierThe statistic subject's unique identifier.final @NotNull net.minecraft.resources.IdentifierReturns theStatType's uniqueIdentifier.final intThe "target" value for this goal.final voidsetFromValue(int fromValue) Sets the value ofgetFromValue().final voidsetStatSubject(@NotNull net.minecraft.resources.Identifier statSubject) Sets the value ofgetStatSubject()final voidsetStatType(@NotNull net.minecraft.resources.Identifier statType) Sets the value ofgetStatType().final voidsetTargetValue(int targetValue) Sets the value ofgetTargetValue().
-
Field Details
-
CODEC
MapCodecimplementation for serializingMcbsSivGoalinstances. -
STID_EDITTHISGOAL
public static final net.minecraft.resources.Identifier STID_EDITTHISGOALgetStatType()value that is used forMcbsSivGoalinstances constructed using the defaultMcbsSivGoal()constructor.
-
-
Constructor Details
-
McbsSivGoal
public McbsSivGoal() -
McbsSivGoal
public McbsSivGoal(@NotNull @NotNull net.minecraft.resources.Identifier statType, @NotNull @NotNull net.minecraft.resources.Identifier statSubject, int targetValue) throws NullPointerException - Throws:
NullPointerException
-
McbsSivGoal
public McbsSivGoal(@NotNull @NotNull net.minecraft.resources.Identifier statType, @NotNull @NotNull net.minecraft.resources.Identifier statSubject, int fromValue, int targetValue) throws NullPointerException - Throws:
NullPointerException
-
McbsSivGoal
-
-
Method Details
-
clone
-
getStatType
@NotNull public final @NotNull net.minecraft.resources.Identifier getStatType()Returns theStatType's uniqueIdentifier.- See Also:
-
getStatSubject
@NotNull public final @NotNull net.minecraft.resources.Identifier getStatSubject()The statistic subject's unique identifier.- See Also:
-
getFromValue
public final int getFromValue()The "starting point" value for this goal. This is the value that the progress calculation will consider as "0% progress". -
getTargetValue
public final int getTargetValue()The "target" value for this goal. This is the value that the progress calculation will consider as "100% progress". -
setStatType
public final void setStatType(@NotNull @NotNull net.minecraft.resources.Identifier statType) throws NullPointerException Sets the value ofgetStatType().- Parameters:
statType- TheStatType's unique identifier.- Throws:
NullPointerException- If the argument isnull.
-
setStatSubject
public final void setStatSubject(@NotNull @NotNull net.minecraft.resources.Identifier statSubject) throws NullPointerException Sets the value ofgetStatSubject()- Parameters:
statSubject- The statistic subject.- Throws:
NullPointerException- If the argument isnull.
-
setFromValue
public final void setFromValue(int fromValue) Sets the value ofgetFromValue().- Parameters:
fromValue- The "starting point" value for this goal.
-
setTargetValue
public final void setTargetValue(int targetValue) Sets the value ofgetTargetValue().- Parameters:
targetValue- The "target" value for this goal.
-
getProgress
Description copied from class:McbsGoalReturns 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.- Specified by:
getProgressin classMcbsGoal- Parameters:
mcbsFile- TheMcbsFileto check the progress for.- Throws:
NullPointerException- If the argument isnull.
-
getProgressText
@NotNull public final @NotNull net.minecraft.network.chat.Component getProgressText(@NotNull @NotNull McbsFile mcbsFile) throws NullPointerException Description copied from class:McbsGoalReturns visual user-friendly text that indicates current progress towards completing the goal. For example "15 / 25" or "1 / 3" and so on.- Specified by:
getProgressTextin classMcbsGoal- Parameters:
mcbsFile- TheMcbsFileto get the progress text for.- Throws:
NullPointerException- If the argument isnull.
-
getObjectiveText
@NotNull public final @NotNull net.minecraft.network.chat.Component getObjectiveText()Description copied from class:McbsGoalReturns 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.- Overrides:
getObjectiveTextin classMcbsGoal- See Also:
-
copyFrom
Copies values of all fields from the providedMcbsSivGoalinto thisMcbsSivGoal.- Parameters:
other- TheMcbsSivGoalto copy values from.- Throws:
NullPointerException- If the argument isnull.
-