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

#include "TileEntity.h"
#include "BaseMobSpawner.h"

class Packet;
class Entity;

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

private:
	class TileEntityMobSpawner : public BaseMobSpawner
	{
	private:
		MobSpawnerTileEntity *m_parent;

	public:
		TileEntityMobSpawner(MobSpawnerTileEntity *parent);

		void broadcastEvent(int id);
		Level *getLevel();
		int getX();
		int getY();
		int getZ();
		void setNextSpawnData(BaseMobSpawner::SpawnData *nextSpawnData);
	};

	BaseMobSpawner *spawner;

public:
	MobSpawnerTileEntity();
	~MobSpawnerTileEntity();

	virtual void load(CompoundTag *tag);
	virtual void save(CompoundTag *tag);
	virtual void tick();
	virtual shared_ptr<Packet> getUpdatePacket();
	virtual bool triggerEvent(int b0, int b1);
	virtual BaseMobSpawner *getSpawner();

	// 4J Added
	virtual shared_ptr<TileEntity> clone();
	void setEntityId(const wstring &id);
};