Class ClientPlayerBadge
java.lang.Object
io.github.thecsdev.tcdcommons.api.badge.PlayerBadge
io.github.thecsdev.tcdcommons.api.client.badge.ClientPlayerBadge
A client-side-only
PlayerBadge
that is only
registered in the client-side environment.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic final PlayerBadgeHandler
getClientPlayerBadgeHandler
(net.minecraft.client.network.ClientPlayerEntity localPlayer) Returns a "client-side"PlayerBadgeHandler
for a givenClientPlayerEntity
, that tracksPlayerBadge
statistics on the "client-side".final boolean
Determines if the badge assigned to a player should persist in the player's save data.
When this method returns true, the badge is stored with the player's save data, ensuring its persistence across sessions.Methods inherited from class io.github.thecsdev.tcdcommons.api.badge.PlayerBadge
getDescription, getId, getName
-
Constructor Details
-
ClientPlayerBadge
public ClientPlayerBadge()
-
-
Method Details
-
shouldSave
public final boolean shouldSave()Description copied from class:PlayerBadge
Determines if the badge assigned to a player should persist in the player's save data.
When this method returns true, the badge is stored with the player's save data, ensuring its persistence across sessions. If this method returns false, the badge is considered temporary and will not be saved.
The result of this method should be constant for a given badge, as changing the result can lead to inconsistent saving behavior.
Must be constant.- Specified by:
shouldSave
in classPlayerBadge
-
getClientPlayerBadgeHandler
public static final PlayerBadgeHandler getClientPlayerBadgeHandler(net.minecraft.client.network.ClientPlayerEntity localPlayer) Returns a "client-side"PlayerBadgeHandler
for a givenClientPlayerEntity
, that tracksPlayerBadge
statistics on the "client-side".- Parameters:
localPlayer
- TheClientPlayerEntity
.
-