MinecraftConsoles/Minecraft.World/ControlledByPlayerGoal.h
Riley M. c0da06e4ee
major: Switch to forward slashes(+more) to fix compilation on Linux (#1403)
Notably also adds some metadata files for NixOS 

* add support for linux clang cross compiles

* add linux clang instructions

* un-capitalize Mob.horse.*

* update the description in flake.nix

---------

Co-authored-by: Loki <lokirautio@gmail.com>
2026-04-14 16:47:37 -05:00

37 lines
701 B
C++

#pragma once
#include "Goal.h"
#include "../Minecraft.World/SharedConstants.h"
class Mob;
class ControlledByPlayerGoal : public Goal
{
private:
static const int MIN_BOOST_TIME = SharedConstants::TICKS_PER_SECOND * 7;
static const int MAX_BOOST_TIME = SharedConstants::TICKS_PER_SECOND * 35;
Mob *mob; // Owner of this goal
float maxSpeed;
float walkSpeed;
float speed;
bool boosting;
int boostTime;
int boostTimeTotal;
public:
ControlledByPlayerGoal(Mob *mob, float maxSpeed, float walkSpeed); // 4J Added walkSpeed param
void start();
void stop();
bool canUse();
void tick();
private:
bool isNoJumpTile(int tile);
public:
bool isBoosting();
void boost();
bool canBoost();
};