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 AQUABLACKBLUEBOLDDARK_AQUADARK_BLUEDARK_GRAYDARK_GREENDARK_PURPLEDARK_REDGOLDGRAYGREENITALICLIGHT_PURPLEOBFUSCATEDREDRESETSTRIKETHROUGHUNDERLINEWHITEYELLOW
-
Field Summary
Fields Modifier and Type Field Description private charcodeprivate java.lang.Integercolorprivate static java.util.Map<java.lang.String,TextFormatting>FORMATTING_BY_NAMEprivate intidprivate booleanisFormatprivate java.lang.Stringnameprivate static java.util.regex.PatternSTRIP_FORMATTING_PATTERNprivate java.lang.StringtoString
-
Constructor Summary
Constructors Modifier Constructor Description privateTextFormatting(java.lang.String p_i46292_3_, char p_i46292_4_, boolean p_i46292_5_)privateTextFormatting(java.lang.String p_i49746_3_, char p_i49746_4_, boolean p_i49746_5_, int p_i49746_6_, java.lang.Integer p_i49746_7_)privateTextFormatting(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.StringcleanName(java.lang.String p_175745_0_)static TextFormattinggetByCode(char p_211165_0_)static TextFormattinggetById(int p_175744_0_)static TextFormattinggetByName(java.lang.String p_96300_0_)java.lang.IntegergetColor()intgetId()java.lang.StringgetName()static java.util.Collection<java.lang.String>getNames(boolean p_96296_0_, boolean p_96296_1_)booleanisColor()booleanisFormat()static java.lang.StringstripFormatting(java.lang.String p_110646_0_)java.lang.StringtoString()static TextFormattingvalueOf(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:
toStringin 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_)
-
-