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 53f033d2d887909f5f905c00122d1b09809e5e3c..b9dd91927cb259789ad71b2241024c5fa2586d57 100644 --- a/src/main/java/net/minecraft/network/FriendlyByteBuf.java +++ b/src/main/java/net/minecraft/network/FriendlyByteBuf.java @@ -545,6 +545,12 @@ public class FriendlyByteBuf extends ByteBuf { return this.writeWithCodec(NbtOps.INSTANCE, ComponentSerialization.localizedCodec(this.adventure$locale), text); // Paper end - adventure; support writing adventure components directly and server-side translations } + // Paper start - deprecated Tab List & Title APIs + @Deprecated + public FriendlyByteBuf writeComponent(final net.md_5.bungee.api.chat.BaseComponent[] component) { + return this.writeComponent(java.util.Objects.requireNonNull(Component.Serializer.fromJson(net.md_5.bungee.chat.ComponentSerializer.toString(component)))); + } + // Paper end - deprecated Tab List & Title APIs public > T readEnum(Class enumClass) { return ((T[]) enumClass.getEnumConstants())[this.readVarInt()]; // CraftBukkit - fix decompile error 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 e77bd5bb66279f579fad4fdcc8b0606410922e9e..4c05fee93eb20044a4198c43d5ae1eebebaabaf7 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