Remove unneeded component conversion for kick msg (#5626)

This commit is contained in:
Jake Potrebic 2021-05-14 05:52:03 -07:00
parent 94473dbc55
commit e1a160ad32
2 changed files with 3 additions and 5 deletions

View File

@ -1513,7 +1513,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
// CraftBukkit start - disconnect safely // CraftBukkit start - disconnect safely
for (EntityPlayer player : this.players) { for (EntityPlayer player : this.players) {
- player.playerConnection.disconnect(this.server.server.getShutdownMessage()); // CraftBukkit - add custom shutdown message - 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 // CraftBukkit end
@ -2186,9 +2186,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ org.spigotmc.AsyncCatcher.catchOp("player kick"); + org.spigotmc.AsyncCatcher.catchOp("player kick");
+ final PlayerConnection connection = this.getHandle().playerConnection; + final PlayerConnection connection = this.getHandle().playerConnection;
+ if (connection != null) { + if (connection != null) {
+ connection.disconnect(io.papermc.paper.adventure.PaperAdventure.asVanilla( + connection.disconnect(message == null ? net.kyori.adventure.text.Component.empty() : message);
+ message == null ? net.kyori.adventure.text.Component.empty() : message
+ ));
+ } + }
+ } + }
+ // Paper end + // Paper end

View File

@ -89,7 +89,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
// CraftBukkit start - disconnect safely // CraftBukkit start - disconnect safely
for (EntityPlayer player : this.players) { for (EntityPlayer player : this.players) {
+ if (isRestarting) player.playerConnection.disconnect(org.spigotmc.SpigotConfig.restartMessage); else // Paper + 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 // CraftBukkit end
@@ -0,0 +0,0 @@ public abstract class PlayerList { @@ -0,0 +0,0 @@ public abstract class PlayerList {