aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/Boat.h
blob: 1039e8f95277a0f1a145d0cf8931a5dc25534c9b (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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#pragma once
using namespace std;

#include "Entity.h"

class Player;
class Level;
class CompoundTag;
class DamageSource;

class Boat : public Entity
{
public:
	eINSTANCEOF GetType() { return eTYPE_BOAT; };
	static Entity *create(Level *level) { return new Boat(level); }

private:
	// 4J - added for common ctor code
	void _init();
public:
	static const int serialVersionUID = 0;

private:
	static const int DATA_ID_HURT = 17;
	static const int DATA_ID_HURTDIR = 18;
	static const int DATA_ID_DAMAGE = 19;
	static const double MAX_SPEED;
	static const double MAX_COLLISION_SPEED;
	static const double MIN_ACCELERATION;
	static const double MAX_ACCELERATION;

	bool doLerp;
	double acceleration;

public:
	Boat(Level *level);

protected:
	virtual bool makeStepSound();
	virtual void defineSynchedData();

public:
	virtual AABB *getCollideAgainstBox(shared_ptr<Entity> entity);
	virtual AABB *getCollideBox();
	virtual bool isPushable();

	Boat(Level *level, double x, double y, double z);

	virtual double getRideHeight();
	virtual bool hurt(DamageSource *source, int damage);
	virtual void animateHurt();
	virtual bool isPickable();

private:
	int lSteps;
	double lx, ly, lz, lyr, lxr;
	double lxd, lyd, lzd;

public:
	virtual void lerpTo(double x, double y, double z, float yRot, float xRot, int steps);
	virtual void lerpMotion(double xd, double yd, double zd);
	virtual void tick();
	virtual void positionRider();

protected:
	virtual void addAdditonalSaveData(CompoundTag *base);
	virtual void readAdditionalSaveData(CompoundTag *base);

public:
	virtual float getShadowHeightOffs();
	wstring getName();
	virtual bool interact(shared_ptr<Player> player);

	virtual void setDamage(int damage);
	virtual int getDamage();
	virtual void setHurtTime(int hurtTime);
	virtual int getHurtTime();
	virtual void setHurtDir(int hurtDir);
	virtual int getHurtDir();

	bool getDoLerp();
	void setDoLerp(bool doLerp);
};