summaryrefslogtreecommitdiffstats
path: root/src/BlockArea.h
diff options
context:
space:
mode:
authorJulian Laubstein <julianlaubstein@yahoo.de>2015-06-08 23:05:49 +0200
committerJulian Laubstein <julianlaubstein@yahoo.de>2015-06-08 23:05:49 +0200
commit87a8df7cdec4b914e82177a84694d9f5b4760d4d (patch)
treead10ff1cbc0f692bce7a44c969b3a9e20e06ac91 /src/BlockArea.h
parentMerge pull request #2212 from mc-server/revert-2179-ChunkQueueCollapsing (diff)
parentcBlockArea: Added CountSpecificBlocks() API function. (diff)
downloadcuberite-87a8df7cdec4b914e82177a84694d9f5b4760d4d.tar
cuberite-87a8df7cdec4b914e82177a84694d9f5b4760d4d.tar.gz
cuberite-87a8df7cdec4b914e82177a84694d9f5b4760d4d.tar.bz2
cuberite-87a8df7cdec4b914e82177a84694d9f5b4760d4d.tar.lz
cuberite-87a8df7cdec4b914e82177a84694d9f5b4760d4d.tar.xz
cuberite-87a8df7cdec4b914e82177a84694d9f5b4760d4d.tar.zst
cuberite-87a8df7cdec4b914e82177a84694d9f5b4760d4d.zip
Diffstat (limited to 'src/BlockArea.h')
-rw-r--r--src/BlockArea.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/BlockArea.h b/src/BlockArea.h
index 4b672029b..a9963b4ef 100644
--- a/src/BlockArea.h
+++ b/src/BlockArea.h
@@ -308,6 +308,15 @@ public:
Returns 0 if blocktypes not available. Block metas are ignored (if present, air with any meta is still considered air). */
size_t CountNonAirBlocks(void) const;
+ /** Returns how many times the specified block is contained in the area.
+ The blocks' meta values are ignored, only the blocktype is compared. */
+ size_t CountSpecificBlocks(BLOCKTYPE a_BlockType) const;
+
+ /** Returns how many times the specified block is contained in the area.
+ Both the block's type and meta must match in order to be counted in.
+ If the block metas aren't present in the area, logs a warning and ignores the meta specification. */
+ size_t CountSpecificBlocks(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta) const;
+
// tolua_end
/** Returns the minimum and maximum coords in each direction for the first non-ignored block in each direction.