Package cn.lunadeer.dominion.utils
Class ColorParser
java.lang.Object
cn.lunadeer.dominion.utils.ColorParser
Utility class for parsing color codes in strings.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
getBukkitType
(String text) Converts a string with color codes into a Bukkit-compatible color string.static net.kyori.adventure.text.TextComponent
getComponentType
(String text) Converts a string with color codes into a TextComponent.static String
getPlainText
(String text) Removes color codes from a string, returning plain text.
-
Constructor Details
-
ColorParser
public ColorParser()
-
-
Method Details
-
getComponentType
Converts a string with color codes into a TextComponent.- Parameters:
text
- the string with color codes- Returns:
- the TextComponent with the parsed colors
-
getBukkitType
Converts a string with color codes into a Bukkit-compatible color string.- Parameters:
text
- the string with color codes- Returns:
- the Bukkit-compatible color string
-
getPlainText
Removes color codes from a string, returning plain text.- Parameters:
text
- the string with color codes- Returns:
- the plain text string
-