Package net.minecraft.util
Enum Formatting
- All Implemented Interfaces:
Serializable
,Comparable<Formatting>
,java.lang.constant.Constable
public enum Formatting extends Enum<Formatting>
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum Constants Enum Constant Description AQUA
BLACK
BLUE
BOLD
DARK_AQUA
DARK_BLUE
DARK_GRAY
DARK_GREEN
DARK_PURPLE
DARK_RED
GOLD
GRAY
GREEN
ITALIC
LIGHT_PURPLE
OBFUSCATED
RED
RESET
STRIKETHROUGH
UNDERLINE
WHITE
YELLOW
-
Field Summary
Fields Modifier and Type Field Description private static Map<String,Formatting>
BY_NAME
private char
code
private int
colorIndex
private Integer
colorValue
private static Pattern
FORMATTING_CODE_PATTERN
private boolean
modifier
private String
name
private String
stringValue
-
Constructor Summary
Constructors Modifier Constructor Description private
Formatting(String name, char code, boolean modifier)
private
Formatting(String name, char code, boolean modifier, int colorIndex, Integer colorValue)
private
Formatting(String name, char code, int colorIndex, Integer colorValue)
-
Method Summary
Modifier and Type Method Description static Formatting
byCode(char code)
static Formatting
byColorIndex(int colorIndex)
static Formatting
byName(String name)
int
getColorIndex()
Integer
getColorValue()
String
getName()
static Collection<String>
getNames(boolean colors, boolean modifiers)
boolean
isColor()
boolean
isModifier()
private static String
sanitize(String name)
static String
strip(String string)
String
toString()
static Formatting
valueOf(String name)
Returns the enum constant of this type with the specified name.static Formatting[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
BLACK
-
DARK_BLUE
-
DARK_GREEN
-
DARK_AQUA
-
DARK_RED
-
DARK_PURPLE
-
GOLD
-
GRAY
-
DARK_GRAY
-
BLUE
-
GREEN
-
AQUA
-
RED
-
LIGHT_PURPLE
-
YELLOW
-
WHITE
-
OBFUSCATED
-
BOLD
-
STRIKETHROUGH
-
UNDERLINE
-
ITALIC
-
RESET
-
-
Field Details
-
BY_NAME
-
FORMATTING_CODE_PATTERN
-
name
-
code
private final char code -
modifier
private final boolean modifier -
stringValue
-
colorIndex
private final int colorIndex -
colorValue
-
-
Constructor Details
-
Formatting
-
Formatting
-
Formatting
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified nameNullPointerException
- if the argument is null
-
sanitize
-
getColorIndex
public int getColorIndex() -
isModifier
public boolean isModifier() -
isColor
public boolean isColor() -
getColorValue
-
getName
-
toString
- Overrides:
toString
in classEnum<Formatting>
-
strip
-
byName
-
byColorIndex
-
byCode
-
getNames
-