diff options
author | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-05-29 16:59:43 +0200 |
---|---|---|
committer | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-05-29 16:59:43 +0200 |
commit | 9d6a5b9ce0ea5fbbb377b6a950ec1f27ae6a1587 (patch) | |
tree | 279c6f1967efd37a7b302196bc27ac232a038ea7 /source/cChunkMap.h | |
parent | Cacti don't gather snow (diff) | |
download | cuberite-9d6a5b9ce0ea5fbbb377b6a950ec1f27ae6a1587.tar cuberite-9d6a5b9ce0ea5fbbb377b6a950ec1f27ae6a1587.tar.gz cuberite-9d6a5b9ce0ea5fbbb377b6a950ec1f27ae6a1587.tar.bz2 cuberite-9d6a5b9ce0ea5fbbb377b6a950ec1f27ae6a1587.tar.lz cuberite-9d6a5b9ce0ea5fbbb377b6a950ec1f27ae6a1587.tar.xz cuberite-9d6a5b9ce0ea5fbbb377b6a950ec1f27ae6a1587.tar.zst cuberite-9d6a5b9ce0ea5fbbb377b6a950ec1f27ae6a1587.zip |
Diffstat (limited to '')
-rw-r--r-- | source/cChunkMap.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/source/cChunkMap.h b/source/cChunkMap.h index 716f5ac93..4b381296d 100644 --- a/source/cChunkMap.h +++ b/source/cChunkMap.h @@ -84,7 +84,6 @@ public: bool IsChunkValid (int a_ChunkX, int a_ChunkY, int a_ChunkZ);
bool HasChunkAnyClients (int a_ChunkX, int a_ChunkY, int a_ChunkZ);
- void SpreadChunkLighting(int a_ChunkX, int a_ChunkY, int a_ChunkZ);
int GetHeight (int a_BlockX, int a_BlockZ);
void FastSetBlocks (sSetBlockList & a_BlockList);
void CollectPickupsByPlayer(cPlayer * a_Player);
@@ -164,7 +163,7 @@ public: private:
- friend class cChunk; // Temporary (until we have a separate Lighting thread), so that cChunk's lighting calc can ask for neighbor chunks
+ friend class cChunk; // The chunks can manipulate neighbors while in their Tick() method, using LockedGetBlock() and LockedSetBlock()
class cChunkLayer
{
@@ -215,6 +214,15 @@ private: cChunkPtr GetChunk (int a_ChunkX, int a_ChunkY, int a_ChunkZ); // Also queues the chunk for loading / generating if not valid
cChunkPtr GetChunkNoGen (int a_ChunkX, int a_ChunkY, int a_ChunkZ); // Also queues the chunk for loading if not valid; doesn't generate
cChunkPtr GetChunkNoLoad(int a_ChunkX, int a_ChunkY, int a_ChunkZ); // Doesn't load, doesn't generate
+
+ /// Gets a block in any chunk while in the cChunk's Tick() method; returns true if successful, false if chunk not loaded (doesn't queue load)
+ bool LockedGetBlock(int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE & a_BlockType, NIBBLETYPE & a_BlockMeta);
+
+ /// Sets a block in any chunk while in the cChunk's Tick() method; returns true if successful, false if chunk not loaded (doesn't queue load)
+ bool LockedSetBlock(int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta);
+
+ /// Fast-sets a block in any chunk while in the cChunk's Tick() method; returns true if successful, false if chunk not loaded (doesn't queue load)
+ bool LockedFastSetBlock(int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta);
};
|