13
0
geforkt von Mirrors/Paper

Fix deprecated bungee APIs still serializing to JSON in packets (#10028)

Dieser Commit ist enthalten in:
Jason Penilla 2023-12-11 20:24:48 -08:00
Ursprung a52612213b
Commit 4580d97f5e

Datei anzeigen

@ -10,16 +10,17 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+++ b/src/main/java/net/minecraft/network/FriendlyByteBuf.java
@@ -0,0 +0,0 @@ public class FriendlyByteBuf extends ByteBuf {
// TODO this.adventure$locale
return this.writeWithCodec(NbtOps.INSTANCE, ComponentSerialization.CODEC, io.papermc.paper.adventure.PaperAdventure.asVanilla(component));
return this.writeWithCodec(NbtOps.INSTANCE, ComponentSerialization.CODEC, text);
}
+
+ // Paper start - deprecated Tab List & Title APIs
+ @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);
+ return this.writeComponent(java.util.Objects.requireNonNull(Component.Serializer.fromJson(net.md_5.bungee.chat.ComponentSerializer.toString(component))));
+ }
// Paper end
+ // Paper end - deprecated Tab List & Title APIs
public FriendlyByteBuf writeComponent(Component text) {
public <T extends Enum<T>> T readEnum(Class<T> 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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/network/protocol/game/ClientboundSetSubtitleTextPacket.java