2020-05-06 09:48:49 +00:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
2019-03-21 04:20:56 +00:00
|
|
|
From: kashike <kashike@vq.lc>
|
|
|
|
Date: Wed, 20 Mar 2019 21:19:29 -0700
|
|
|
|
Subject: [PATCH] Use proper max length when serialising BungeeCord text
|
|
|
|
component
|
|
|
|
|
|
|
|
|
2021-03-16 07:19:45 +00:00
|
|
|
diff --git a/src/main/java/net/minecraft/network/protocol/game/PacketPlayOutChat.java b/src/main/java/net/minecraft/network/protocol/game/PacketPlayOutChat.java
|
|
|
|
index c47427fd2eed173726cb856aae62c02a2b46bbf0..d4cf5536883192c49636177cb782a9a2f514cd87 100644
|
|
|
|
--- a/src/main/java/net/minecraft/network/protocol/game/PacketPlayOutChat.java
|
|
|
|
+++ b/src/main/java/net/minecraft/network/protocol/game/PacketPlayOutChat.java
|
|
|
|
@@ -8,7 +8,7 @@ import net.minecraft.network.chat.IChatBaseComponent;
|
|
|
|
import net.minecraft.network.protocol.Packet;
|
2019-03-21 04:20:56 +00:00
|
|
|
|
|
|
|
public class PacketPlayOutChat implements Packet<PacketListenerPlayOut> {
|
|
|
|
-
|
|
|
|
+ private static final int MAX_LENGTH = Short.MAX_VALUE * 8 + 8; // Paper
|
|
|
|
private IChatBaseComponent a;
|
2021-02-21 19:45:33 +00:00
|
|
|
public net.kyori.adventure.text.Component adventure$message; // Paper
|
2019-03-21 04:20:56 +00:00
|
|
|
public net.md_5.bungee.api.chat.BaseComponent[] components; // Spigot
|
2021-03-16 07:19:45 +00:00
|
|
|
@@ -42,9 +42,9 @@ public class PacketPlayOutChat implements Packet<PacketListenerPlayOut> {
|
2019-03-21 04:20:56 +00:00
|
|
|
//packetdataserializer.a(net.md_5.bungee.chat.ComponentSerializer.toString(components)); // Paper - comment, replaced with below
|
|
|
|
// Paper start - don't nest if we don't need to so that we can preserve formatting
|
|
|
|
if (this.components.length == 1) {
|
|
|
|
- packetdataserializer.a(net.md_5.bungee.chat.ComponentSerializer.toString(this.components[0]));
|
|
|
|
+ packetdataserializer.a(net.md_5.bungee.chat.ComponentSerializer.toString(this.components[0]), MAX_LENGTH); // Paper - use proper max length
|
|
|
|
} else {
|
|
|
|
- packetdataserializer.a(net.md_5.bungee.chat.ComponentSerializer.toString(this.components));
|
|
|
|
+ packetdataserializer.a(net.md_5.bungee.chat.ComponentSerializer.toString(this.components), MAX_LENGTH); // Paper - use proper max length
|
|
|
|
}
|
|
|
|
// Paper end
|
|
|
|
} else {
|