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 59788eaef0dae5ee01ceba1bf45e85cb07f88e53..b4542ce6a8c37ab31e6ecaeb4cbad4742cca0f9b 100644 --- a/src/main/java/net/minecraft/network/FriendlyByteBuf.java +++ b/src/main/java/net/minecraft/network/FriendlyByteBuf.java @@ -170,6 +170,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 54d186a195aca6d0a4c412ed609d8c86dcc76072..06e9246f05e130be6a63ebb0c9def10c6c9675b7 100644 --- a/src/main/java/net/minecraft/network/chat/Component.java +++ b/src/main/java/net/minecraft/network/chat/Component.java @@ -363,6 +363,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/ClientboundSetTitlesPacket.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundSetTitlesPacket.java index 69ff8df7340e60c476803256750a48f0b43414d3..df444daeb181ff78170f7b92bd02f1f1862dfa2e 100644 --- a/src/main/java/net/minecraft/network/protocol/game/ClientboundSetTitlesPacket.java +++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundSetTitlesPacket.java @@ -47,6 +47,17 @@ public class ClientboundSetTitlesPacket implements Packet