Package wtf.choco.veinminer.util
Enum Class ChatFormat
- All Implemented Interfaces:
Serializable
,Comparable<ChatFormat>
,Constable
All supported legacy chat colour and format codes.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionAqua (&b).Black (&0).Blue (&9).Bold text (&l).Dark aqua (&3).Dark blue (&1).Dark gray (&8).Dark green (&2).Dark purple (&5).Dark red (&4).Gold (&6).Gray (&7).Green (&a).Italic text (&o).Light purple (&d).Magic/obfuscated text (&k).Red (&c).Reset formatting (&r).Strikethrough text (&m).Underline text (&n).White (&f).Yellow (&e). -
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
isColor()
Checks if this code is a color code as opposed to a format code.boolean
isFormat()
Checks if this code is a format code as opposed to a color code.@NotNull String
toString()
static @NotNull String
translateAlternateColorCodes
(char altColorChar, @NotNull String string) Translates a string using an alternate color code character into a string that uses thecolor code character
.static ChatFormat
Returns the enum constant of this class with the specified name.static ChatFormat[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
BLACK
Black (&0). -
DARK_BLUE
Dark blue (&1). -
DARK_GREEN
Dark green (&2). -
DARK_AQUA
Dark aqua (&3). -
DARK_RED
Dark red (&4). -
DARK_PURPLE
Dark purple (&5). -
GOLD
Gold (&6). -
GRAY
Gray (&7). -
DARK_GRAY
Dark gray (&8). -
BLUE
Blue (&9). -
GREEN
Green (&a). -
AQUA
Aqua (&b). -
RED
Red (&c). -
LIGHT_PURPLE
Light purple (&d). -
YELLOW
Yellow (&e). -
WHITE
White (&f). -
MAGIC
Magic/obfuscated text (&k). -
BOLD
Bold text (&l). -
STRIKETHROUGH
Strikethrough text (&m). -
UNDERLINE
Underline text (&n). -
ITALIC
Italic text (&o). -
RESET
Reset formatting (&r).
-
-
Field Details
-
COLOR_CHAR
public static final char COLOR_CHARThe legacy colour character.- See Also:
-
-
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
-
toString
- Overrides:
toString
in classEnum<ChatFormat>
-
isFormat
public boolean isFormat()Checks if this code is a format code as opposed to a color code.- Returns:
- whether this ChatColor is a format code
-
isColor
public boolean isColor()Checks if this code is a color code as opposed to a format code.- Returns:
- whether this ChatColor is a color code
-
translateAlternateColorCodes
@NotNull public static @NotNull String translateAlternateColorCodes(char altColorChar, @NotNull @NotNull String string) Translates a string using an alternate color code character into a string that uses thecolor code character
. The alternate color code character will only be replaced if it is immediately followed by 0-9, A-F, a-f, K-O, k-o, R or r.- Parameters:
altColorChar
- the alternate color code character to replace. Ex: &string
- the string the translate- Returns:
- text containing the
color code character
-