diff options
author | Alexander Harkness <bearbin@gmail.com> | 2015-05-19 19:43:19 +0200 |
---|---|---|
committer | Alexander Harkness <bearbin@gmail.com> | 2015-05-19 19:43:19 +0200 |
commit | cbb425f027a7b51c4aed5d3399b26cf325c4c8ce (patch) | |
tree | 6a35f2c9c44b7d3d5142635178bf1ec9ca5e428c /src/ChunkMap.h | |
parent | Updated Core. (diff) | |
parent | Merge pull request #2057 from Seadragon91/master (diff) | |
download | cuberite-cbb425f027a7b51c4aed5d3399b26cf325c4c8ce.tar cuberite-cbb425f027a7b51c4aed5d3399b26cf325c4c8ce.tar.gz cuberite-cbb425f027a7b51c4aed5d3399b26cf325c4c8ce.tar.bz2 cuberite-cbb425f027a7b51c4aed5d3399b26cf325c4c8ce.tar.lz cuberite-cbb425f027a7b51c4aed5d3399b26cf325c4c8ce.tar.xz cuberite-cbb425f027a7b51c4aed5d3399b26cf325c4c8ce.tar.zst cuberite-cbb425f027a7b51c4aed5d3399b26cf325c4c8ce.zip |
Diffstat (limited to 'src/ChunkMap.h')
-rw-r--r-- | src/ChunkMap.h | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/ChunkMap.h b/src/ChunkMap.h index 0fac79c84..35f66f339 100644 --- a/src/ChunkMap.h +++ b/src/ChunkMap.h @@ -64,7 +64,7 @@ public: static const int LAYER_SIZE = 32; - cChunkMap(cWorld* a_World); + cChunkMap(cWorld * a_World); ~cChunkMap(); // Broadcast respective packets to all clients of the chunk where the event is taking place @@ -104,6 +104,9 @@ public: /** Calls the callback for the chunk specified, with ChunkMapCS locked; returns false if the chunk doesn't exist, otherwise returns the same value as the callback */ bool DoWithChunk(int a_ChunkX, int a_ChunkZ, cChunkCallback & a_Callback); + /** Calls the callback for the chunk at the block position specified, with ChunkMapCS locked; returns false if the chunk doesn't exist, otherwise returns the same value as the callback **/ + bool DoWithChunkAt(Vector3i a_BlockPos, std::function<bool(cChunk &)> a_Callback); + /** Wakes up simulators for the specified block */ void WakeUpSimulators(int a_BlockX, int a_BlockY, int a_BlockZ); @@ -361,11 +364,11 @@ public: /** Sets the blockticking to start at the specified block. Only one blocktick per chunk may be set, second call overwrites the first call */ void SetNextBlockTick(int a_BlockX, int a_BlockY, int a_BlockZ); - /** Make a Mob census, of all mobs, their family, their chunk and theyr distance to closest player */ - void CollectMobCensus(cMobCensus& a_ToFill); + /** Make a Mob census, of all mobs, their family, their chunk and their distance to closest player */ + void CollectMobCensus(cMobCensus & a_ToFill); /** Try to Spawn Monsters inside all Chunks */ - void SpawnMobs(cMobSpawner& a_MobSpawner); + void SpawnMobs(cMobSpawner & a_MobSpawner); void Tick(std::chrono::milliseconds a_Dt); @@ -430,9 +433,10 @@ private: void UnloadUnusedChunks(void); /** Collect a mob census, of all mobs, their megatype, their chunk and their distance o closest player */ - void CollectMobCensus(cMobCensus& a_ToFill); + void CollectMobCensus(cMobCensus & a_ToFill); + /** Try to Spawn Monsters inside all Chunks */ - void SpawnMobs(cMobSpawner& a_MobSpawner); + void SpawnMobs(cMobSpawner & a_MobSpawner); void Tick(std::chrono::milliseconds a_Dt); |