Class LocalPlayerStatsProvider
java.lang.Object
com.thecsdev.commonmc.api.stats.PlayerStatsProvider<@NotNull net.minecraft.client.player.LocalPlayer>
com.thecsdev.commonmc.api.client.stats.LocalPlayerStatsProvider
- All Implemented Interfaces:
IStatsProvider
@Environment(CLIENT)
public final class LocalPlayerStatsProvider
extends PlayerStatsProvider<@NotNull net.minecraft.client.player.LocalPlayer>
A
IStatsProvider that provides statistics of a LocalPlayer.-
Method Summary
Modifier and TypeMethodDescriptionfinal booleanfinal <T> intgetIntValue(@NotNull net.minecraft.stats.StatType<T> type, T subject) final <T> intgetIntValue(net.minecraft.stats.Stat<T> stat) Returns theIntegervalue of a givenStat.final net.minecraft.client.player.LocalPlayerReturns thePlayerinstance thisPlayerStatsProvideris related to.final inthashCode()static final LocalPlayerStatsProviderof(@NotNull net.minecraft.client.player.LocalPlayer player) Creates aLocalPlayerStatsProviderinstance based on aLocalPlayer.static final LocalPlayerStatsProviderCreates aLocalPlayerStatsProviderinstance usingMinecraft.player.
-
Method Details
-
getPlayer
public final net.minecraft.client.player.LocalPlayer getPlayer()Description copied from class:PlayerStatsProviderReturns thePlayerinstance thisPlayerStatsProvideris related to.- Specified by:
getPlayerin classPlayerStatsProvider<@NotNull net.minecraft.client.player.LocalPlayer>
-
getIntValue
public final <T> int getIntValue(net.minecraft.stats.Stat<T> stat) Description copied from interface:IStatsProviderReturns theIntegervalue of a givenStat.- Parameters:
stat- TheStatwhose value is to be obtained.- See Also:
-
getIntValue
public final <T> int getIntValue(@NotNull @NotNull net.minecraft.stats.StatType<T> type, @NotNull T subject) Description copied from interface:IStatsProvider- Parameters:
type- TheStatType.subject- The subject about whom stat value is to be obtained.- See Also:
-
hashCode
-
equals
-
of
public static final LocalPlayerStatsProvider of(@NotNull @NotNull net.minecraft.client.player.LocalPlayer player) throws NullPointerException Creates aLocalPlayerStatsProviderinstance based on aLocalPlayer.- Parameters:
player- TheLocalPlayer.- Throws:
NullPointerException- If the argument isnull.
-
ofCurrentLocalPlayer
Creates aLocalPlayerStatsProviderinstance usingMinecraft.player.- Throws:
NullPointerException- IfMinecraft.playerisnull.
-