12 #include "../Entities/Player.h" 34 virtual bool Tick(std::chrono::milliseconds a_Dt,
cChunk & a_Chunk)
override;
void ResetTimer(void)
Sets the spawn delay to a new random value.
int GetNearbyPlayersNum(void)
Returns the amount of the nearby players in a 16-block radius.
eMonsterType GetEntity(void) const
Returns the entity type that will be spawn by this mob spawner.
static const char * GetClassStatic(void)
virtual void SendTo(cClientHandle &a_Client) override
Sends the packet defining the block entity to the client specified.
unsigned char BLOCKTYPE
The datatype used by blockdata.
unsigned char NIBBLETYPE
The datatype used by nibbledata (meta, light, skylight)
eMonsterType
Identifies individual monster type, as well as their network type-ID.
void SetSpawnDelay(short a_Delay)
Sets the spawn delay.
virtual void CopyFrom(const cBlockEntity &a_Src) override
Copies all properties of a_Src into this entity, except for its m_World and location.
cMobSpawnerEntity(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Vector3i a_Pos, cWorld *a_World)
virtual bool Tick(std::chrono::milliseconds a_Dt, cChunk &a_Chunk) override
Ticks the entity; returns true if the chunk should be marked as dirty as a result of this ticking...
void UpdateActiveState(void)
Upate the active flag from the mob spawner.
eMonsterType m_Entity
The entity to spawn.
virtual bool UsedBy(cPlayer *a_Player) override
Called when a player uses this entity; should open the UI window.
void SpawnEntity(void)
Spawns the entity.
void SetEntity(eMonsterType a_EntityType)
Sets the entity type who will be spawn by this mob spawner.
cBlockEntity(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Vector3i a_Pos, cWorld *a_World)
short GetSpawnDelay(void) const
Returns the spawn delay.
int GetNearbyMonsterNum(eMonsterType a_EntityType)
Returns the amount of this monster type in a 8-block radius (Y: 4-block radius).