mirror of
https://github.com/Melledy/LunarCore.git
synced 2025-12-12 13:24:36 +01:00
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:
@@ -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.
|
/reload. Reloads the server config.
|
||||||
/scene [scene id] [floor id]. Teleports the player to the specified scene.
|
/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.
|
/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.
|
/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.
|
/worldlevel [world level]. Sets the targeted player's equilibrium level.
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user