summaryrefslogtreecommitdiffstats
path: root/src/ChunkMap.cpp
diff options
context:
space:
mode:
authorBond-009 <bond.009@outlook.com>2020-03-27 13:03:28 +0100
committerGitHub <noreply@github.com>2020-03-27 13:03:28 +0100
commitea386eaab12206e585e01720808dc37585569535 (patch)
tree7f26c0241b45cd2551b5d2ab5fc28d920130b0b7 /src/ChunkMap.cpp
parentMerge #4552 (diff)
downloadcuberite-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 'src/ChunkMap.cpp')
-rw-r--r--src/ChunkMap.cpp18
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;