Package net.minecraft.util.text
Enum TextFormatting
- java.lang.Object
-
- java.lang.Enum<TextFormatting>
-
- net.minecraft.util.text.TextFormatting
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<TextFormatting>
public enum TextFormatting extends java.lang.Enum<TextFormatting>
-
-
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 char
code
private java.lang.Integer
color
private static java.util.Map<java.lang.String,TextFormatting>
FORMATTING_BY_NAME
private int
id
private boolean
isFormat
private java.lang.String
name
private static java.util.regex.Pattern
STRIP_FORMATTING_PATTERN
private java.lang.String
toString
-
Constructor Summary
Constructors Modifier Constructor Description private
TextFormatting(java.lang.String p_i46292_3_, char p_i46292_4_, boolean p_i46292_5_)
private
TextFormatting(java.lang.String p_i49746_3_, char p_i49746_4_, boolean p_i49746_5_, int p_i49746_6_, java.lang.Integer p_i49746_7_)
private
TextFormatting(java.lang.String p_i49745_3_, char p_i49745_4_, int p_i49745_5_, java.lang.Integer p_i49745_6_)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static java.lang.String
cleanName(java.lang.String p_175745_0_)
static TextFormatting
getByCode(char p_211165_0_)
static TextFormatting
getById(int p_175744_0_)
static TextFormatting
getByName(java.lang.String p_96300_0_)
java.lang.Integer
getColor()
int
getId()
java.lang.String
getName()
static java.util.Collection<java.lang.String>
getNames(boolean p_96296_0_, boolean p_96296_1_)
boolean
isColor()
boolean
isFormat()
static java.lang.String
stripFormatting(java.lang.String p_110646_0_)
java.lang.String
toString()
static TextFormatting
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static TextFormatting[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
BLACK
public static final TextFormatting BLACK
-
DARK_BLUE
public static final TextFormatting DARK_BLUE
-
DARK_GREEN
public static final TextFormatting DARK_GREEN
-
DARK_AQUA
public static final TextFormatting DARK_AQUA
-
DARK_RED
public static final TextFormatting DARK_RED
-
DARK_PURPLE
public static final TextFormatting DARK_PURPLE
-
GOLD
public static final TextFormatting GOLD
-
GRAY
public static final TextFormatting GRAY
-
DARK_GRAY
public static final TextFormatting DARK_GRAY
-
BLUE
public static final TextFormatting BLUE
-
GREEN
public static final TextFormatting GREEN
-
AQUA
public static final TextFormatting AQUA
-
RED
public static final TextFormatting RED
-
LIGHT_PURPLE
public static final TextFormatting LIGHT_PURPLE
-
YELLOW
public static final TextFormatting YELLOW
-
WHITE
public static final TextFormatting WHITE
-
OBFUSCATED
public static final TextFormatting OBFUSCATED
-
BOLD
public static final TextFormatting BOLD
-
STRIKETHROUGH
public static final TextFormatting STRIKETHROUGH
-
UNDERLINE
public static final TextFormatting UNDERLINE
-
ITALIC
public static final TextFormatting ITALIC
-
RESET
public static final TextFormatting RESET
-
-
Field Detail
-
FORMATTING_BY_NAME
private static final java.util.Map<java.lang.String,TextFormatting> FORMATTING_BY_NAME
-
STRIP_FORMATTING_PATTERN
private static final java.util.regex.Pattern STRIP_FORMATTING_PATTERN
-
name
private final java.lang.String name
-
code
private final char code
-
isFormat
private final boolean isFormat
-
toString
private final java.lang.String toString
-
id
private final int id
-
color
@Nullable private final java.lang.Integer color
-
-
Constructor Detail
-
TextFormatting
private TextFormatting(java.lang.String p_i49745_3_, char p_i49745_4_, int p_i49745_5_, @Nullable java.lang.Integer p_i49745_6_)
-
TextFormatting
private TextFormatting(java.lang.String p_i46292_3_, char p_i46292_4_, boolean p_i46292_5_)
-
TextFormatting
private TextFormatting(java.lang.String p_i49746_3_, char p_i49746_4_, boolean p_i49746_5_, int p_i49746_6_, @Nullable java.lang.Integer p_i49746_7_)
-
-
Method Detail
-
values
public static TextFormatting[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (TextFormatting c : TextFormatting.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static TextFormatting valueOf(java.lang.String name)
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:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
cleanName
private static java.lang.String cleanName(java.lang.String p_175745_0_)
-
getId
public int getId()
-
isFormat
public boolean isFormat()
-
isColor
public boolean isColor()
-
getColor
@Nullable public java.lang.Integer getColor()
-
getName
public java.lang.String getName()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Enum<TextFormatting>
-
stripFormatting
@Nullable public static java.lang.String stripFormatting(@Nullable java.lang.String p_110646_0_)
-
getByName
@Nullable public static TextFormatting getByName(@Nullable java.lang.String p_96300_0_)
-
getById
@Nullable public static TextFormatting getById(int p_175744_0_)
-
getByCode
@Nullable public static TextFormatting getByCode(char p_211165_0_)
-
getNames
public static java.util.Collection<java.lang.String> getNames(boolean p_96296_0_, boolean p_96296_1_)
-
-