geforkt von Mirrors/Paper
Don't nest if we don't need to when cerealising text components
Dieser Commit ist enthalten in:
Ursprung
d995d003f4
Commit
875d85b3ec
@ -0,0 +1,28 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Riley Park <rileysebastianpark@gmail.com>
|
||||||
|
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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
|
--- a/src/main/java/net/minecraft/server/PacketPlayOutChat.java
|
||||||
|
+++ b/src/main/java/net/minecraft/server/PacketPlayOutChat.java
|
||||||
|
@@ -0,0 +0,0 @@ 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);
|
||||||
|
}
|
||||||
|
--
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren