diff options
author | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2013-05-26 16:39:04 +0200 |
---|---|---|
committer | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2013-05-26 16:39:04 +0200 |
commit | 5c3235ecdc3f718ce20e006f1ecfa2159df82c87 (patch) | |
tree | aea2e4a722715498c59b0a828486b30b74506bb5 /source/ChunkMap.cpp | |
parent | ItemGrid: Added the RemoveOneItem() function (diff) | |
download | cuberite-5c3235ecdc3f718ce20e006f1ecfa2159df82c87.tar cuberite-5c3235ecdc3f718ce20e006f1ecfa2159df82c87.tar.gz cuberite-5c3235ecdc3f718ce20e006f1ecfa2159df82c87.tar.bz2 cuberite-5c3235ecdc3f718ce20e006f1ecfa2159df82c87.tar.lz cuberite-5c3235ecdc3f718ce20e006f1ecfa2159df82c87.tar.xz cuberite-5c3235ecdc3f718ce20e006f1ecfa2159df82c87.tar.zst cuberite-5c3235ecdc3f718ce20e006f1ecfa2159df82c87.zip |
Diffstat (limited to '')
-rw-r--r-- | source/ChunkMap.cpp | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/source/ChunkMap.cpp b/source/ChunkMap.cpp index 6db737451..438d23c9c 100644 --- a/source/ChunkMap.cpp +++ b/source/ChunkMap.cpp @@ -1528,6 +1528,36 @@ bool cChunkMap::ForEachDispenserInChunk(int a_ChunkX, int a_ChunkZ, cDispenserCa +bool cChunkMap::ForEachDropperInChunk(int a_ChunkX, int a_ChunkZ, cDropperCallback & a_Callback) +{ + cCSLock Lock(m_CSLayers); + cChunkPtr Chunk = GetChunkNoGen(a_ChunkX, ZERO_CHUNK_Y, a_ChunkZ); + if ((Chunk == NULL) && !Chunk->IsValid()) + { + return false; + } + return Chunk->ForEachDropper(a_Callback); +} + + + + + +bool cChunkMap::ForEachDropSpenserInChunk(int a_ChunkX, int a_ChunkZ, cDropSpenserCallback & a_Callback) +{ + cCSLock Lock(m_CSLayers); + cChunkPtr Chunk = GetChunkNoGen(a_ChunkX, ZERO_CHUNK_Y, a_ChunkZ); + if ((Chunk == NULL) && !Chunk->IsValid()) + { + return false; + } + return Chunk->ForEachDropSpenser(a_Callback); +} + + + + + bool cChunkMap::ForEachFurnaceInChunk(int a_ChunkX, int a_ChunkZ, cFurnaceCallback & a_Callback) { cCSLock Lock(m_CSLayers); @@ -1579,6 +1609,42 @@ bool cChunkMap::DoWithDispenserAt(int a_BlockX, int a_BlockY, int a_BlockZ, cDis +bool cChunkMap::DoWithDropperAt(int a_BlockX, int a_BlockY, int a_BlockZ, cDropperCallback & 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->DoWithDropperAt(a_BlockX, a_BlockY, a_BlockZ, a_Callback); +} + + + + + +bool cChunkMap::DoWithDropSpenserAt(int a_BlockX, int a_BlockY, int a_BlockZ, cDropSpenserCallback & 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->DoWithDropSpenserAt(a_BlockX, a_BlockY, a_BlockZ, a_Callback); +} + + + + + bool cChunkMap::DoWithFurnaceAt(int a_BlockX, int a_BlockY, int a_BlockZ, cFurnaceCallback & a_Callback) { int ChunkX, ChunkZ; |