diff options
author | Tycho <work.tycho+git@gmail.com> | 2014-01-26 15:20:39 +0100 |
---|---|---|
committer | Tycho <work.tycho+git@gmail.com> | 2014-01-26 15:20:39 +0100 |
commit | 14e48ccb4bbad6f43121dc27f042083cda160f45 (patch) | |
tree | 96df772125eb96f79bf76226e5df91b4e2b99696 /src/ChunkMap.h | |
parent | Added support for overide in c++11 supporting varients of gcc/clang (diff) | |
download | cuberite-14e48ccb4bbad6f43121dc27f042083cda160f45.tar cuberite-14e48ccb4bbad6f43121dc27f042083cda160f45.tar.gz cuberite-14e48ccb4bbad6f43121dc27f042083cda160f45.tar.bz2 cuberite-14e48ccb4bbad6f43121dc27f042083cda160f45.tar.lz cuberite-14e48ccb4bbad6f43121dc27f042083cda160f45.tar.xz cuberite-14e48ccb4bbad6f43121dc27f042083cda160f45.tar.zst cuberite-14e48ccb4bbad6f43121dc27f042083cda160f45.zip |
Diffstat (limited to '')
-rw-r--r-- | src/ChunkMap.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/ChunkMap.h b/src/ChunkMap.h index e9d8ee30b..59a55dc17 100644 --- a/src/ChunkMap.h +++ b/src/ChunkMap.h @@ -12,6 +12,7 @@ class cWorld; +class cWorldInterface; class cItem; class MTRand; class cChunkStay; @@ -136,6 +137,9 @@ public: bool HasChunkAnyClients (int a_ChunkX, int a_ChunkZ); int GetHeight (int a_BlockX, int a_BlockZ); // Waits for the chunk to get loaded / generated bool TryGetHeight (int a_BlockX, int a_BlockZ, int & a_Height); // Returns false if chunk not loaded / generated + void FastSetBlock(int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta); + + void FastSetQueuedBlocks(); void FastSetBlocks (sSetBlockList & a_BlockList); void CollectPickupsByPlayer(cPlayer * a_Player); @@ -144,7 +148,7 @@ public: NIBBLETYPE GetBlockSkyLight (int a_BlockX, int a_BlockY, int a_BlockZ); NIBBLETYPE GetBlockBlockLight(int a_BlockX, int a_BlockY, int a_BlockZ); void SetBlockMeta (int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE a_BlockMeta); - void SetBlock (int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE a_BlockType, BLOCKTYPE a_BlockMeta); + void SetBlock (cWorldInterface * a_WorldInterface, int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE a_BlockType, BLOCKTYPE a_BlockMeta); void QueueSetBlock(int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE a_BlockType, BLOCKTYPE a_BlockMeta, Int64 a_Tick, BLOCKTYPE a_PreviousBlockType = E_BLOCK_AIR); bool GetBlockTypeMeta (int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE & a_BlockType, NIBBLETYPE & a_BlockMeta); bool GetBlockInfo (int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE & a_BlockType, NIBBLETYPE & a_Meta, NIBBLETYPE & a_SkyLight, NIBBLETYPE & a_BlockLight); @@ -388,6 +392,9 @@ private: cEvent m_evtChunkValid; // Set whenever any chunk becomes valid, via ChunkValidated() cWorld * m_World; + + cCriticalSection m_CSFastSetBlock; + sSetBlockList m_FastSetBlockQueue; 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 |