summaryrefslogtreecommitdiffstats
path: root/source/World.h
diff options
context:
space:
mode:
authorSamuel Barney <samjbarney@gmail.com>2013-10-14 18:03:47 +0200
committerSamuel Barney <samjbarney@gmail.com>2013-10-14 18:03:47 +0200
commit318d5522486f3aedc2e808f955eff97957bd968e (patch)
tree7d9a3c5ad98585fb298691110dd4296de86a9317 /source/World.h
parentMerge branch 'master' of https://github.com/mc-server/MCServer (diff)
parentMerge branch 'master' into MobSpawning (diff)
downloadcuberite-318d5522486f3aedc2e808f955eff97957bd968e.tar
cuberite-318d5522486f3aedc2e808f955eff97957bd968e.tar.gz
cuberite-318d5522486f3aedc2e808f955eff97957bd968e.tar.bz2
cuberite-318d5522486f3aedc2e808f955eff97957bd968e.tar.lz
cuberite-318d5522486f3aedc2e808f955eff97957bd968e.tar.xz
cuberite-318d5522486f3aedc2e808f955eff97957bd968e.tar.zst
cuberite-318d5522486f3aedc2e808f955eff97957bd968e.zip
Diffstat (limited to '')
-rw-r--r--source/World.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/source/World.h b/source/World.h
index 25bc0b338..a91007b17 100644
--- a/source/World.h
+++ b/source/World.h
@@ -42,6 +42,7 @@ class cChunkGenerator; // The thread responsible for generating chunks
class cChestEntity;
class cDispenserEntity;
class cFurnaceEntity;
+class cMobCensus;
typedef std::list< cPlayer * > cPlayerList;
@@ -580,6 +581,7 @@ public:
/// Spawns a mob of the specified type. Returns the mob's EntityID if recognized and spawned, <0 otherwise
int SpawnMob(double a_PosX, double a_PosY, double a_PosZ, cMonster::eType a_MonsterType); // tolua_export
+ int SpawnMobFinalize(cMonster* a_Monster);
/// Creates a projectile of the specified type. Returns the projectile's EntityID if successful, <0 otherwise
int CreateProjectile(double a_PosX, double a_PosY, double a_PosZ, cProjectileEntity::eKind a_Kind, cEntity * a_Creator, const Vector3d * a_Speed = NULL); // tolua_export
@@ -632,7 +634,7 @@ private:
Int64 m_LastTimeUpdate; // The tick in which the last time update has been sent.
Int64 m_LastUnload; // The last WorldAge (in ticks) in which unloading was triggerred
Int64 m_LastSave; // The last WorldAge (in ticks) in which save-all was triggerred
- Int64 m_LastSpawnMonster; // The last WorldAge (in ticks) in which a monster was spawned
+ std::map<cMonster::eFamily,Int64> m_LastSpawnMonster; // The last WorldAge (in ticks) in which a monster was spawned (for each megatype of monster) // MG TODO : find a way to optimize without creating unmaintenability (if mob IDs are becoming unrowed)
eGameMode m_GameMode;
bool m_bEnabledPVP;
@@ -662,7 +664,7 @@ private:
cChunkMap * m_ChunkMap;
bool m_bAnimals;
- Int64 m_SpawnMonsterRate;
+ std::set<cMonster::eType> m_AllowedMobs;
eWeather m_Weather;
int m_WeatherInterval;
@@ -717,8 +719,8 @@ private:
/// Handles the weather in each tick
void TickWeather(float a_Dt);
- /// Handles the mob spawning each tick
- void TickSpawnMobs(float a_Dt);
+ /// Handles the mob spawning/moving/destroying each tick
+ void TickMobs(float a_Dt);
/// Executes all tasks queued onto the tick thread
void TickQueuedTasks(void);