aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/Throwable.h
blob: 217f2f1e04a1b5901174e664c75e1052a1ef33e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#pragma once

#include "Entity.h"
#include "Projectile.h"

class Mob;
class HitResult;

class Throwable : public Entity, public Projectile
{
private:
	int xTile;
	int yTile;
	int zTile;
	int lastTile;

protected:
	bool inGround;

public:
	int shakeTime;

	shared_ptr<LivingEntity> owner;

private:
	wstring ownerName;
	int life;
	int flightTime;

	void _throwableInit();

public:
	Throwable(Level *level);

protected:
	virtual void defineSynchedData();

public:
	virtual bool shouldRenderAtSqrDistance(double distance);

	Throwable(Level *level, shared_ptr<LivingEntity> 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();
	virtual shared_ptr<LivingEntity> getOwner();
};