2020-01-22 03:02:07 +01:00
|
|
|
From 63ea01d82c450a8342f1b745e1cc1406ca4929d8 Mon Sep 17 00:00:00 2001
|
2019-03-21 05:20:56 +01: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
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/PacketPlayOutChat.java b/src/main/java/net/minecraft/server/PacketPlayOutChat.java
|
2020-01-22 03:02:07 +01:00
|
|
|
index 0ab611564..f7b2095bb 100644
|
2019-03-21 05:20:56 +01:00
|
|
|
--- a/src/main/java/net/minecraft/server/PacketPlayOutChat.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/PacketPlayOutChat.java
|
|
|
|
@@ -3,7 +3,7 @@ package net.minecraft.server;
|
|
|
|
import java.io.IOException;
|
|
|
|
|
|
|
|
public class PacketPlayOutChat implements Packet<PacketListenerPlayOut> {
|
|
|
|
-
|
|
|
|
+ private static final int MAX_LENGTH = Short.MAX_VALUE * 8 + 8; // Paper
|
|
|
|
private IChatBaseComponent a;
|
|
|
|
public net.md_5.bungee.api.chat.BaseComponent[] components; // Spigot
|
|
|
|
private ChatMessageType b;
|
2019-05-05 19:19:34 +02:00
|
|
|
@@ -32,9 +32,9 @@ public class PacketPlayOutChat implements Packet<PacketListenerPlayOut> {
|
2019-03-21 05:20:56 +01: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 {
|
|
|
|
--
|
2020-01-22 03:02:07 +01:00
|
|
|
2.25.0.windows.1
|
2019-03-21 05:20:56 +01:00
|
|
|
|