Pos.java 714 Bytes
Newer Older
Jaida Wu's avatar
Jaida Wu committed
1
2
3
4
5
6
7
8
package emu.grasscutter.command.commands;

import emu.grasscutter.command.Command;
import emu.grasscutter.command.CommandHandler;
import emu.grasscutter.game.GenshinPlayer;

import java.util.List;

Jaida Wu's avatar
Jaida Wu committed
9
10
@Command(label = "pos", usage = "pos",
        description = "Get coordinates.")
Jaida Wu's avatar
Jaida Wu committed
11
12
13
public class Pos implements CommandHandler {

    @Override
KingRainbow44's avatar
KingRainbow44 committed
14
    public void execute(GenshinPlayer sender, List<String> args) {
Jaida Wu's avatar
Jaida Wu committed
15
16
17
18
19
20
21
22
        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()));
    }
}