Class SimplePlayerBadge
java.lang.Object
io.github.thecsdev.tcdcommons.api.badge.PlayerBadge
io.github.thecsdev.tcdcommons.api.badge.SimplePlayerBadge
A simple
PlayerBadge
implementation that has a
constructor accepting two Text
s.-
Field Summary
Modifier and TypeFieldDescriptionprotected final net.minecraft.text.Text
protected final net.minecraft.text.Text
-
Constructor Summary
ConstructorDescriptionSimplePlayerBadge
(net.minecraft.text.Text name, net.minecraft.text.Text description) -
Method Summary
Modifier and TypeMethodDescriptionfinal 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
getName()
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
-
Field Details
-
name
protected final net.minecraft.text.Text name -
description
protected final net.minecraft.text.Text description
-
-
Constructor Details
-
SimplePlayerBadge
public SimplePlayerBadge(net.minecraft.text.Text name, net.minecraft.text.Text description) throws NullPointerException - Throws:
NullPointerException
-
-
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 classPlayerBadge
-
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 classPlayerBadge
-
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 classPlayerBadge
-