summaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
authorfeildmaster <admin@feildmaster.com>2012-12-03 19:32:44 -0600
committerfeildmaster <admin@feildmaster.com>2012-12-05 06:07:10 -0600
commitfb6d9e1808e7a9f392fecd5ff15638069edf7248 (patch)
tree70fb41467e80148d369ea0ff4e6efd7d758c25ff /src/main/java
parent320712aba7bba1f81e0d194c8b17f17347aec687 (diff)
downloadcraftbukkit-fb6d9e1808e7a9f392fecd5ff15638069edf7248.tar
craftbukkit-fb6d9e1808e7a9f392fecd5ff15638069edf7248.tar.gz
craftbukkit-fb6d9e1808e7a9f392fecd5ff15638069edf7248.tar.lz
craftbukkit-fb6d9e1808e7a9f392fecd5ff15638069edf7248.tar.xz
craftbukkit-fb6d9e1808e7a9f392fecd5ff15638069edf7248.zip
Add a custom shutdown message set in bukkit.yml. Addresses BUKKIT-3031
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/net/minecraft/server/NetServerHandler.java5
-rw-r--r--src/main/java/net/minecraft/server/ServerConfigurationManagerAbstract.java2
-rw-r--r--src/main/java/org/bukkit/craftbukkit/CraftServer.java4
3 files changed, 9 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
}
}
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 429320bf..b0a2e697 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);
}