类 TextColor
- java.lang.Object
-
- net.minecraft.text.TextColor
-
-
字段概要
字段 修饰符和类型 字段 说明 private static Map<String,TextColor>BY_NAMEprivate static Map<Formatting,TextColor>FORMATTING_TO_COLORprivate @Nullable Stringnameprivate intrgbprivate static StringRGB_PREFIX
-
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 booleanequals(Object object)static @Nullable TextColorfromFormatting(Formatting formatting)Obtains a text color from a formatting.static TextColorfromRgb(int rgb)Obtains a text color from an RGB value.private StringgetHexCode()StringgetName()Gets the name of this color, used for converting the color to JSON format.intgetRgb()Gets the RGB value of this color.inthashCode()static @Nullable TextColorparse(String name)Parses a color by its name.StringtoString()
-
-
-
字段详细资料
-
RGB_PREFIX
private static final String RGB_PREFIX
- 另请参阅:
- 常量字段值
- Mappings:
Namespace Name Mixin selector official aLoz;a:Ljava/lang/String;intermediary field_33291Lnet/minecraft/class_5251;field_33291:Ljava/lang/String;named RGB_PREFIXLnet/minecraft/text/TextColor;RGB_PREFIX:Ljava/lang/String;
-
FORMATTING_TO_COLOR
private static final Map<Formatting,TextColor> FORMATTING_TO_COLOR
- Mappings:
Namespace Name Mixin selector official bLoz;b:Ljava/util/Map;intermediary field_24362Lnet/minecraft/class_5251;field_24362:Ljava/util/Map;named FORMATTING_TO_COLORLnet/minecraft/text/TextColor;FORMATTING_TO_COLOR:Ljava/util/Map;
-
BY_NAME
private static final Map<String,TextColor> BY_NAME
- Mappings:
Namespace Name Mixin selector official cLoz;c:Ljava/util/Map;intermediary field_24363Lnet/minecraft/class_5251;field_24363:Ljava/util/Map;named BY_NAMELnet/minecraft/text/TextColor;BY_NAME:Ljava/util/Map;
-
rgb
private final int rgb
- Mappings:
Namespace Name Mixin selector official dLoz;d:Iintermediary field_24364Lnet/minecraft/class_5251;field_24364:Inamed rgbLnet/minecraft/text/TextColor;rgb:I
-
-
构造器详细资料
-
TextColor
private TextColor(int rgb, String name)- Mappings:
Namespace Name Mixin selector official <init>Loz;<init>(ILjava/lang/String;)Vintermediary <init>Lnet/minecraft/class_5251;<init>(ILjava/lang/String;)Vnamed <init>Lnet/minecraft/text/TextColor;<init>(ILjava/lang/String;)V
-
TextColor
private TextColor(int rgb)
- Mappings:
Namespace Name Mixin selector official <init>Loz;<init>(I)Vintermediary <init>Lnet/minecraft/class_5251;<init>(I)Vnamed <init>Lnet/minecraft/text/TextColor;<init>(I)V
-
-
方法详细资料
-
getRgb
public int getRgb()
Gets the RGB value of this color.The red bits can be obtained by
(rgb >> 16) & 0xFF, green bits by(rgb >> 8) & 0xFF, blue bits byrgb & 0xFF.- Mappings:
Namespace Name Mixin selector official aLoz;a()Iintermediary method_27716Lnet/minecraft/class_5251;method_27716()Inamed getRgbLnet/minecraft/text/TextColor;getRgb()I
-
getName
public String getName()
Gets the name of this color, used for converting the color to JSON format.- Mappings:
Namespace Name Mixin selector official bLoz;b()Ljava/lang/String;intermediary method_27721Lnet/minecraft/class_5251;method_27721()Ljava/lang/String;named getNameLnet/minecraft/text/TextColor;getName()Ljava/lang/String;
-
getHexCode
private String getHexCode()
- Mappings:
Namespace Name Mixin selector official cLoz;c()Ljava/lang/String;intermediary method_27723Lnet/minecraft/class_5251;method_27723()Ljava/lang/String;named getHexCodeLnet/minecraft/text/TextColor;getHexCode()Ljava/lang/String;
-
equals
public boolean equals(Object object)
-
hashCode
public int hashCode()
-
toString
public String toString()
-
fromFormatting
@Nullable public static @Nullable TextColor fromFormatting(Formatting formatting)
Obtains a text color from a formatting.- 参数:
formatting- the formatting- Mappings:
Namespace Name Mixin selector official aLoz;a(Lp;)Loz;intermediary method_27718Lnet/minecraft/class_5251;method_27718(Lnet/minecraft/class_124;)Lnet/minecraft/class_5251;named fromFormattingLnet/minecraft/text/TextColor;fromFormatting(Lnet/minecraft/util/Formatting;)Lnet/minecraft/text/TextColor;
-
fromRgb
public static TextColor fromRgb(int rgb)
Obtains a text color from an RGB value.- 参数:
rgb- the RGB color- Mappings:
Namespace Name Mixin selector official aLoz;a(I)Loz;intermediary method_27717Lnet/minecraft/class_5251;method_27717(I)Lnet/minecraft/class_5251;named fromRgbLnet/minecraft/text/TextColor;fromRgb(I)Lnet/minecraft/text/TextColor;
-
parse
@Nullable public static @Nullable TextColor parse(String name)
Parses a color by its name.- 参数:
name- the name- Mappings:
Namespace Name Mixin selector official aLoz;a(Ljava/lang/String;)Loz;intermediary method_27719Lnet/minecraft/class_5251;method_27719(Ljava/lang/String;)Lnet/minecraft/class_5251;named parseLnet/minecraft/text/TextColor;parse(Ljava/lang/String;)Lnet/minecraft/text/TextColor;
-
-