summaryrefslogtreecommitdiffstats
path: root/source/Generating/ChunkDesc.h
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/Generating/ChunkDesc.h
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/Generating/ChunkDesc.h21
1 files changed, 19 insertions, 2 deletions
diff --git a/source/Generating/ChunkDesc.h b/source/Generating/ChunkDesc.h
index e8d4aa17a..afe3df331 100644
--- a/source/Generating/ChunkDesc.h
+++ b/source/Generating/ChunkDesc.h
@@ -15,19 +15,27 @@
+// fwd: ../BlockArea.h
+class cBlockArea;
+
+
+
+
+
// tolua_begin
class cChunkDesc
{
public:
// tolua_end
- cChunkDesc(void);
+ cChunkDesc(int a_ChunkX, int a_ChunkZ);
~cChunkDesc();
// tolua_begin
void FillBlocks(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta);
- void SetBlock(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta);
+ void SetBlockTypeMeta(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta);
+ void GetBlockTypeMeta(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE & a_BlockType, NIBBLETYPE & a_BlockMeta);
void SetBlockType(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_BlockType);
BLOCKTYPE GetBlockType(int a_RelX, int a_RelY, int a_RelZ);
@@ -53,6 +61,12 @@ public:
void SetUseDefaultFinish(bool a_bUseDefaultFinish);
bool IsUsingDefaultFinish(void) const;
+ /// Writes the block area into the chunk, with its origin set at the specified relative coords. Area's data overwrite everything in the chunk.
+ void WriteBlockArea(const cBlockArea & a_BlockArea, int a_RelX, int a_RelY, int a_RelZ);
+
+ /// Reads an area from the chunk into a cBlockArea
+ void ReadBlockArea(cBlockArea & a_Dest, int a_MinRelX, int a_MaxRelX, int a_MinRelY, int a_MaxRelY, int a_MinRelZ, int a_MaxRelZ);
+
// tolua_end
@@ -65,6 +79,9 @@ public:
cBlockEntityList & GetBlockEntities(void) { return m_BlockEntities; }
private:
+ int m_ChunkX;
+ int m_ChunkZ;
+
cChunkDef::BiomeMap m_BiomeMap;
cChunkDef::BlockTypes m_BlockTypes;
cChunkDef::BlockNibbles m_BlockMeta;