Added a stop command

I found the absence of a stop command particuraly annoying so i implemented it in 10 minutes
This commit is contained in:
Kostas214
2024-03-12 23:53:31 +02:00
committed by Melledy
parent dd9646cfc8
commit a6b656bdd2
2 changed files with 21 additions and 0 deletions

View File

@@ -80,6 +80,7 @@ Server commands can be run in the server console or in-game. There is a dummy us
/reload. Reloads the server config.
/scene [scene id] [floor id]. Teleports the player to the specified scene.
/spawn [monster/prop id] x[amount] s[stage id]. Spawns a monster or prop near the targeted player.
/stop. Stops the server
/unstuck @[player id]. Unstucks an offline player if they're in a scene that doesn't load.
/worldlevel [world level]. Sets the targeted player's equilibrium level.
```

View File

@@ -0,0 +1,20 @@
package emu.lunarcore.command.commands;
import emu.lunarcore.command.Command;
import emu.lunarcore.command.CommandArgs;
import emu.lunarcore.command.CommandHandler;
@Command(label = "stop",
aliases = {"exit"},
permission = "admin.stop",
requireTarget = false,
desc = "/stop - Stops the server")
public class StopCommand implements CommandHandler {
@Override
public void execute(CommandArgs args) {
args.sendMessage("Stopping server");
System.exit(1000);
}
}