summaryrefslogtreecommitdiffstats
path: root/source/cChunk.cpp
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-06-16 10:35:07 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-06-16 10:35:07 +0200
commitada984facf47465b7a081eaf75d5541110c12f60 (patch)
treeebf09e32018e76a20df35e49965e15f8235cd6e2 /source/cChunk.cpp
parentLua binding for cVine fixed (diff)
downloadcuberite-ada984facf47465b7a081eaf75d5541110c12f60.tar
cuberite-ada984facf47465b7a081eaf75d5541110c12f60.tar.gz
cuberite-ada984facf47465b7a081eaf75d5541110c12f60.tar.bz2
cuberite-ada984facf47465b7a081eaf75d5541110c12f60.tar.lz
cuberite-ada984facf47465b7a081eaf75d5541110c12f60.tar.xz
cuberite-ada984facf47465b7a081eaf75d5541110c12f60.tar.zst
cuberite-ada984facf47465b7a081eaf75d5541110c12f60.zip
Diffstat (limited to '')
-rw-r--r--source/cChunk.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/source/cChunk.cpp b/source/cChunk.cpp
index 98415b572..02d60b6bd 100644
--- a/source/cChunk.cpp
+++ b/source/cChunk.cpp
@@ -1473,6 +1473,23 @@ void cChunk::RemoveEntity(cEntity * a_Entity)
+bool cChunk::ForEachEntity(cEntityCallback & a_Callback)
+{
+ // The entity list is locked by the parent chunkmap's CS
+ for (cEntityList::iterator itr = m_Entities.begin(); itr != m_Entities.end(); ++itr)
+ {
+ if (a_Callback.Item(*itr))
+ {
+ return false;
+ }
+ } // for itr - m_Entitites[]
+ return true;
+}
+
+
+
+
+
BLOCKTYPE cChunk::GetBlock( int a_X, int a_Y, int a_Z )
{
if ((a_X < 0) || (a_X >= Width) || (a_Y < 0) || (a_Y >= Height) || (a_Z < 0) || (a_Z >= Width)) return 0; // Clip