diff options
author | andrew <xdotftw@gmail.com> | 2014-01-18 14:16:47 +0100 |
---|---|---|
committer | andrew <xdotftw@gmail.com> | 2014-01-18 14:16:47 +0100 |
commit | 9a9b51a5134d8afd8f089d247c59668bd7da695d (patch) | |
tree | 74be5c51628307a8ddf8ce39a0236dfb511c7941 /src/ChunkMap.cpp | |
parent | Merge pull request #552 from worktycho/c++11 (diff) | |
download | cuberite-9a9b51a5134d8afd8f089d247c59668bd7da695d.tar cuberite-9a9b51a5134d8afd8f089d247c59668bd7da695d.tar.gz cuberite-9a9b51a5134d8afd8f089d247c59668bd7da695d.tar.bz2 cuberite-9a9b51a5134d8afd8f089d247c59668bd7da695d.tar.lz cuberite-9a9b51a5134d8afd8f089d247c59668bd7da695d.tar.xz cuberite-9a9b51a5134d8afd8f089d247c59668bd7da695d.tar.zst cuberite-9a9b51a5134d8afd8f089d247c59668bd7da695d.zip |
Diffstat (limited to 'src/ChunkMap.cpp')
-rw-r--r-- | src/ChunkMap.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/ChunkMap.cpp b/src/ChunkMap.cpp index e14090b18..5797eb453 100644 --- a/src/ChunkMap.cpp +++ b/src/ChunkMap.cpp @@ -1968,6 +1968,23 @@ bool cChunkMap::DoWithNoteBlockAt(int a_BlockX, int a_BlockY, int a_BlockZ, cNot +bool cChunkMap::DoWithCommandBlockAt(int a_BlockX, int a_BlockY, int a_BlockZ, cCommandBlockCallback & 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->DoWithCommandBlockAt(a_BlockX, a_BlockY, a_BlockZ, a_Callback); +} + + + + bool cChunkMap::GetSignLines(int a_BlockX, int a_BlockY, int a_BlockZ, AString & a_Line1, AString & a_Line2, AString & a_Line3, AString & a_Line4) { |