Add pos command

Signed-off-by: Jaida Wu <mlgmxyysd@meowcat.org>
This commit is contained in:
Jaida Wu 2022-04-20 20:58:57 +08:00
parent 87c7fba2d2
commit f898795c11
No known key found for this signature in database
GPG Key ID: 2A5EF9CA5CD6B350

View File

@ -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 = "pos",
usage = "Usage: pos", description = "Get coordinates.")
public class Pos implements CommandHandler {
@Override
public void onCommand(GenshinPlayer sender, List<String> args) {
if (sender == null) {
CommandHandler.sendMessage(null, "Run this command in-game.");
return;
}
sender.dropMessage(String.format("Coord: %.3f, %.3f, %.3f", sender.getPos().getX(), sender.getPos().getY(), sender.getPos().getZ()));
}
}