package net.glowstone.command.minecraft;

import java.util.Collections;
import net.glowstone.GlowServer;
import net.glowstone.ServerProvider;
import org.bukkit.Server;
import org.bukkit.command.CommandSender;
import org.bukkit.command.defaults.VanillaCommand;

public class StopCommand extends VanillaCommand {

    public StopCommand() {
        super("stop", "Gracefully stops the server.", "/stop [message]", Collections.emptyList());
        setPermission("minecraft.command.stop");
    }

    @Override
    public boolean execute(CommandSender sender, String label, String[] args) {
        if (!testPermission(sender)) {
            return false;
        }
        Server server = ServerProvider.getServer();
        if (args.length > 0 && server instanceof GlowServer) {
            ((GlowServer) server).shutdown(String.join(" ", args));
        } else {
            server.shutdown();
        }
        return true;
    }
}

@@ -254,16 +254,163 @@
 mmand;%0A%0A
+/**%0A * In vanilla Minecraft, this command takes no arguments; but as an extension, Glowstone treats any%0A * arguments as a custom kick message.%0A */%0A
 public c

Document extension to /stop