aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/ExperienceOrb.h
blob: 37d11a6c3ed29b6701b5ed3717733c0de79a5357 (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
#pragma once

#include "Entity.h"

class ExperienceOrb :  public Entity
{
public:
	virtual eINSTANCEOF GetType() { return eTYPE_EXPERIENCEORB; }
	static Entity *create(Level *level) { return new ExperienceOrb(level); }

private:
	static const int LIFETIME;

public:
	int tickCount;
	int age;

	int throwTime;

private:
	int health;
	int value;
	shared_ptr<Player> followingPlayer;
	int followingTime;

	void _init();

public:
	ExperienceOrb(Level *level, double x, double y, double z, int count);

protected:
	virtual bool makeStepSound();

public:
	ExperienceOrb(Level *level);

protected:
	virtual void defineSynchedData();

public:
	virtual int getLightColor(float a);
	virtual void tick();
	virtual bool updateInWaterState();

protected:
	virtual void burn(int dmg);

public:
	virtual bool hurt(DamageSource *source, float damage);
	virtual void addAdditonalSaveData(CompoundTag *entityTag);
	virtual void readAdditionalSaveData(CompoundTag *tag);
	virtual void playerTouch(shared_ptr<Player> player);
	int getValue();
	int getIcon();

	static int getExperienceValue(int maxValue);
	virtual bool isAttackable();

	virtual bool shouldRender(Vec3 *c);	// 4J added
};