summaryrefslogtreecommitdiffstats
path: root/src/ChunkMap.h
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-12-25 00:31:56 +0100
committerMattes D <github@xoft.cz>2014-12-25 00:31:56 +0100
commit1d593134da55317e3ec09c56463d4a0a92128b81 (patch)
tree220066e191e85bb3fafd4bccbcfbe62ed737f2f6 /src/ChunkMap.h
parentByteBuffer: SingleThreadAccessChecker is request-only. (diff)
parentAPIDump: Updated the player block placement documentation. (diff)
downloadcuberite-1d593134da55317e3ec09c56463d4a0a92128b81.tar
cuberite-1d593134da55317e3ec09c56463d4a0a92128b81.tar.gz
cuberite-1d593134da55317e3ec09c56463d4a0a92128b81.tar.bz2
cuberite-1d593134da55317e3ec09c56463d4a0a92128b81.tar.lz
cuberite-1d593134da55317e3ec09c56463d4a0a92128b81.tar.xz
cuberite-1d593134da55317e3ec09c56463d4a0a92128b81.tar.zst
cuberite-1d593134da55317e3ec09c56463d4a0a92128b81.zip
Diffstat (limited to 'src/ChunkMap.h')
-rw-r--r--src/ChunkMap.h23
1 files changed, 19 insertions, 4 deletions
diff --git a/src/ChunkMap.h b/src/ChunkMap.h
index 6a858b06d..fe0bb3733 100644
--- a/src/ChunkMap.h
+++ b/src/ChunkMap.h
@@ -143,7 +143,13 @@ public:
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 FastSetBlocks(sSetBlockList & a_BlockList);
+
+ /** Performs the specified single-block set operations simultaneously, as if SetBlock() was called for each item.
+ Is more efficient than calling SetBlock() multiple times.
+ If the chunk for any of the blocks is not loaded, the set operation is ignored silently. */
+ void SetBlocks(const sSetBlockVector & a_Blocks);
+
void CollectPickupsByPlayer(cPlayer & a_Player);
BLOCKTYPE GetBlock (int a_BlockX, int a_BlockY, int a_BlockZ);
@@ -173,11 +179,20 @@ public:
(Re)sends the chunks to their relevant clients if successful. */
bool SetAreaBiome(int a_MinX, int a_MaxX, int a_MinZ, int a_MaxZ, EMCSBiome a_Biome);
- /** Retrieves block types of the specified blocks. If a chunk is not loaded, doesn't modify the block. Returns true if all blocks were read. */
+ /** Retrieves block types and metas of the specified blocks.
+ If a chunk is not loaded, doesn't modify the block and consults a_ContinueOnFailure whether to process the rest of the array.
+ Returns true if all blocks were read, false if any one failed. */
bool GetBlocks(sSetBlockVector & a_Blocks, bool a_ContinueOnFailure);
- bool DigBlock (int a_X, int a_Y, int a_Z);
- void SendBlockTo(int a_X, int a_Y, int a_Z, cPlayer * a_Player);
+ /** Removes the block at the specified coords and wakes up simulators.
+ Returns false if the chunk is not loaded (and the block is not dug).
+ Returns true if successful. */
+ bool DigBlock(int a_BlockX, int a_BlockY, int a_BlockZ);
+
+ /** Sends the block at the specified coords to the specified player.
+ Uses a blockchange packet to send the block.
+ If the relevant chunk isn't loaded, doesn't do anything. */
+ void SendBlockTo(int a_BlockX, int a_BlockY, int a_BlockZ, cPlayer * a_Player);
/** Compares clients of two chunks, calls the callback accordingly */
void CompareChunkClients(int a_ChunkX1, int a_ChunkZ1, int a_ChunkX2, int a_ChunkZ2, cClientDiffCallback & a_Callback);