From 67119756583096b1ca04fa79beb2dc1d7497e08b Mon Sep 17 00:00:00 2001 From: EvilSeph Date: Mon, 25 Apr 2011 22:36:55 -0400 Subject: [PATCH] Fixed PlayerQuitEvent.setMessage(). --- src/main/java/net/minecraft/server/NetServerHandler.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/minecraft/server/NetServerHandler.java b/src/main/java/net/minecraft/server/NetServerHandler.java index 7992444ee8..e732d9d55e 100644 --- a/src/main/java/net/minecraft/server/NetServerHandler.java +++ b/src/main/java/net/minecraft/server/NetServerHandler.java @@ -570,8 +570,12 @@ public class NetServerHandler extends NetHandler implements ICommandListener { if (this.disconnected) return; // CraftBukkit -- rarely it would send a disconnect line twice a.info(this.player.name + " lost connection: " + s); - this.minecraftServer.serverConfigurationManager.sendAll(new Packet3Chat("\u00A7e" + this.player.name + " left the game.")); - this.minecraftServer.serverConfigurationManager.disconnect(this.player); + // CraftBukkit start - we need to handle custom quit messages + String quitMessage = this.minecraftServer.serverConfigurationManager.disconnect(this.player); + if (quitMessage != null) { + this.minecraftServer.serverConfigurationManager.sendAll(new Packet3Chat(quitMessage)); + } + // CraftBukkit end this.disconnected = true; }