--- a/net/minecraft/network/chat/TextColor.java
+++ b/net/minecraft/network/chat/TextColor.java
@@ -12,30 +12,38 @@
 import net.minecraft.ChatFormatting;
 
 public final class TextColor {
+
     private static final String CUSTOM_COLOR_PREFIX = "#";
-    public static final Codec<TextColor> CODEC = Codec.STRING.comapFlatMap((color) -> {
-        TextColor textColor = parseColor(color);
-        return textColor != null ? DataResult.success(textColor) : DataResult.error("String is not a valid color name or hex color code");
+    public static final Codec<TextColor> CODEC = Codec.STRING.comapFlatMap((s) -> {
+        TextColor chathexcolor = TextColor.parseColor(s);
+
+        return chathexcolor != null ? DataResult.success(chathexcolor) : DataResult.error("String is not a valid color name or hex color code");
     }, TextColor::serialize);
-    private static final Map<ChatFormatting, TextColor> LEGACY_FORMAT_TO_COLOR = Stream.of(ChatFormatting.values()).filter(ChatFormatting::isColor).collect(ImmutableMap.toImmutableMap(Function.identity(), (formatting) -> {
-        return new TextColor(formatting.getColor(), formatting.getName());
+    private static final Map<ChatFormatting, TextColor> LEGACY_FORMAT_TO_COLOR = (Map) Stream.of(ChatFormatting.values()).filter(ChatFormatting::isColor).collect(ImmutableMap.toImmutableMap(Function.identity(), (enumchatformat) -> {
+        return new TextColor(enumchatformat.getColor(), enumchatformat.getName(), enumchatformat); // CraftBukkit
     }));
-    private static final Map<String, TextColor> NAMED_COLORS = LEGACY_FORMAT_TO_COLOR.values().stream().collect(ImmutableMap.toImmutableMap((textColor) -> {
-        return textColor.name;
+    private static final Map<String, TextColor> NAMED_COLORS = (Map) TextColor.LEGACY_FORMAT_TO_COLOR.values().stream().collect(ImmutableMap.toImmutableMap((chathexcolor) -> {
+        return chathexcolor.name;
     }, Function.identity()));
     private final int value;
     @Nullable
     public final String name;
+    // CraftBukkit start
+    @Nullable
+    public final ChatFormatting format;
 
-    private TextColor(int rgb, String name) {
-        this.value = rgb;
-        this.name = name;
+    private TextColor(int i, String s, ChatFormatting format) {
+        this.value = i;
+        this.name = s;
+        this.format = format;
     }
 
     private TextColor(int rgb) {
         this.value = rgb;
         this.name = null;
+        this.format = null;
     }
+    // CraftBukkit end
 
     public int getValue() {
         return this.value;
@@ -49,31 +57,29 @@
         return String.format(Locale.ROOT, "#%06X", this.value);
     }
 
-    @Override
     public boolean equals(Object object) {
         if (this == object) {
             return true;
         } else if (object != null && this.getClass() == object.getClass()) {
-            TextColor textColor = (TextColor)object;
-            return this.value == textColor.value;
+            TextColor chathexcolor = (TextColor) object;
+
+            return this.value == chathexcolor.value;
         } else {
             return false;
         }
     }
 
-    @Override
     public int hashCode() {
-        return Objects.hash(this.value, this.name);
+        return Objects.hash(new Object[]{this.value, this.name});
     }
 
-    @Override
     public String toString() {
         return this.name != null ? this.name : this.formatValue();
     }
 
     @Nullable
     public static TextColor fromLegacyFormat(ChatFormatting formatting) {
-        return LEGACY_FORMAT_TO_COLOR.get(formatting);
+        return (TextColor) TextColor.LEGACY_FORMAT_TO_COLOR.get(formatting);
     }
 
     public static TextColor fromRgb(int rgb) {
@@ -85,12 +91,13 @@
         if (name.startsWith("#")) {
             try {
                 int i = Integer.parseInt(name.substring(1), 16);
-                return fromRgb(i);
-            } catch (NumberFormatException var2) {
+
+                return TextColor.fromRgb(i);
+            } catch (NumberFormatException numberformatexception) {
                 return null;
             }
         } else {
-            return NAMED_COLORS.get(name);
+            return (TextColor) TextColor.NAMED_COLORS.get(name);
         }
     }
 }
