From b6c55ade985c645da839889a0e20d177de9c31ca Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Wed, 8 Jun 2022 17:34:21 +1000 Subject: [PATCH] SPIGOT-7038: Setting title or subtitle to empty string causes the player to disconnect By: md_5 --- .../main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java index 726a93f759..27f28c41e2 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -1754,12 +1754,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player { getHandle().connection.send(times); if (title != null) { - ClientboundSetTitleTextPacket packetTitle = new ClientboundSetTitleTextPacket(CraftChatMessage.fromStringOrNull(title)); + ClientboundSetTitleTextPacket packetTitle = new ClientboundSetTitleTextPacket(CraftChatMessage.fromString(title)[0]); getHandle().connection.send(packetTitle); } if (subtitle != null) { - ClientboundSetSubtitleTextPacket packetSubtitle = new ClientboundSetSubtitleTextPacket(CraftChatMessage.fromStringOrNull(subtitle)); + ClientboundSetSubtitleTextPacket packetSubtitle = new ClientboundSetSubtitleTextPacket(CraftChatMessage.fromString(title)[0]); getHandle().connection.send(packetSubtitle); } }