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

#include "TileEntity.h"

class Packet;
class Entity;

class MobSpawnerTileEntity : public TileEntity
{
public:
	eINSTANCEOF GetType() { return eTYPE_MOBSPAWNERTILEENTITY; }
	static TileEntity *create() { return new MobSpawnerTileEntity(); }

using TileEntity::setChanged;

private:
	static const int MAX_DIST;

public:
	int spawnDelay;

private:
	wstring entityId;
	CompoundTag *spawnData;

	bool m_bEntityIdUpdated; // 4J Added

public:
	double spin, oSpin;

private:
	int minSpawnDelay;
	int maxSpawnDelay;
	int spawnCount;
	shared_ptr<Entity> displayEntity;
	
public:
	MobSpawnerTileEntity();

	wstring getEntityId();
	void setEntityId(const wstring& entityId);
	bool isNearPlayer();
	virtual void tick();
	void fillExtraData(shared_ptr<Entity> entity);

private:
	void delay();

public:
	virtual void load(CompoundTag *tag);
	virtual void save(CompoundTag *tag);

	shared_ptr<Entity> getDisplayEntity();
	virtual shared_ptr<Packet> getUpdatePacket();

	// 4J Added
	virtual shared_ptr<TileEntity> clone();
};