Class McbsStats
java.lang.Object
com.thecsdev.betterstats.api.mcbs.model.McbsStats
- All Implemented Interfaces:
com.thecsdev.commonmc.api.stats.IStatsProvider
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceFunctionalInterfacefor consuming integer values stored in anMcbsStatsinstance. -
Method Summary
Modifier and TypeMethodDescriptionfinal voidaddAll(@NotNull com.thecsdev.commonmc.api.stats.IStatsProvider statsProvider) AddsStatentries from anotherIStatsProviderinto this one, summing up values where applicable.final voidclear()Clears all statistics data.final voidclearAndAddAll(@NotNull com.thecsdev.commonmc.api.stats.IStatsProvider statsProvider) Clears all existingStatentries and adds all entries from anotherIStatsProvider.final voidforEach(McbsStats.IntValueConsumer consumer) Iterates all integer values stored in thisMcbsStatsinstance.final intgetIntValue(@NotNull net.minecraft.resources.Identifier type, @NotNull net.minecraft.resources.Identifier subject) Returns the value of a given integer-based statistic.final <T> intgetIntValue(@NotNull net.minecraft.stats.Stat<T> stat) Returns the value of a given integer-based statistic.final <T> intgetIntValue(@NotNull net.minecraft.stats.StatType<T> type, T subject) Returns the value of a given integer-based statistic.final @NotNull ConcurrentHashMap<net.minecraft.resources.Identifier, ConcurrentHashMap<net.minecraft.resources.Identifier, Integer>> Returns raw direct access to the mainMapthat holds all integer-based statistics values.final @NotNull ConcurrentHashMap<net.minecraft.resources.Identifier, Integer> getIntValues(@NotNull net.minecraft.resources.Identifier type) Returns theMapthat contains integer-based statistics values for a givenStatType.final voidsetIntValue(@NotNull net.minecraft.resources.Identifier type, @NotNull net.minecraft.resources.Identifier subject, int value) Sets the value of a given integer-based statistic.final <T> voidsetIntValue(@NotNull net.minecraft.stats.Stat<T> stat, int value) Sets the value of a given integer-based statistic.final <T> voidsetIntValue(@NotNull net.minecraft.stats.StatType<T> type, T subject, int value) Sets the value of a given integer-based statistic.
-
Method Details
-
getIntValues
@NotNull public final @NotNull ConcurrentHashMap<net.minecraft.resources.Identifier, ConcurrentHashMap<net.minecraft.resources.Identifier, Integer>> getIntValues()Returns raw direct access to the mainMapthat holds all integer-based statistics values. -
getIntValues
@NotNull public final @NotNull ConcurrentHashMap<net.minecraft.resources.Identifier, Integer> getIntValues(@NotNull @NotNull net.minecraft.resources.Identifier type) throws NullPointerException Returns theMapthat contains integer-based statistics values for a givenStatType.- Parameters:
type- TheStatType's unique identifier.- Throws:
NullPointerException- If the argument isnull.
-
getIntValue
public final <T> int getIntValue(@NotNull @NotNull net.minecraft.stats.Stat<T> stat) throws NullPointerException Returns the value of a given integer-based statistic.- Specified by:
getIntValuein interfacecom.thecsdev.commonmc.api.stats.IStatsProvider- Parameters:
stat- TheStatwhose value is to be returned.- Throws:
NullPointerException- If the argument isnull.IllegalStateException- If a corresponding feature is not registered.
-
getIntValue
public final <T> int getIntValue(@NotNull @NotNull net.minecraft.stats.StatType<T> type, @NotNull T subject) throws NullPointerException, IllegalStateException Returns the value of a given integer-based statistic.- Specified by:
getIntValuein interfacecom.thecsdev.commonmc.api.stats.IStatsProvider- Parameters:
type- TheStatType.subject- The statistic subject.- Throws:
NullPointerException- If an argument isnull.IllegalStateException- If a corresponding feature is not registered.
-
getIntValue
public final int getIntValue(@NotNull @NotNull net.minecraft.resources.Identifier type, @NotNull @NotNull net.minecraft.resources.Identifier subject) throws NullPointerException Returns the value of a given integer-based statistic.- Parameters:
type- TheStatType's unique identifier.subject- The statistic subject's unique identifier.- Throws:
NullPointerException- If an argument isnull.
-
setIntValue
public final <T> void setIntValue(@NotNull @NotNull net.minecraft.stats.Stat<T> stat, int value) throws NullPointerException Sets the value of a given integer-based statistic.- Parameters:
stat- TheStatwhose value is to be set.value- The value to set.- Throws:
NullPointerException- If the argument isnull.
-
setIntValue
public final <T> void setIntValue(@NotNull @NotNull net.minecraft.stats.StatType<T> type, @NotNull T subject, int value) throws NullPointerException, IllegalStateException Sets the value of a given integer-based statistic.- Parameters:
type- TheStatType.subject- The statistic subject.value- The value to set.- Throws:
NullPointerException- If an argument isnull.IllegalStateException- If a corresponding feature is not registered.
-
setIntValue
public final void setIntValue(@NotNull @NotNull net.minecraft.resources.Identifier type, @NotNull @NotNull net.minecraft.resources.Identifier subject, int value) throws NullPointerException Sets the value of a given integer-based statistic.- Parameters:
type- TheStatType's unique identifier.subject- The statistic subject's unique identifier.value- The value to set.- Throws:
NullPointerException- If an argument isnull.
-
addAll
public final void addAll(@NotNull @NotNull com.thecsdev.commonmc.api.stats.IStatsProvider statsProvider) AddsStatentries from anotherIStatsProviderinto this one, summing up values where applicable. SupportsMcbsStatsinstances as argument.- Parameters:
statsProvider- The otherIStatsProvider.- Throws:
NullPointerException- If the argument isnull.
-
clearAndAddAll
public final void clearAndAddAll(@NotNull @NotNull com.thecsdev.commonmc.api.stats.IStatsProvider statsProvider) throws NullPointerException Clears all existingStatentries and adds all entries from anotherIStatsProvider.- Parameters:
statsProvider- The otherIStatsProvider.- Throws:
NullPointerException- If the argument isnull.
-
clear
public final void clear()Clears all statistics data. -
forEach
Iterates all integer values stored in thisMcbsStatsinstance. Note that this does not offer value manipulation capabilities.- Parameters:
consumer- The consumer that will consume each value.- Throws:
NullPointerException- If the argument isnull.
-