2020-05-06 17:48:49 +08:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
2019-03-21 12:20:56 +08: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 15:19:45 +08: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
|
2021-04-07 13:17:32 +08:00
|
|
|
index f6a1c5ac9acb34b1ef2262721adbbb1a5b0feaf7..fefcacf27d71c67403555502685a992a5a706099 100644
|
2021-03-16 15:19:45 +08:00
|
|
|
--- a/src/main/java/net/minecraft/network/protocol/game/PacketPlayOutChat.java
|
|
|
|
+++ b/src/main/java/net/minecraft/network/protocol/game/PacketPlayOutChat.java
|
2021-04-07 13:17:32 +08:00
|
|
|
@@ -9,7 +9,7 @@ import net.minecraft.network.chat.IChatBaseComponent;
|
2021-03-16 15:19:45 +08:00
|
|
|
import net.minecraft.network.protocol.Packet;
|
2019-03-21 12:20:56 +08:00
|
|
|
|
|
|
|
public class PacketPlayOutChat implements Packet<PacketListenerPlayOut> {
|
|
|
|
-
|
|
|
|
+ private static final int MAX_LENGTH = Short.MAX_VALUE * 8 + 8; // Paper
|
|
|
|
private IChatBaseComponent a;
|
2021-02-22 03:45:33 +08:00
|
|
|
public net.kyori.adventure.text.Component adventure$message; // Paper
|
2019-03-21 12:20:56 +08:00
|
|
|
public net.md_5.bungee.api.chat.BaseComponent[] components; // Spigot
|
2021-04-07 13:17:32 +08:00
|
|
|
@@ -43,9 +43,9 @@ public class PacketPlayOutChat implements Packet<PacketListenerPlayOut> {
|
2019-03-21 12:20:56 +08: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 {
|