diff --git a/src/main/java/net/minecraft/server/NetServerHandler.java b/src/main/java/net/minecraft/server/NetServerHandler.java index 079c5c5660..22b8781e4c 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 3332cdf126..12f8dfc36e 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 } } } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java index 429320bfba..b0a2e697cc 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -930,6 +930,10 @@ public final class CraftServer implements Server { return configuration.getInt("settings.spawn-radius", -1); } + public String getShutdownMessage() { + return configuration.getString("settings.shutdown-message"); + } + public int getSpawnRadius() { return ((DedicatedServer) console).propertyManager.getInt("spawn-protection", 16); } diff --git a/src/main/resources/configurations/bukkit.yml b/src/main/resources/configurations/bukkit.yml index 5307abe449..e4d6d96fe6 100644 --- a/src/main/resources/configurations/bukkit.yml +++ b/src/main/resources/configurations/bukkit.yml @@ -2,10 +2,10 @@ # As you can see, there's actually not that much to configure without any plugins. # For a reference for any variable inside this file, check out the bukkit wiki at # http://wiki.bukkit.org/Bukkit.yml -# +# # If you need help on this file, feel free to join us on irc or leave a message # on the forums asking for advice. -# +# # IRC: #bukkit @ esper.net # (If this means nothing to you, just go to http://webchat.esper.net/?channels=bukkit ) # Forums: http://forums.bukkit.org/forums/bukkit-help.6/ @@ -24,6 +24,7 @@ settings: connection-throttle: 4000 query-plugins: true deprecated-verbose: default + shutdown-message: Server closed spawn-limits: monsters: 70 animals: 15