#include "Step.h"

#include "Utils/MoveUtils.h"
#include "Utils/TimeUtils.h"

auto Step::onWorldTick(Player* _this) -> void {
	auto clientinstance = Client::clientinstance;
	if (!clientinstance) return;

	auto blocksource = clientinstance->getBlockSource();
	if (!blocksource) return;

	if (reverse && Utils::Move::isOnGround(_this)) {
		glm::ivec3 blockpos = Utils::Move::getBlockPosition(_this);
		glm::vec3 vel = Utils::Move::getVelocity(_this);
		Utils::Move::setVelocity(_this, glm::vec3(vel.x, -reversespeed, vel.z));
	}
}

auto Step::getMode() -> std::string {
	return _("Motion");
}
