Package net.kamkeyke.raccooncore.util
Class TextUtils
java.lang.Object
net.kamkeyke.raccooncore.util.TextUtils
Utility class containing helper methods for building formatted text
Components.
This class centralizes common text formatting logic used across commands, messages and UI-related things.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic net.minecraft.network.chat.ComponentbuildPlayerList(Collection<? extends net.minecraft.world.entity.player.Player> players) Builds a human-readableComponentcontaining the display names of the provided players.
-
Constructor Details
-
TextUtils
public TextUtils()
-
-
Method Details
-
buildPlayerList
public static net.minecraft.network.chat.Component buildPlayerList(Collection<? extends net.minecraft.world.entity.player.Player> players) Builds a human-readableComponentcontaining the display names of the provided players.- 1 player →
Player - 2 players →
Player1 and Player2 - 3+ players →
Player1, Player2 and Player3
The returned component preserves each player's display name formatting and defers translation resolution to the client.
- Parameters:
players- the collection of players whose names should be formatted- Returns:
- a formatted
Componentrepresenting the player list
- 1 player →
-