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
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

View file

@ -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 {