summaryrefslogtreecommitdiffstats
path: root/src/ChunkDef.h
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2014-04-07 00:30:21 +0200
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2014-04-07 00:30:21 +0200
commita42d1f851748c0cca542d1b0038318d0cbff9fd3 (patch)
treecf4d9e94da638e85e4fb37c3f9a428612228a4fb /src/ChunkDef.h
parentNibbletypes are compressed (diff)
downloadcuberite-a42d1f851748c0cca542d1b0038318d0cbff9fd3.tar
cuberite-a42d1f851748c0cca542d1b0038318d0cbff9fd3.tar.gz
cuberite-a42d1f851748c0cca542d1b0038318d0cbff9fd3.tar.bz2
cuberite-a42d1f851748c0cca542d1b0038318d0cbff9fd3.tar.lz
cuberite-a42d1f851748c0cca542d1b0038318d0cbff9fd3.tar.xz
cuberite-a42d1f851748c0cca542d1b0038318d0cbff9fd3.tar.zst
cuberite-a42d1f851748c0cca542d1b0038318d0cbff9fd3.zip
Diffstat (limited to 'src/ChunkDef.h')
-rw-r--r--src/ChunkDef.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/ChunkDef.h b/src/ChunkDef.h
index 3793bd95a..d744d24b2 100644
--- a/src/ChunkDef.h
+++ b/src/ChunkDef.h
@@ -232,13 +232,13 @@ public:
}
- static NIBBLETYPE GetNibble(const std::vector<NIBBLETYPE> & a_Buffer, int a_BlockIdx)
+ static NIBBLETYPE GetNibble(const std::vector<NIBBLETYPE> & a_Buffer, int a_BlockIdx, bool a_IsSkyLightNibble = false)
{
if ((a_BlockIdx > -1) && (a_BlockIdx < NumBlocks))
{
if (a_Buffer.empty() || (a_BlockIdx / 2 > a_Buffer.size() - 1))
{
- return 0;
+ return (a_IsSkyLightNibble ? 0xff : 0);
}
return (a_Buffer[a_BlockIdx / 2] >> ((a_BlockIdx & 1) * 4)) & 0x0f;
}
@@ -259,14 +259,14 @@ public:
}
- static NIBBLETYPE GetNibble(const std::vector<NIBBLETYPE> & a_Buffer, int x, int y, int z)
+ static NIBBLETYPE GetNibble(const std::vector<NIBBLETYPE> & a_Buffer, int x, int y, int z, bool a_IsSkyLightNibble = false)
{
if ((x < Width) && (x > -1) && (y < Height) && (y > -1) && (z < Width) && (z > -1))
{
int Index = MakeIndexNoCheck(x, y, z);
if (a_Buffer.empty() || (Index / 2 > a_Buffer.size() - 1))
{
- return 0;
+ return (a_IsSkyLightNibble ? 0xff : 0);
}
return (a_Buffer[Index / 2] >> ((Index & 1) * 4)) & 0x0f;
}