mirror of
https://github.com/PaperMC/Paper.git
synced 2026-11-25 10:29:41 -05:00
Add a custom shutdown message set in bukkit.yml. Addresses BUKKIT-3031
This commit is contained in:
1 parent
320712aba7
commit
fb6d9e1808
4 files changed
+12
-4
No files matched your search
@@ -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
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user