12 #include "../Entities/Player.h"
34 virtual bool Tick(std::chrono::milliseconds a_Dt,
cChunk & a_Chunk)
override;
unsigned char NIBBLETYPE
The datatype used by nibbledata (meta, light, skylight)
unsigned char BLOCKTYPE
The datatype used by blockdata.
eMonsterType
Identifies individual monster type.
cBlockEntity(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Vector3i a_Pos, cWorld *a_World)
void SetSpawnDelay(short a_Delay)
void SetSpawnRange(short a_SpawnRange)
virtual bool UsedBy(cPlayer *a_Player) override
Called when a player uses this entity; should open the UI window.
int GetNearbyPlayersNum(void)
short GetSpawnDelay(void) const
short m_SpawnDelay
Time in ticks until the next entity spawns.
void UpdateActiveState(void)
Update the active flag from the mob spawner.
short m_SpawnRange
Diameter of the square the new monsters are spawned in.
virtual void SendTo(cClientHandle &a_Client) override
Sends the packet defining the block entity to the client specified.
short GetRequiredPlayerRange(void) const
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 SetMaxSpawnDelay(short a_Max)
void SetMinSpawnDelay(short a_Min)
void ResetTimer(void)
Sets the spawn delay to a new random value.
virtual void CopyFrom(const cBlockEntity &a_Src) override
Copies all properties of a_Src into this entity, except for its m_World and location.
eMonsterType m_Entity
The entity to spawn.
short m_SpawnCount
Number of entities the spawner tries to spawn each activation.
short GetMaxSpawnDelay(void) const
short GetSpawnRange(void) const
short m_MaxNearbyEntities
Maximum amount of the same entity type in proximity.
cMobSpawnerEntity(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Vector3i a_Pos, cWorld *a_World)
short GetMinSpawnDelay(void) const
void SpawnEntity(void)
Spawns the entity.
int GetNearbyMonsterNum(eMonsterType a_EntityType)
short m_RequiredPlayerRange
Maximum distance to player for activation.
void SetRequiredPlayerRange(short a_RequiredPlayerRange)
void SetEntity(eMonsterType a_EntityType)
void SetMaxNearbyEntities(short a_MaxNearbyEntities)
short GetSpawnCount(void) const
eMonsterType GetEntity(void) const
void SetSpawnCount(short a_SpawnCount)
short GetMaxNearbyEntities(void) const