From e1a160ad32907e2035e0fcd3d6ac30dadb7c3536 Mon Sep 17 00:00:00 2001 From: Jake Potrebic Date: Fri, 14 May 2021 05:52:03 -0700 Subject: [PATCH] Remove unneeded component conversion for kick msg (#5626) --- Spigot-Server-Patches/Adventure.patch | 6 ++---- .../Properly-handle-async-calls-to-restart-the-server.patch | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/Spigot-Server-Patches/Adventure.patch b/Spigot-Server-Patches/Adventure.patch index 4c88ce5747..8a988a5ef2 100644 --- a/Spigot-Server-Patches/Adventure.patch +++ b/Spigot-Server-Patches/Adventure.patch @@ -1513,7 +1513,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 // CraftBukkit start - disconnect safely for (EntityPlayer player : this.players) { - player.playerConnection.disconnect(this.server.server.getShutdownMessage()); // CraftBukkit - add custom shutdown message -+ player.playerConnection.disconnect(PaperAdventure.asVanilla(this.server.server.shutdownMessage())); // CraftBukkit - add custom shutdown message // Paper - Adventure ++ player.playerConnection.disconnect(this.server.server.shutdownMessage()); // CraftBukkit - add custom shutdown message // Paper - Adventure } // CraftBukkit end @@ -2186,9 +2186,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + org.spigotmc.AsyncCatcher.catchOp("player kick"); + final PlayerConnection connection = this.getHandle().playerConnection; + if (connection != null) { -+ connection.disconnect(io.papermc.paper.adventure.PaperAdventure.asVanilla( -+ message == null ? net.kyori.adventure.text.Component.empty() : message -+ )); ++ connection.disconnect(message == null ? net.kyori.adventure.text.Component.empty() : message); + } + } + // Paper end diff --git a/Spigot-Server-Patches/Properly-handle-async-calls-to-restart-the-server.patch b/Spigot-Server-Patches/Properly-handle-async-calls-to-restart-the-server.patch index 9cb66175fd..56b481e5f5 100644 --- a/Spigot-Server-Patches/Properly-handle-async-calls-to-restart-the-server.patch +++ b/Spigot-Server-Patches/Properly-handle-async-calls-to-restart-the-server.patch @@ -89,7 +89,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 // CraftBukkit start - disconnect safely for (EntityPlayer player : this.players) { + if (isRestarting) player.playerConnection.disconnect(org.spigotmc.SpigotConfig.restartMessage); else // Paper - player.playerConnection.disconnect(PaperAdventure.asVanilla(this.server.server.shutdownMessage())); // CraftBukkit - add custom shutdown message // Paper - Adventure + player.playerConnection.disconnect(this.server.server.shutdownMessage()); // CraftBukkit - add custom shutdown message // Paper - Adventure } // CraftBukkit end @@ -0,0 +0,0 @@ public abstract class PlayerList {