Grasscutter/src/main/java/emu/grasscutter/command/commands/StopCommand.java
2022-04-26 21:27:35 -07:00

24 lines
738 B
Java

package emu.grasscutter.command.commands;
import emu.grasscutter.Grasscutter;
import emu.grasscutter.command.Command;
import emu.grasscutter.command.CommandHandler;
import emu.grasscutter.game.player.Player;
import java.util.List;
@Command(label = "stop", usage = "stop",
description = "Stops the server", permission = "server.stop")
public final class StopCommand implements CommandHandler {
@Override
public void execute(Player sender, List<String> args) {
CommandHandler.sendMessage(null, "Server shutting down...");
for (Player p : Grasscutter.getGameServer().getPlayers().values()) {
CommandHandler.sendMessage(p, "Server shutting down...");
}
System.exit(1);
}
}