diff options
Diffstat (limited to 'patch-remap/og/net/minecraft/network/chat')
-rw-r--r-- | patch-remap/og/net/minecraft/network/chat/ChatHexColor.patch | 35 | ||||
-rw-r--r-- | patch-remap/og/net/minecraft/network/chat/IChatBaseComponent.patch | 26 |
2 files changed, 61 insertions, 0 deletions
diff --git a/patch-remap/og/net/minecraft/network/chat/ChatHexColor.patch b/patch-remap/og/net/minecraft/network/chat/ChatHexColor.patch new file mode 100644 index 0000000000..8924ab3f00 --- /dev/null +++ b/patch-remap/og/net/minecraft/network/chat/ChatHexColor.patch @@ -0,0 +1,35 @@ +--- a/net/minecraft/network/chat/ChatHexColor.java ++++ b/net/minecraft/network/chat/ChatHexColor.java +@@ -17,7 +17,7 @@ + private static final String CUSTOM_COLOR_PREFIX = "#"; + public static final Codec<ChatHexColor> CODEC = Codec.STRING.comapFlatMap(ChatHexColor::parseColor, ChatHexColor::serialize); + private static final Map<EnumChatFormat, ChatHexColor> LEGACY_FORMAT_TO_COLOR = (Map) Stream.of(EnumChatFormat.values()).filter(EnumChatFormat::isColor).collect(ImmutableMap.toImmutableMap(Function.identity(), (enumchatformat) -> { +- return new ChatHexColor(enumchatformat.getColor(), enumchatformat.getName()); ++ return new ChatHexColor(enumchatformat.getColor(), enumchatformat.getName(), enumchatformat); // CraftBukkit + })); + private static final Map<String, ChatHexColor> NAMED_COLORS = (Map) ChatHexColor.LEGACY_FORMAT_TO_COLOR.values().stream().collect(ImmutableMap.toImmutableMap((chathexcolor) -> { + return chathexcolor.name; +@@ -25,16 +25,22 @@ + private final int value; + @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.value = i & 16777215; + this.name = s; ++ this.format = format; + } + + private ChatHexColor(int i) { + this.value = i & 16777215; + this.name = null; ++ this.format = null; + } ++ // CraftBukkit end + + public int getValue() { + return this.value; diff --git a/patch-remap/og/net/minecraft/network/chat/IChatBaseComponent.patch b/patch-remap/og/net/minecraft/network/chat/IChatBaseComponent.patch new file mode 100644 index 0000000000..93751f5b13 --- /dev/null +++ b/patch-remap/og/net/minecraft/network/chat/IChatBaseComponent.patch @@ -0,0 +1,26 @@ +--- a/net/minecraft/network/chat/IChatBaseComponent.java ++++ b/net/minecraft/network/chat/IChatBaseComponent.java +@@ -35,7 +35,22 @@ + import net.minecraft.util.FormattedString; + import net.minecraft.world.level.ChunkCoordIntPair; + +-public interface IChatBaseComponent extends Message, IChatFormatted { ++// CraftBukkit start ++import java.util.stream.Stream; ++// CraftBukkit end ++ ++public interface IChatBaseComponent extends Message, IChatFormatted, Iterable<IChatBaseComponent> { // CraftBukkit ++ ++ // CraftBukkit start ++ default Stream<IChatBaseComponent> stream() { ++ return com.google.common.collect.Streams.concat(new Stream[]{Stream.of(this), this.getSiblings().stream().flatMap(IChatBaseComponent::stream)}); ++ } ++ ++ @Override ++ default Iterator<IChatBaseComponent> iterator() { ++ return this.stream().iterator(); ++ } ++ // CraftBukkit end + + ChatModifier getStyle(); + |