Class EntityStats
java.lang.Object
com.thecsdev.commonmc.api.stats.util.SubjectStats<net.minecraft.world.entity.EntityType<?>>
com.thecsdev.commonmc.api.stats.util.EntityStats
SubjectStats utility implementation for reading statistics
about a given EntityType.-
Constructor Summary
ConstructorsConstructorDescriptionEntityStats(@NotNull net.minecraft.world.entity.EntityType<?> subject, @NotNull IStatsProvider statsProvider) -
Method Summary
Modifier and TypeMethodDescriptionfinal intReturns the value ofStats.ENTITY_KILLED_BY.static final Collection<EntityStats> getEntityStats(@NotNull IStatsProvider statsProvider, @Nullable Predicate<EntityStats> predicate, @Nullable Comparator<EntityStats> comparator) Obtains a list of allEntityStats.final intgetKills()Returns the value ofStats.ENTITY_KILLED.final @NotNull net.minecraft.network.chat.ComponentReturns the in-game display name of theSubjectStats.getSubject().final @NotNull LinkedHashMap<net.minecraft.stats.Stat<net.minecraft.world.entity.EntityType<?>>, Integer> Returns all the statistics about theSubjectStats.getSubject().Methods inherited from class SubjectStats
equals, getStatsProvider, getSubject, getSubjectID, getValuesF, getValuesF, hashCode, isEmpty, isSearchMatch
-
Constructor Details
-
EntityStats
public EntityStats(@NotNull @NotNull net.minecraft.world.entity.EntityType<?> 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.entity.EntityType<?>>
-
getValues
@NotNull public final @NotNull LinkedHashMap<net.minecraft.stats.Stat<net.minecraft.world.entity.EntityType<?>>, Integer> getValues()Description copied from class:SubjectStatsReturns all the statistics about theSubjectStats.getSubject().- Specified by:
getValuesin classSubjectStats<net.minecraft.world.entity.EntityType<?>>
-
getKills
public final int getKills()Returns the value ofStats.ENTITY_KILLED. -
getDeaths
public final int getDeaths()Returns the value ofStats.ENTITY_KILLED_BY. -
getEntityStats
public static final Collection<EntityStats> getEntityStats(@NotNull @NotNull IStatsProvider statsProvider, @Nullable @Nullable Predicate<EntityStats> predicate, @Nullable @Nullable Comparator<EntityStats> comparator) throws NullPointerException Obtains a list of allEntityStats.- Parameters:
statsProvider- TheIStatsProviderinstance.predicate- An optionalPredicatefor filtering the stats.comparator- An optionalComparatorfor sorting the list.- Throws:
NullPointerException- If aNotNullargument isnull.
-