Class ClientPlayerBadge

java.lang.Object
io.github.thecsdev.tcdcommons.api.badge.PlayerBadge
io.github.thecsdev.tcdcommons.api.client.badge.ClientPlayerBadge

public abstract class ClientPlayerBadge extends PlayerBadge
A client-side-only PlayerBadge that is only registered in the client-side environment.
  • 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 class PlayerBadge
    • getClientPlayerBadgeHandler

      public static final PlayerBadgeHandler getClientPlayerBadgeHandler(net.minecraft.client.network.ClientPlayerEntity localPlayer)
      Returns a "client-side" PlayerBadgeHandler for a given ClientPlayerEntity, that tracks PlayerBadge statistics on the "client-side".
      Parameters:
      localPlayer - The ClientPlayerEntity.