Files
MinecraftConsoles/Minecraft.World/Throwable.h
void_17 7074f35e4b shared_ptr -> std::shared_ptr
This is one of the first commits in a plan to remove all `using namespace std;` lines in the entire codebase as it is considered anti-pattern today.
2026-03-02 15:58:20 +07:00

60 lines
1.0 KiB
C++

#pragma once
#include "Entity.h"
class Mob;
class HitResult;
class Throwable : public Entity
{
private:
int xTile;
int yTile;
int zTile;
int lastTile;
protected:
bool inGround;
public:
int shakeTime;
protected:
std::shared_ptr<Mob> owner;
private:
int life;
int flightTime;
void _throwableInit();
public:
Throwable(Level *level);
protected:
virtual void defineSynchedData();
public:
virtual bool shouldRenderAtSqrDistance(double distance);
Throwable(Level *level, std::shared_ptr<Mob> mob);
Throwable(Level *level, double x, double y, double z);
protected:
virtual float getThrowPower();
virtual float getThrowUpAngleOffset();
public:
virtual void shoot(double xd, double yd, double zd, float pow, float uncertainty);
virtual void lerpMotion(double xd, double yd, double zd);
virtual void tick();
protected:
virtual float getGravity();
virtual void onHit(HitResult *res) = 0;
public:
virtual void addAdditonalSaveData(CompoundTag *tag);
virtual void readAdditionalSaveData(CompoundTag *tag);
virtual float getShadowHeightOffs();
};