diff options
Diffstat (limited to 'src/main/java/net/minecraft')
-rw-r--r-- | src/main/java/net/minecraft/server/NetServerHandler.java | 5 | ||||
-rw-r--r-- | src/main/java/net/minecraft/server/ServerConfigurationManagerAbstract.java | 2 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/main/java/net/minecraft/server/NetServerHandler.java b/src/main/java/net/minecraft/server/NetServerHandler.java index 079c5c56..22b8781e 100644 --- a/src/main/java/net/minecraft/server/NetServerHandler.java +++ b/src/main/java/net/minecraft/server/NetServerHandler.java @@ -142,7 +142,10 @@ public class NetServerHandler extends NetHandler { String leaveMessage = "\u00A7e" + this.player.name + " left the game."; PlayerKickEvent event = new PlayerKickEvent(this.server.getPlayer(this.player), s, leaveMessage); - this.server.getPluginManager().callEvent(event); + + if (this.server.getServer().isRunning()) { + this.server.getPluginManager().callEvent(event); + } if (event.isCancelled()) { // Do not kick the player diff --git a/src/main/java/net/minecraft/server/ServerConfigurationManagerAbstract.java b/src/main/java/net/minecraft/server/ServerConfigurationManagerAbstract.java index 3332cdf1..12f8dfc3 100644 --- a/src/main/java/net/minecraft/server/ServerConfigurationManagerAbstract.java +++ b/src/main/java/net/minecraft/server/ServerConfigurationManagerAbstract.java @@ -824,7 +824,7 @@ public abstract class ServerConfigurationManagerAbstract { public void r() { while (!this.players.isEmpty()) { - ((EntityPlayer) this.players.get(0)).netServerHandler.disconnect("Server closed"); + ((EntityPlayer) this.players.get(0)).netServerHandler.disconnect(this.server.server.getShutdownMessage()); // CraftBukkit - add custom shutdown message } } } |