aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/FishingHook.h
blob: ec91e630957eb66d19088dcfa348779af28557d6 (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
#pragma once
using namespace std;

#include "Entity.h"

class Player;

class FishingHook : public Entity
{
public:
	eINSTANCEOF GetType() { return eTYPE_FISHINGHOOK; }

private:
	int xTile;
	int yTile;
	int zTile;
	int lastTile;
	bool inGround;

public:
	int shakeTime;
	shared_ptr<Player> owner;

private:
	int life;
	int flightTime;
	int nibble;

public:
	shared_ptr<Entity> hookedIn;

private:
	void _init();

public:
	FishingHook(Level *level);
	FishingHook(Level *level, double x, double y, double z, shared_ptr<Player> owner);
	FishingHook(Level *level, shared_ptr<Player> mob);

protected:
	virtual void defineSynchedData();

public:
	bool shouldRenderAtSqrDistance(double distance);
	void shoot(double xd, double yd, double zd, float pow, float uncertainty);

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 addAdditonalSaveData(CompoundTag *tag);
	virtual void readAdditionalSaveData(CompoundTag *tag);
	virtual float getShadowHeightOffs();
	int retrieve();

	// 4J Stu - Brought forward from 1.4
	virtual void remove();
};