From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Techcable Date: Thu, 3 Mar 2016 02:32:10 -0600 Subject: [PATCH] Player Tab List and Title APIs diff --git a/src/main/java/net/minecraft/network/FriendlyByteBuf.java b/src/main/java/net/minecraft/network/FriendlyByteBuf.java index c15860c77c7c24b1946c22f140f1b5c12b052ade..c0966a873ea5e265936e17796bf6bbee62eea9b4 100644 --- a/src/main/java/net/minecraft/network/FriendlyByteBuf.java +++ b/src/main/java/net/minecraft/network/FriendlyByteBuf.java @@ -333,6 +333,11 @@ public class FriendlyByteBuf extends ByteBuf { public FriendlyByteBuf writeComponent(final net.kyori.adventure.text.Component component) { return this.writeUtf(PaperAdventure.asJsonString(component, this.adventure$locale), 262144); } + + @Deprecated + public FriendlyByteBuf writeComponent(final net.md_5.bungee.api.chat.BaseComponent[] component) { + return this.writeUtf(net.md_5.bungee.chat.ComponentSerializer.toString(component), 262144); + } // Paper end public FriendlyByteBuf writeComponent(Component text) { diff --git a/src/main/java/net/minecraft/network/chat/Component.java b/src/main/java/net/minecraft/network/chat/Component.java index 02d19fa4abdee0c8331734932a83e64694356030..969aea457e76b853e34a67a8fd07e0ea3207005b 100644 --- a/src/main/java/net/minecraft/network/chat/Component.java +++ b/src/main/java/net/minecraft/network/chat/Component.java @@ -428,6 +428,7 @@ public interface Component extends Message, FormattedText, Iterable { return Component.Serializer.GSON.toJsonTree(text); } + @Nullable public static Component jsonToComponent(String json) { return fromJson(json);} // Paper - OBFHELPER @Nullable public static MutableComponent fromJson(String json) { return (MutableComponent) GsonHelper.fromJson(Component.Serializer.GSON, json, MutableComponent.class, false); diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundSetSubtitleTextPacket.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundSetSubtitleTextPacket.java index c44a276d201fdfa5144d45d319d7761583c60639..f68a1a6dc6add9496e25cb52c318e086e356e2bb 100644 --- a/src/main/java/net/minecraft/network/protocol/game/ClientboundSetSubtitleTextPacket.java +++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundSetSubtitleTextPacket.java @@ -7,6 +7,7 @@ import net.minecraft.network.protocol.Packet; public class ClientboundSetSubtitleTextPacket implements Packet { private final Component text; public net.kyori.adventure.text.Component adventure$text; // Paper + public net.md_5.bungee.api.chat.BaseComponent[] components; // Paper public ClientboundSetSubtitleTextPacket(Component subtitle) { this.text = subtitle; @@ -21,6 +22,8 @@ public class ClientboundSetSubtitleTextPacket implements Packet { private final Component text; public net.kyori.adventure.text.Component adventure$text; // Paper + public net.md_5.bungee.api.chat.BaseComponent[] components; // Paper public ClientboundSetTitleTextPacket(Component title) { this.text = title; @@ -21,6 +22,8 @@ public class ClientboundSetTitleTextPacket implements Packet