PositionCommand.java 941 Bytes
Newer Older
KingRainbow44's avatar
KingRainbow44 committed
1
2
package emu.grasscutter.command.commands;

方块君's avatar
方块君 committed
3
import emu.grasscutter.Grasscutter;
KingRainbow44's avatar
KingRainbow44 committed
4
5
import emu.grasscutter.command.Command;
import emu.grasscutter.command.CommandHandler;
Melledy's avatar
Melledy committed
6
import emu.grasscutter.game.player.Player;
KingRainbow44's avatar
KingRainbow44 committed
7
8
9
10
11
12
13
14

import java.util.List;

@Command(label = "position", usage = "position", aliases = {"pos"},
        description = "Get coordinates.")
public final class PositionCommand implements CommandHandler {

    @Override
15
    public void execute(Player sender, List<String> args) {
KingRainbow44's avatar
KingRainbow44 committed
16
        if (sender == null) {
方块君's avatar
方块君 committed
17
            CommandHandler.sendMessage(null, Grasscutter.getLanguage().Run_this_command_in_game);
KingRainbow44's avatar
KingRainbow44 committed
18
19
20
            return;
        }

21
        sender.dropMessage(Grasscutter.getLanguage().Position_message.replace("{x}", Float.toString(sender.getPos().getX())).replace("{y}", Float.toString(sender.getPos().getY())).replace("{z}", Float.toString(sender.getPos().getZ())).replace("{id}", Integer.toString(sender.getSceneId())));
KingRainbow44's avatar
KingRainbow44 committed
22
23
    }
}