-
Bug
-
Resolution: Fixed
-
Minor
-
None
-
None
-
4236-Spigot-cb8cf80-f993563 (MC: 1.21) (Implementing API version 1.21-R0.1-SNAPSHOT)
-
Yes
Using player.kickPlayer("ChatColor.RED + "SERVER SHUTDOWN!" + ChatColor.WHITE + "\nThe MineEmpire server was shutdown,\nwe will be back soon!");
Will only show the first line "SERVER SHUTDOWN!" instead of all the lines.
Expected result:
This problem seems to come from:
public void kickPlayer(String message) { if (getHandle().c == null) { return; } getHandle().c.a(CraftChatMessage.fromStringOrEmpty(message)); }
by default CraftChatMessage.fromStringOrEmpty(message); ignores newlines,
using CraftChatMessage.fromStringOrEmpty(message, true); fixes this.
Bypass:
String message = ChatColor.RED + "SERVER SHUTDOWN!" + ChatColor.WHITE + "\nThe MineEmpire server was shutdown,\nwe will be back soon!"; CraftPlayer cPlayer = (CraftPlayer) player; if (cPlayer != null) { if (cPlayer.getHandle() != null) { cPlayer.getHandle().connection.disconnect(CraftChatMessage.fromStringOrEmpty(message, true)); }; };