summaryrefslogtreecommitdiffstats
path: root/source/Chunk.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/Chunk.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 'source/Chunk.h')
-rw-r--r--source/Chunk.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/source/Chunk.h b/source/Chunk.h
index c979b7928..aca180d16 100644
--- a/source/Chunk.h
+++ b/source/Chunk.h
@@ -49,6 +49,8 @@ class cPickup;
class cChunkDataSerializer;
class cBlockArea;
class cFluidSimulatorData;
+class cMobCensus;
+class cMobSpawner;
typedef std::list<cClientHandle *> cClientHandleList;
typedef cItemCallback<cEntity> cEntityCallback;
@@ -124,6 +126,12 @@ public:
/// Sets or resets the internal flag that prevents chunk from being unloaded
void Stay(bool a_Stay = true);
+ /// Recence all mobs proximities to players in order to know what to do with them
+ void CollectMobCensus(cMobCensus& toFill);
+
+ /// Try to Spawn Monsters inside chunk
+ void SpawnMobs(cMobSpawner& a_MobSpawner);
+
void Tick(float a_Dt);
int GetPosX(void) const { return m_PosX; }
@@ -385,6 +393,10 @@ private:
cSandSimulatorChunkData m_SandSimulatorData;
+ // pick up a random block of this chunk
+ void getRandomBlockCoords(int& a_X, int& a_Y, int& a_Z);
+ void getThreeRandomNumber(int& a_X, int& a_Y, int& a_Z,int a_MaxX, int a_MaxY, int a_MaxZ);
+
void RemoveBlockEntity(cBlockEntity * a_BlockEntity);
void AddBlockEntity (cBlockEntity * a_BlockEntity);