diff options
author | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2013-02-28 08:42:45 +0100 |
---|---|---|
committer | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2013-02-28 08:42:45 +0100 |
commit | 2588f5a605d135bc01996f3a685444dfb37978f8 (patch) | |
tree | 4aee764dd164860d546d1e9269c8ee2967810a90 /source/Chunk.h | |
parent | Fixed a copypasta error from rev 1224 (diff) | |
download | cuberite-2588f5a605d135bc01996f3a685444dfb37978f8.tar cuberite-2588f5a605d135bc01996f3a685444dfb37978f8.tar.gz cuberite-2588f5a605d135bc01996f3a685444dfb37978f8.tar.bz2 cuberite-2588f5a605d135bc01996f3a685444dfb37978f8.tar.lz cuberite-2588f5a605d135bc01996f3a685444dfb37978f8.tar.xz cuberite-2588f5a605d135bc01996f3a685444dfb37978f8.tar.zst cuberite-2588f5a605d135bc01996f3a685444dfb37978f8.zip |
Diffstat (limited to 'source/Chunk.h')
-rw-r--r-- | source/Chunk.h | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/source/Chunk.h b/source/Chunk.h index 7985bbff0..324929cac 100644 --- a/source/Chunk.h +++ b/source/Chunk.h @@ -131,16 +131,30 @@ public: void SetBlock(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta ); // SetBlock() does a lot of work (heightmap, tickblocks, blockentities) so a BlockIdx version doesn't make sense void SetBlock( const Vector3i & a_RelBlockPos, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta ) { SetBlock( a_RelBlockPos.x, a_RelBlockPos.y, a_RelBlockPos.z, a_BlockType, a_BlockMeta ); } - void CheckBlock(int a_RelX, int a_RelY, int a_RelZ); + + /// Queues block for ticking (m_ToTickQueue) + void QueueTickBlock(int a_RelX, int a_RelY, int a_RelZ); + + /// Queues all 6 neighbors of the specified block for ticking (m_ToTickQueue). If any are outside the chunk, relays the checking to the proper neighboring chunk + void QueueTickBlockNeighbors(int a_RelX, int a_RelY, int a_RelZ); + void FastSetBlock(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_BlockType, BLOCKTYPE a_BlockMeta ); // Doesn't force block updates on neighbors, use for simple changes such as grass growing etc. BLOCKTYPE GetBlock( int a_X, int a_Y, int a_Z ); BLOCKTYPE GetBlock( int a_BlockIdx ); void GetBlockTypeMeta(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE & a_BlockType, NIBBLETYPE & a_BlockMeta); void GetBlockInfo (int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE & a_BlockType, NIBBLETYPE & a_Meta, NIBBLETYPE & a_SkyLight, NIBBLETYPE & a_BlockLight); - /// Queues all 6 neighbors of the specified block for checking. If outside the chunk, relays the checking to the neighboring chunk - void CheckNeighbors(int a_RelX, int a_RelY, int a_RelZ); - + /** Returns the chunk into which the specified block belongs, by walking the neighbors. + Will return self if appropriate. Returns NULL if not reachable through neighbors. + */ + cChunk * GetNeighborChunk(int a_BlockX, int a_BlockY, int a_BlockZ); + + /** + Returns the chunk into which the relatively-specified block belongs, by walking the neighbors. + Will return self if appropriate. Returns NULL if not reachable through neighbors. + */ + cChunk * GetRelNeighborChunk(int a_RelX, int a_RelY, int a_RelZ); + EMCSBiome GetBiomeAt(int a_RelX, int a_RelZ) const {return cChunkDef::GetBiome(m_BiomeMap, a_RelX, a_RelZ); } void CollectPickupsByPlayer(cPlayer * a_Player); |