2019-06-25 21:18:50 +02:00
|
|
|
From e85e153d9c12b2d68bc3b5005a015cc0c4392305 Mon Sep 17 00:00:00 2001
|
2016-03-09 03:29:39 +01:00
|
|
|
From: kashike <kashike@vq.lc>
|
|
|
|
Date: Tue, 8 Mar 2016 18:28:43 -0800
|
|
|
|
Subject: [PATCH] Don't nest if we don't need to when cerealising text
|
|
|
|
components
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/PacketPlayOutChat.java b/src/main/java/net/minecraft/server/PacketPlayOutChat.java
|
2019-06-06 17:36:57 +02:00
|
|
|
index fa4eab5b0b..0ab611564e 100644
|
2016-03-09 03:29:39 +01:00
|
|
|
--- a/src/main/java/net/minecraft/server/PacketPlayOutChat.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/PacketPlayOutChat.java
|
2019-04-26 03:24:00 +02:00
|
|
|
@@ -29,7 +29,14 @@ public class PacketPlayOutChat implements Packet<PacketListenerPlayOut> {
|
2016-03-09 03:29:39 +01:00
|
|
|
public void b(PacketDataSerializer packetdataserializer) throws IOException {
|
|
|
|
// Spigot start
|
|
|
|
if (components != null) {
|
|
|
|
- packetdataserializer.a(net.md_5.bungee.chat.ComponentSerializer.toString(components));
|
|
|
|
+ //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]));
|
|
|
|
+ } else {
|
|
|
|
+ packetdataserializer.a(net.md_5.bungee.chat.ComponentSerializer.toString(this.components));
|
|
|
|
+ }
|
|
|
|
+ // Paper end
|
|
|
|
} else {
|
|
|
|
packetdataserializer.a(this.a);
|
|
|
|
}
|
|
|
|
--
|
2019-06-25 21:18:50 +02:00
|
|
|
2.22.0
|
2016-03-09 03:29:39 +01:00
|
|
|
|