diff options
author | Bond-009 <bond.009@outlook.com> | 2020-03-27 13:03:28 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-27 13:03:28 +0100 |
commit | ea386eaab12206e585e01720808dc37585569535 (patch) | |
tree | 7f26c0241b45cd2551b5d2ab5fc28d920130b0b7 /src/ChunkMap.cpp | |
parent | Merge #4552 (diff) | |
download | cuberite-ea386eaab12206e585e01720808dc37585569535.tar cuberite-ea386eaab12206e585e01720808dc37585569535.tar.gz cuberite-ea386eaab12206e585e01720808dc37585569535.tar.bz2 cuberite-ea386eaab12206e585e01720808dc37585569535.tar.lz cuberite-ea386eaab12206e585e01720808dc37585569535.tar.xz cuberite-ea386eaab12206e585e01720808dc37585569535.tar.zst cuberite-ea386eaab12206e585e01720808dc37585569535.zip |
Diffstat (limited to '')
-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 9c721610e..f2c0cf59f 100644 --- a/src/ChunkMap.cpp +++ b/src/ChunkMap.cpp @@ -1629,6 +1629,24 @@ bool cChunkMap::DoWithFurnaceAt(int a_BlockX, int a_BlockY, int a_BlockZ, cFurna +bool cChunkMap::DoWithHopperAt(int a_BlockX, int a_BlockY, int a_BlockZ, cHopperCallback 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_CSChunks); + cChunkPtr Chunk = GetChunkNoGen(ChunkX, ChunkZ); + if ((Chunk == nullptr) || !Chunk->IsValid()) + { + return false; + } + return Chunk->DoWithHopperAt(a_BlockX, a_BlockY, a_BlockZ, a_Callback); +} + + + + + bool cChunkMap::DoWithNoteBlockAt(int a_BlockX, int a_BlockY, int a_BlockZ, cNoteBlockCallback a_Callback) { int ChunkX, ChunkZ; |