summaryrefslogtreecommitdiffstats
path: root/source/Chunk.cpp
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2013-10-27 09:19:13 +0100
committermadmaxoft <github@xoft.cz>2013-10-27 09:19:13 +0100
commit3fa03e854f02f8046ace97d184647c0594e3f23c (patch)
treed443281dea155650869a0b626e93d1164b5d2000 /source/Chunk.cpp
parentAuthenticator doesn't save the ini file. (diff)
downloadcuberite-3fa03e854f02f8046ace97d184647c0594e3f23c.tar
cuberite-3fa03e854f02f8046ace97d184647c0594e3f23c.tar.gz
cuberite-3fa03e854f02f8046ace97d184647c0594e3f23c.tar.bz2
cuberite-3fa03e854f02f8046ace97d184647c0594e3f23c.tar.lz
cuberite-3fa03e854f02f8046ace97d184647c0594e3f23c.tar.xz
cuberite-3fa03e854f02f8046ace97d184647c0594e3f23c.tar.zst
cuberite-3fa03e854f02f8046ace97d184647c0594e3f23c.zip
Diffstat (limited to 'source/Chunk.cpp')
-rw-r--r--source/Chunk.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/source/Chunk.cpp b/source/Chunk.cpp
index c7bac879a..c9d457af3 100644
--- a/source/Chunk.cpp
+++ b/source/Chunk.cpp
@@ -1155,6 +1155,29 @@ bool cChunk::UnboundedRelGetBlockSkyLight(int a_RelX, int a_RelY, int a_RelZ, NI
+bool cChunk::UnboundedRelGetBlockLights(int a_RelX, int a_RelY, int a_RelZ, NIBBLETYPE & a_BlockLight, NIBBLETYPE & a_SkyLight) const
+{
+ if ((a_RelY < 0) || (a_RelY >= cChunkDef::Height))
+ {
+ LOGWARNING("%s: requesting a block with a_RelY out of range: %d", __FUNCTION__, a_RelY);
+ return false;
+ }
+ cChunk * Chunk = GetRelNeighborChunkAdjustCoords(a_RelX, a_RelZ);
+ if ((Chunk == NULL) || !Chunk->IsValid())
+ {
+ // The chunk is not available, bail out
+ return false;
+ }
+ int idx = Chunk->MakeIndex(a_RelX, a_RelY, a_RelZ);
+ a_BlockLight = Chunk->GetBlockLight(idx);
+ a_SkyLight = Chunk->GetSkyLight(idx);
+ return true;
+}
+
+
+
+
+
bool cChunk::UnboundedRelSetBlock(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta)
{
if ((a_RelY < 0) || (a_RelY > cChunkDef::Height))