summaryrefslogtreecommitdiffstats
path: root/src/ChunkMap.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-03-07 17:54:10 +0100
committerMattes D <github@xoft.cz>2014-03-07 17:54:10 +0100
commitf72c747b5005df8bc53a9e38e52fc47ceae8515c (patch)
tree6abf8ca1a3f2bd35c059bffe226b26a4c553e723 /src/ChunkMap.cpp
parentFixed a typo. (diff)
parentLink cItem in the documentation (diff)
downloadcuberite-f72c747b5005df8bc53a9e38e52fc47ceae8515c.tar
cuberite-f72c747b5005df8bc53a9e38e52fc47ceae8515c.tar.gz
cuberite-f72c747b5005df8bc53a9e38e52fc47ceae8515c.tar.bz2
cuberite-f72c747b5005df8bc53a9e38e52fc47ceae8515c.tar.lz
cuberite-f72c747b5005df8bc53a9e38e52fc47ceae8515c.tar.xz
cuberite-f72c747b5005df8bc53a9e38e52fc47ceae8515c.tar.zst
cuberite-f72c747b5005df8bc53a9e38e52fc47ceae8515c.zip
Diffstat (limited to 'src/ChunkMap.cpp')
-rw-r--r--src/ChunkMap.cpp22
1 files changed, 20 insertions, 2 deletions
diff --git a/src/ChunkMap.cpp b/src/ChunkMap.cpp
index b5795fbaf..40964c654 100644
--- a/src/ChunkMap.cpp
+++ b/src/ChunkMap.cpp
@@ -2182,7 +2182,7 @@ bool cChunkMap::DoWithCommandBlockAt(int a_BlockX, int a_BlockY, int a_BlockZ, c
-bool cChunkMap::DoWithMobHeadBlockAt(int a_BlockX, int a_BlockY, int a_BlockZ, cMobHeadBlockCallback & a_Callback)
+bool cChunkMap::DoWithMobHeadAt(int a_BlockX, int a_BlockY, int a_BlockZ, cMobHeadCallback & a_Callback)
{
int ChunkX, ChunkZ;
int BlockX = a_BlockX, BlockY = a_BlockY, BlockZ = a_BlockZ;
@@ -2193,7 +2193,25 @@ bool cChunkMap::DoWithMobHeadBlockAt(int a_BlockX, int a_BlockY, int a_BlockZ, c
{
return false;
}
- return Chunk->DoWithMobHeadBlockAt(a_BlockX, a_BlockY, a_BlockZ, a_Callback);
+ return Chunk->DoWithMobHeadAt(a_BlockX, a_BlockY, a_BlockZ, a_Callback);
+}
+
+
+
+
+
+bool cChunkMap::DoWithFlowerPotAt(int a_BlockX, int a_BlockY, int a_BlockZ, cFlowerPotCallback & a_Callback)
+{
+ int ChunkX, ChunkZ;
+ int BlockX = a_BlockX, BlockY = a_BlockY, BlockZ = a_BlockZ;
+ cChunkDef::AbsoluteToRelative(BlockX, BlockY, BlockZ, ChunkX, ChunkZ);
+ cCSLock Lock(m_CSLayers);
+ cChunkPtr Chunk = GetChunkNoGen(ChunkX, ZERO_CHUNK_Y, ChunkZ);
+ if ((Chunk == NULL) && !Chunk->IsValid())
+ {
+ return false;
+ }
+ return Chunk->DoWithFlowerPotAt(a_BlockX, a_BlockY, a_BlockZ, a_Callback);
}