|
@@ -5,8 +5,7 @@ import javax.annotation.Nullable;
|
|
|
import net.minecraftforge.api.distmarker.Dist;
|
|
|
import net.minecraftforge.api.distmarker.OnlyIn;
|
|
|
|
|
|
-public enum ModTextFormatting
|
|
|
-{
|
|
|
+public enum ModTextFormatting {
|
|
|
BLACK("BLACK", '0', 0, 0),
|
|
|
DARK_BLUE("DARK_BLUE", '1', 1, 170),
|
|
|
DARK_GREEN("DARK_GREEN", '2', 2, 43520),
|
|
@@ -46,9 +45,8 @@ public enum ModTextFormatting
|
|
|
UNDERLINE("UNDERLINE", 'n', true),
|
|
|
ITALIC("ITALIC", 'o', true),
|
|
|
RESET("RESET", 'r', -1, null);
|
|
|
-
|
|
|
- private static int buildColor(float r, float g, float b)
|
|
|
- {
|
|
|
+
|
|
|
+ private static int buildColor(float r, float g, float b) {
|
|
|
int ir = (int) (255 * r);
|
|
|
int ig = (int) (255 * g);
|
|
|
int ib = (int) (255 * b);
|
|
@@ -63,18 +61,15 @@ public enum ModTextFormatting
|
|
|
@Nullable
|
|
|
private final Integer color;
|
|
|
|
|
|
- private ModTextFormatting(String formattingName, char formattingCodeIn, int index, @Nullable Integer colorCode)
|
|
|
- {
|
|
|
+ private ModTextFormatting(String formattingName, char formattingCodeIn, int index, @Nullable Integer colorCode) {
|
|
|
this(formattingName, formattingCodeIn, false, index, colorCode);
|
|
|
}
|
|
|
|
|
|
- private ModTextFormatting(String formattingName, char formattingCodeIn, boolean fancyStylingIn)
|
|
|
- {
|
|
|
+ private ModTextFormatting(String formattingName, char formattingCodeIn, boolean fancyStylingIn) {
|
|
|
this(formattingName, formattingCodeIn, fancyStylingIn, -1, (Integer) null);
|
|
|
}
|
|
|
|
|
|
- private ModTextFormatting(String formattingName, char formattingCodeIn, boolean fancyStylingIn, int index, @Nullable Integer colorCode)
|
|
|
- {
|
|
|
+ private ModTextFormatting(String formattingName, char formattingCodeIn, boolean fancyStylingIn, int index, @Nullable Integer colorCode) {
|
|
|
this.name = formattingName;
|
|
|
this.formattingCode = formattingCodeIn;
|
|
|
this.fancyStyling = fancyStylingIn;
|
|
@@ -85,15 +80,13 @@ public enum ModTextFormatting
|
|
|
|
|
|
@Nullable
|
|
|
@OnlyIn(Dist.CLIENT)
|
|
|
- public Integer func_211163_e()
|
|
|
- {
|
|
|
+ public Integer func_211163_e() {
|
|
|
return this.color;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
@Nullable
|
|
|
@OnlyIn(Dist.CLIENT)
|
|
|
- public Integer getColor()
|
|
|
- {
|
|
|
+ public Integer getColor() {
|
|
|
return this.color;
|
|
|
}
|
|
|
|
|
@@ -102,30 +95,25 @@ public enum ModTextFormatting
|
|
|
{
|
|
|
return !this.fancyStyling;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
@OnlyIn(Dist.CLIENT)
|
|
|
- public boolean isNormalStyle()
|
|
|
- {
|
|
|
+ public boolean isNormalStyle() {
|
|
|
return !this.fancyStyling;
|
|
|
}
|
|
|
|
|
|
@Nullable
|
|
|
@OnlyIn(Dist.CLIENT)
|
|
|
- public static ModTextFormatting fromFormattingCode(char formattingCodeIn)
|
|
|
- {
|
|
|
+ public static ModTextFormatting fromFormattingCode(char formattingCodeIn) {
|
|
|
return func_211165_a(formattingCodeIn);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
@Nullable
|
|
|
@OnlyIn(Dist.CLIENT)
|
|
|
- public static ModTextFormatting func_211165_a(char formattingCodeIn)
|
|
|
- {
|
|
|
+ public static ModTextFormatting func_211165_a(char formattingCodeIn) {
|
|
|
char c0 = Character.toString(formattingCodeIn).toLowerCase(Locale.ROOT).charAt(0);
|
|
|
|
|
|
- for(ModTextFormatting textformatting : values())
|
|
|
- {
|
|
|
- if(textformatting.formattingCode == c0)
|
|
|
- {
|
|
|
+ for(ModTextFormatting textformatting : values()) {
|
|
|
+ if(textformatting.formattingCode == c0) {
|
|
|
return textformatting;
|
|
|
}
|
|
|
}
|