mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-03 01:10:37 +01:00
b62dfa0bf9
Upstream has released updates that appears to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing Bukkit Changes: 39ce5d3a SPIGOT-4399: ItemMeta.equals broken with AttributeModifiers CraftBukkit Changes:1cf8b5dc
SPIGOT-4400: Populators running on existing chunks116cb9a1
SPIGOT-4399: Add attribute modifier equality test5ee1c18a
SPIGOT-4398: Set ASM7_EXPERIMENTAL flag
31 lines
1.5 KiB
Diff
31 lines
1.5 KiB
Diff
From 366c331315abcf82654e47d3faf4e192d5422e87 Mon Sep 17 00:00:00 2001
|
|
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
|
|
index 28a2628350..eba6aadad7 100644
|
|
--- a/src/main/java/net/minecraft/server/PacketPlayOutChat.java
|
|
+++ b/src/main/java/net/minecraft/server/PacketPlayOutChat.java
|
|
@@ -27,7 +27,14 @@ public class PacketPlayOutChat implements Packet<PacketListenerPlayOut> {
|
|
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);
|
|
}
|
|
--
|
|
2.19.0
|
|
|