mirror of https://github.com/PaperMC/Paper.git
33 lines
1.6 KiB
Diff
33 lines
1.6 KiB
Diff
--- a/net/minecraft/network/chat/TextColor.java
|
|
+++ b/net/minecraft/network/chat/TextColor.java
|
|
@@ -16,15 +16,18 @@
|
|
|
|
private static final String CUSTOM_COLOR_PREFIX = "#";
|
|
public static final Codec<TextColor> CODEC = Codec.STRING.comapFlatMap(TextColor::parseColor, TextColor::serialize);
|
|
- private static final Map<ChatFormatting, TextColor> LEGACY_FORMAT_TO_COLOR = (Map) Stream.of(ChatFormatting.values()).filter(ChatFormatting::isColor).collect(ImmutableMap.toImmutableMap(Function.identity(), (chatformatting) -> {
|
|
- return new TextColor(chatformatting.getColor(), chatformatting.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 = (Map) TextColor.LEGACY_FORMAT_TO_COLOR.values().stream().collect(ImmutableMap.toImmutableMap((textcolor) -> {
|
|
return textcolor.name;
|
|
}, Function.identity()));
|
|
private final int value;
|
|
@Nullable
|
|
- private final String name;
|
|
+ public final String name;
|
|
+ // CraftBukkit start
|
|
+ @Nullable
|
|
+ public final ChatFormatting format;
|
|
|
|
private TextColor(int i, String s) {
|
|
this.value = i & 16777215;
|
|
@@ -35,6 +40,7 @@
|
|
this.value = i & 16777215;
|
|
this.name = null;
|
|
}
|
|
+ // CraftBukkit end
|
|
|
|
public int getValue() {
|
|
return this.value;
|