diff options
author | Lukas Pioch <lukas@zgow.de> | 2017-07-07 09:31:45 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-07 09:31:45 +0200 |
commit | 885d8287125439047ca2318f8e349b8da279e612 (patch) | |
tree | 2f54b688dba0f49b64544d3c1220a16a6936cd6f /src/ChunkMap.cpp | |
parent | Changed Lua plugins to only execute files ending in .lua (#3831) (diff) | |
download | cuberite-885d8287125439047ca2318f8e349b8da279e612.tar cuberite-885d8287125439047ca2318f8e349b8da279e612.tar.gz cuberite-885d8287125439047ca2318f8e349b8da279e612.tar.bz2 cuberite-885d8287125439047ca2318f8e349b8da279e612.tar.lz cuberite-885d8287125439047ca2318f8e349b8da279e612.tar.xz cuberite-885d8287125439047ca2318f8e349b8da279e612.tar.zst cuberite-885d8287125439047ca2318f8e349b8da279e612.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 019746b9d..f04af4340 100644 --- a/src/ChunkMap.cpp +++ b/src/ChunkMap.cpp @@ -2042,6 +2042,24 @@ bool cChunkMap::DoWithBeaconAt(int a_BlockX, int a_BlockY, int a_BlockZ, cBeacon +bool cChunkMap::DoWithBedAt(int a_BlockX, int a_BlockY, int a_BlockZ, cBedCallback & 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->DoWithBedAt(a_BlockX, a_BlockY, a_BlockZ, a_Callback); +} + + + + + bool cChunkMap::DoWithBrewingstandAt(int a_BlockX, int a_BlockY, int a_BlockZ, cBrewingstandCallback & a_Callback) { int ChunkX, ChunkZ; |