From f898795c11a8649b7d6fc9cd8da9eb34f0bad87f Mon Sep 17 00:00:00 2001 From: Jaida Wu Date: Wed, 20 Apr 2022 20:58:57 +0800 Subject: [PATCH] Add pos command Signed-off-by: Jaida Wu --- .../emu/grasscutter/command/commands/Pos.java | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/main/java/emu/grasscutter/command/commands/Pos.java diff --git a/src/main/java/emu/grasscutter/command/commands/Pos.java b/src/main/java/emu/grasscutter/command/commands/Pos.java new file mode 100644 index 000000000..e77eae1ff --- /dev/null +++ b/src/main/java/emu/grasscutter/command/commands/Pos.java @@ -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 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())); + } +}