mirror of https://github.com/Minestom/Minestom.git
23 lines
622 B
Java
23 lines
622 B
Java
package net.minestom.demo.commands;
|
|
|
|
import net.minestom.server.MinecraftServer;
|
|
import net.minestom.server.command.CommandSender;
|
|
import net.minestom.server.command.builder.Command;
|
|
import net.minestom.server.command.builder.CommandContext;
|
|
import org.jetbrains.annotations.NotNull;
|
|
|
|
/**
|
|
* A simple shutdown command.
|
|
*/
|
|
public class ShutdownCommand extends Command {
|
|
|
|
public ShutdownCommand() {
|
|
super("shutdown");
|
|
addSyntax(this::execute);
|
|
}
|
|
|
|
private void execute(@NotNull CommandSender commandSender, @NotNull CommandContext commandContext) {
|
|
MinecraftServer.stopCleanly();
|
|
}
|
|
}
|