summaryrefslogtreecommitdiffstats
path: root/source/BlockArea.cpp
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-02-08 21:57:42 +0100
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-02-08 21:57:42 +0100
commitb55afc940b4a95ac0191cc24a40c5c3824ab2f0f (patch)
tree83fe5517c9685d43986b87a28a4dfdcb141d381d /source/BlockArea.cpp
parentPrepared cChunkDesc for further API extension; used it as the sole container for generated chunk data, including entities / block entities. (diff)
downloadcuberite-b55afc940b4a95ac0191cc24a40c5c3824ab2f0f.tar
cuberite-b55afc940b4a95ac0191cc24a40c5c3824ab2f0f.tar.gz
cuberite-b55afc940b4a95ac0191cc24a40c5c3824ab2f0f.tar.bz2
cuberite-b55afc940b4a95ac0191cc24a40c5c3824ab2f0f.tar.lz
cuberite-b55afc940b4a95ac0191cc24a40c5c3824ab2f0f.tar.xz
cuberite-b55afc940b4a95ac0191cc24a40c5c3824ab2f0f.tar.zst
cuberite-b55afc940b4a95ac0191cc24a40c5c3824ab2f0f.zip
Diffstat (limited to '')
-rw-r--r--source/BlockArea.cpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/source/BlockArea.cpp b/source/BlockArea.cpp
index 11878edeb..a5cefb430 100644
--- a/source/BlockArea.cpp
+++ b/source/BlockArea.cpp
@@ -511,6 +511,40 @@ NIBBLETYPE cBlockArea::GetBlockSkyLight(int a_BlockX, int a_BlockY, int a_BlockZ
+void cBlockArea::SetBlockTypeMeta(int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta)
+{
+ SetRelBlockTypeMeta(a_BlockX - m_OriginX, a_BlockY - m_OriginY, a_BlockZ - m_OriginZ, a_BlockType, a_BlockMeta);
+}
+
+
+
+
+
+void cBlockArea::SetRelBlockTypeMeta(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta)
+{
+ int idx = MakeIndex(a_RelX, a_RelY, a_RelZ);
+ if (m_BlockTypes == NULL)
+ {
+ LOGWARNING("%s: BlockTypes not available but requested to be written to.", __FUNCTION__);
+ }
+ else
+ {
+ m_BlockTypes[idx] = a_BlockType;
+ }
+ if (m_BlockMetas == NULL)
+ {
+ LOGWARNING("%s: BlockMetas not available but requested to be written to.", __FUNCTION__);
+ }
+ else
+ {
+ m_BlockMetas[idx] = a_BlockMeta;
+ }
+}
+
+
+
+
+
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);