diff options
author | Howaner <franzi.moos@googlemail.com> | 2014-07-30 22:19:51 +0200 |
---|---|---|
committer | Howaner <franzi.moos@googlemail.com> | 2014-07-30 22:19:51 +0200 |
commit | 81e095adda62e4067ab4c07b0e4c7ce0f3dbce39 (patch) | |
tree | 09687befe7c3a3e9b6eb6abf97455743c254d0c0 /src/ChunkMap.cpp | |
parent | Added beacon. (diff) | |
download | cuberite-81e095adda62e4067ab4c07b0e4c7ce0f3dbce39.tar cuberite-81e095adda62e4067ab4c07b0e4c7ce0f3dbce39.tar.gz cuberite-81e095adda62e4067ab4c07b0e4c7ce0f3dbce39.tar.bz2 cuberite-81e095adda62e4067ab4c07b0e4c7ce0f3dbce39.tar.lz cuberite-81e095adda62e4067ab4c07b0e4c7ce0f3dbce39.tar.xz cuberite-81e095adda62e4067ab4c07b0e4c7ce0f3dbce39.tar.zst cuberite-81e095adda62e4067ab4c07b0e4c7ce0f3dbce39.zip |
Diffstat (limited to 'src/ChunkMap.cpp')
-rw-r--r-- | src/ChunkMap.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/ChunkMap.cpp b/src/ChunkMap.cpp index 38e0cd82d..dd8be0631 100644 --- a/src/ChunkMap.cpp +++ b/src/ChunkMap.cpp @@ -2116,6 +2116,24 @@ bool cChunkMap::DoWithBlockEntityAt(int a_BlockX, int a_BlockY, int a_BlockZ, cB +bool cChunkMap::DoWithBeaconAt(int a_BlockX, int a_BlockY, int a_BlockZ, cBeaconCallback & 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->DoWithBeaconAt(a_BlockX, a_BlockY, a_BlockZ, a_Callback); +} + + + + + bool cChunkMap::DoWithChestAt(int a_BlockX, int a_BlockY, int a_BlockZ, cChestCallback & a_Callback) { int ChunkX, ChunkZ; |