summaryrefslogtreecommitdiffstats
path: root/source/BlockArea.cpp
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-01-04 06:20:14 +0100
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-01-04 06:20:14 +0100
commit7860d5156a2801f3f6ed526bec1f2e267b29fcc8 (patch)
treeada5c2f7c86fb1aeacc5f5e776387daa5a8c5a96 /source/BlockArea.cpp
parentFixed compilation error in BlockCauldron.h on Linux (diff)
downloadcuberite-7860d5156a2801f3f6ed526bec1f2e267b29fcc8.tar
cuberite-7860d5156a2801f3f6ed526bec1f2e267b29fcc8.tar.gz
cuberite-7860d5156a2801f3f6ed526bec1f2e267b29fcc8.tar.bz2
cuberite-7860d5156a2801f3f6ed526bec1f2e267b29fcc8.tar.lz
cuberite-7860d5156a2801f3f6ed526bec1f2e267b29fcc8.tar.xz
cuberite-7860d5156a2801f3f6ed526bec1f2e267b29fcc8.tar.zst
cuberite-7860d5156a2801f3f6ed526bec1f2e267b29fcc8.zip
Diffstat (limited to 'source/BlockArea.cpp')
-rw-r--r--source/BlockArea.cpp37
1 files changed, 37 insertions, 0 deletions
diff --git a/source/BlockArea.cpp b/source/BlockArea.cpp
index 0ed6a15c2..9253b4788 100644
--- a/source/BlockArea.cpp
+++ b/source/BlockArea.cpp
@@ -342,6 +342,43 @@ NIBBLETYPE cBlockArea::GetBlockSkyLight(int a_BlockX, int a_BlockY, int a_BlockZ
+void cBlockArea::GetBlockTypeMeta(int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE & a_BlockType, NIBBLETYPE & a_BlockMeta) const
+{
+ return GetRelBlockTypeMeta(a_BlockX - m_OriginX, a_BlockY - m_OriginY, a_BlockZ - m_OriginZ, a_BlockType, a_BlockMeta);
+}
+
+
+
+
+
+void cBlockArea::GetRelBlockTypeMeta(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE & a_BlockType, NIBBLETYPE & a_BlockMeta) const
+{
+ int idx = MakeIndex(a_RelX, a_RelY, a_RelZ);
+ if (m_BlockTypes == NULL)
+ {
+ LOGWARNING("cBlockArea: BlockTypes have not been read!");
+ a_BlockType = E_BLOCK_AIR;
+ }
+ else
+ {
+ a_BlockType = m_BlockTypes[idx];
+ }
+
+ if (m_BlockMetas == NULL)
+ {
+ LOGWARNING("cBlockArea: BlockMetas have not been read!");
+ a_BlockMeta = 0;
+ }
+ else
+ {
+ a_BlockMeta = m_BlockMetas[idx];
+ }
+}
+
+
+
+
+
int cBlockArea::GetDataTypes(void) const
{
int res = 0;