2022-01-01 18:27:52 +01:00
|
|
|
package net.minestom.demo.commands;
|
2020-07-29 05:03:07 +02:00
|
|
|
|
|
|
|
import net.minestom.server.MinecraftServer;
|
|
|
|
import net.minestom.server.command.CommandSender;
|
2021-03-26 21:19:53 +01:00
|
|
|
import net.minestom.server.command.builder.Command;
|
|
|
|
import net.minestom.server.command.builder.CommandContext;
|
2020-10-26 13:57:02 +01:00
|
|
|
import org.jetbrains.annotations.NotNull;
|
2020-07-29 05:03:07 +02:00
|
|
|
|
|
|
|
/**
|
2020-10-19 11:56:26 +02:00
|
|
|
* A simple shutdown command.
|
2020-07-29 05:03:07 +02:00
|
|
|
*/
|
2021-03-26 21:19:53 +01:00
|
|
|
public class ShutdownCommand extends Command {
|
2020-07-29 05:03:07 +02:00
|
|
|
|
2021-03-26 21:19:53 +01:00
|
|
|
public ShutdownCommand() {
|
|
|
|
super("shutdown");
|
|
|
|
addSyntax(this::execute);
|
2020-07-29 05:03:07 +02:00
|
|
|
}
|
|
|
|
|
2021-03-26 21:19:53 +01:00
|
|
|
private void execute(@NotNull CommandSender commandSender, @NotNull CommandContext commandContext) {
|
2020-07-29 05:03:07 +02:00
|
|
|
MinecraftServer.stopCleanly();
|
|
|
|
}
|
|
|
|
}
|