Enum Class ChatColor
- All Implemented Interfaces:
Serializable
,Comparable<ChatColor>
,java.lang.constant.Constable
Color Code Converter Enum
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
-
Method Summary
Modifier and TypeMethodDescriptionGet this color as a Minecraft Color Codestatic net.kyori.adventure.text.TextComponent
convertColor
(char character, String str) Convert Minecraft color codes starting with character to Sponge Textstatic net.kyori.adventure.text.TextComponent
convertColor
(String str) Convert Minecraft color codes to Sponge Textstatic String
parseColor
(char character, String str) Parse Minecraft color codes starting with characterstatic String
stripColor
(String str) Removes all Minecraft color codes from a stringtoString()
static ChatColor
Returns the enum constant of this class with the specified name.static ChatColor[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
AQUA
-
BLACK
-
BLUE
-
BOLD
-
DARK_AQUA
-
DARK_BLUE
-
DARK_GRAY
-
DARK_GREEN
-
DARK_PURPLE
-
DARK_RED
-
GOLD
-
GRAY
-
GREEN
-
ITALIC
-
LIGHT_PURPLE
-
MAGIC
-
RED
-
RESET
-
STRIKETHROUGH
-
UNDERLINE
-
WHITE
-
YELLOW
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
asMinecraftCode
Get this color as a Minecraft Color Code- Returns:
- Minecraft Color Code
-
toString
-
parseColor
Parse Minecraft color codes starting with character- Parameters:
character
- Characterstr
- String to parse- Returns:
- Minecraft colored string
-
convertColor
Convert Minecraft color codes to Sponge Text- Parameters:
str
- Minecraft colored string- Returns:
- Sponge Text
-
convertColor
Convert Minecraft color codes starting with character to Sponge Text- Parameters:
character
- Characterstr
- String to parse- Returns:
- Sponge Text
-
stripColor
Removes all Minecraft color codes from a string- Parameters:
str
- String to parse- Returns:
- String without color
-