Class BlockStats
java.lang.Object
com.thecsdev.commonmc.api.stats.util.SubjectStats<net.minecraft.world.level.block.Block>
com.thecsdev.commonmc.api.stats.util.BlockStats
SubjectStats utility implementation for reading statistics
about a given Block.-
Constructor Summary
ConstructorsConstructorDescriptionBlockStats(@NotNull net.minecraft.world.level.block.Block subject, @NotNull IStatsProvider statsProvider) -
Method Summary
Modifier and TypeMethodDescriptionstatic final Collection<BlockStats> getBlockStats(@NotNull IStatsProvider statsProvider, @Nullable Predicate<BlockStats> predicate, @Nullable Comparator<BlockStats> comparator) Obtains a list of allBlockStats.final @NotNull ItemStatsfinal @NotNull net.minecraft.network.chat.ComponentReturns the in-game display name of theSubjectStats.getSubject().final intReturns the value ofStats.BLOCK_MINED.final @NotNull LinkedHashMap<net.minecraft.stats.Stat<net.minecraft.world.level.block.Block>, Integer> Returns all the statistics about theSubjectStats.getSubject().Methods inherited from class SubjectStats
equals, getStatsProvider, getSubject, getSubjectID, getValuesF, getValuesF, hashCode, isEmpty, isSearchMatch
-
Constructor Details
-
BlockStats
public BlockStats(@NotNull @NotNull net.minecraft.world.level.block.Block subject, @NotNull @NotNull IStatsProvider statsProvider) throws NullPointerException, IllegalStateException - Throws:
NullPointerException- If an argument isnull.IllegalStateException- If the subject is not properly registered in the game's registries.
-
-
Method Details
-
getSubjectDisplayName
@NotNull public final @NotNull net.minecraft.network.chat.Component getSubjectDisplayName()Description copied from class:SubjectStatsReturns the in-game display name of theSubjectStats.getSubject().- Specified by:
getSubjectDisplayNamein classSubjectStats<net.minecraft.world.level.block.Block>
-
getValues
@NotNull public final @NotNull LinkedHashMap<net.minecraft.stats.Stat<net.minecraft.world.level.block.Block>, Integer> getValues()Description copied from class:SubjectStatsReturns all the statistics about theSubjectStats.getSubject().- Specified by:
getValuesin classSubjectStats<net.minecraft.world.level.block.Block>
-
getItemStats
-
getTimesMined
public final int getTimesMined()Returns the value ofStats.BLOCK_MINED. -
getBlockStats
public static final Collection<BlockStats> getBlockStats(@NotNull @NotNull IStatsProvider statsProvider, @Nullable @Nullable Predicate<BlockStats> predicate, @Nullable @Nullable Comparator<BlockStats> comparator) throws NullPointerException Obtains a list of allBlockStats.- Parameters:
statsProvider- TheIStatsProviderinstance.predicate- An optionalPredicatefor filtering the stats.comparator- An optionalComparatorfor sorting the list.- Throws:
NullPointerException- If aNotNullargument isnull.
-