Class SimplePlayerBadge

java.lang.Object
io.github.thecsdev.tcdcommons.api.badge.PlayerBadge
io.github.thecsdev.tcdcommons.api.badge.SimplePlayerBadge

public class SimplePlayerBadge extends PlayerBadge
A simple PlayerBadge implementation that has a constructor accepting two Texts.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final net.minecraft.text.Text
     
    protected final net.minecraft.text.Text
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    SimplePlayerBadge(net.minecraft.text.Text name, net.minecraft.text.Text description)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    final net.minecraft.text.Text
    Returns the description of the badge.
    The returned description should be constant, meaning it should not change over the lifetime of a badge instance.

    Must be constant.
    final net.minecraft.text.Text
    Returns the display name of the badge.
    The returned name should be constant, meaning it should not change over the lifetime of a badge instance.

    Must be constant.
    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

    getId

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • name

      protected final net.minecraft.text.Text name
    • description

      protected final net.minecraft.text.Text description
  • Constructor Details

  • Method Details

    • getName

      public final net.minecraft.text.Text getName()
      Description copied from class: PlayerBadge
      Returns the display name of the badge.
      The returned name should be constant, meaning it should not change over the lifetime of a badge instance.

      Must be constant.
      Specified by:
      getName in class PlayerBadge
    • getDescription

      public final net.minecraft.text.Text getDescription()
      Description copied from class: PlayerBadge
      Returns the description of the badge.
      The returned description should be constant, meaning it should not change over the lifetime of a badge instance.

      Must be constant.
      Specified by:
      getDescription in class PlayerBadge
    • shouldSave

      public 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