mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-05-16 15:02:52 +00:00
50 lines
1.2 KiB
C++
50 lines
1.2 KiB
C++
#pragma once
|
|
|
|
#include <string>
|
|
|
|
#include "TileEntity.h"
|
|
#include "java/Class.h"
|
|
#include "minecraft/world/level/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 std::shared_ptr<Packet> getUpdatePacket();
|
|
virtual bool triggerEvent(int b0, int b1);
|
|
virtual BaseMobSpawner* getSpawner();
|
|
|
|
// 4J Added
|
|
virtual std::shared_ptr<TileEntity> clone();
|
|
void setEntityId(const std::string& id);
|
|
};
|