Paper/nms-patches/ChatHexColor.patch

36 lines
1.3 KiB
Diff
Raw Normal View History

2020-06-25 02:00:00 +02:00
--- a/net/minecraft/server/ChatHexColor.java
+++ b/net/minecraft/server/ChatHexColor.java
@@ -10,7 +10,7 @@
public final class ChatHexColor {
private static final Map<EnumChatFormat, ChatHexColor> a = (Map) Stream.of(EnumChatFormat.values()).filter(EnumChatFormat::d).collect(ImmutableMap.toImmutableMap(Function.identity(), (enumchatformat) -> {
- return new ChatHexColor(enumchatformat.e(), enumchatformat.f());
+ return new ChatHexColor(enumchatformat.e(), enumchatformat.f(), enumchatformat); // CraftBukkit
}));
private static final Map<String, ChatHexColor> b = (Map) ChatHexColor.a.values().stream().collect(ImmutableMap.toImmutableMap((chathexcolor) -> {
return chathexcolor.name;
@@ -18,16 +18,22 @@
private final int rgb;
@Nullable
public final String name;
+ // CraftBukkit start
+ @Nullable
+ public final EnumChatFormat format;
- private ChatHexColor(int i, String s) {
+ private ChatHexColor(int i, String s, EnumChatFormat format) {
this.rgb = i;
this.name = s;
+ this.format = format;
}
private ChatHexColor(int i) {
this.rgb = i;
this.name = null;
+ this.format = null;
}
+ // CraftBukkit end
public String b() {
return this.name != null ? this.name : this.c();