#include <ChatCommand/TpCommand/TpCommand.hpp>

TpCommand::TpCommand()
{
    require(UserPermission::ArbitraryTeleport);

    addVariant(
        "<x> <y> <z> - Teleport yourself to coordinates.",
        [](Player &player, int x, int y, int z) -> void
        {
            player.teleport(glm::vec3(x, y, z) + glm::vec3(0.5f));

            player.writeChat(formatString("Teleported to $+", player.pos), Color::success);
            Log::info(formatString("'$+' teleported themself to $+", player.getName(), player.pos));
        }
    );
}