Rewrite commands

Signed-off-by: Jaida Wu <mlgmxyysd@meowcat.org>
This commit is contained in:
Jaida Wu
2022-04-20 20:21:38 +08:00
Unverified
parent bde8a21140
commit c42d6d81f6
31 changed files with 1025 additions and 1453 deletions
@@ -0,0 +1,22 @@
package emu.grasscutter.command.commands;
import emu.grasscutter.command.Command;
import emu.grasscutter.command.CommandHandler;
import emu.grasscutter.game.GenshinPlayer;
import java.util.List;
@Command(label = "godmode", usage = "godmode [playerId]",
description = "Prevents you from taking damage", permission = "player.godmode")
public class GodMode implements CommandHandler {
@Override
public void onCommand(GenshinPlayer sender, List<String> args) {
if (sender == null) {
CommandHandler.sendMessage(null, "Run this command in-game.");
return; // TODO: toggle player's godmode statue from console or other players
}
sender.setGodmode(!sender.inGodmode());
sender.dropMessage("Godmode is now " + (sender.inGodmode() ? "enabled" : "disabled") + ".");
}
}