3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-15 11:00:06 +01:00

Use proper max length when serialising BungeeCord text component

Dieser Commit ist enthalten in:
kashike 2019-03-20 21:20:56 -07:00
Ursprung ea855e2b46
Commit 2e4520d902
2 geänderte Dateien mit 37 neuen und 2 gelöschten Zeilen

Datei anzeigen

@ -1,4 +1,4 @@
From 66f0c7791596f3d0e726a47caa3b4c38056110c2 Mon Sep 17 00:00:00 2001
From f8da455661efa320cd90dd6a41195b8a0c29bc3e Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Mon, 28 Mar 2016 21:22:26 -0400
Subject: [PATCH] EntityPathfindEvent
@ -35,5 +35,5 @@ index 60b5068e3..604049b08 100644
float f = this.j();
--
2.20.1
2.21.0

Datei anzeigen

@ -0,0 +1,35 @@
From eafb2cc37ab642330de42277e7e84bcb504988ea Mon Sep 17 00:00:00 2001
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
index eba6aadad..3a332e980 100644
--- 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;
@@ -30,9 +30,9 @@ public class PacketPlayOutChat implements Packet<PacketListenerPlayOut> {
//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 {
--
2.21.0