diff options
author | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-02-18 20:18:16 +0100 |
---|---|---|
committer | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-02-18 20:18:16 +0100 |
commit | 76a92a21d11265ad17dffd11101ea87ce5c60e6a (patch) | |
tree | 9e6890042c4157ce1ee85d6e0e0a01a3b8e73efc /source/cChunk.h | |
parent | Thread-safe chunk generation, storage and generator are queried for progress while initializing server (diff) | |
download | cuberite-76a92a21d11265ad17dffd11101ea87ce5c60e6a.tar cuberite-76a92a21d11265ad17dffd11101ea87ce5c60e6a.tar.gz cuberite-76a92a21d11265ad17dffd11101ea87ce5c60e6a.tar.bz2 cuberite-76a92a21d11265ad17dffd11101ea87ce5c60e6a.tar.lz cuberite-76a92a21d11265ad17dffd11101ea87ce5c60e6a.tar.xz cuberite-76a92a21d11265ad17dffd11101ea87ce5c60e6a.tar.zst cuberite-76a92a21d11265ad17dffd11101ea87ce5c60e6a.zip |
Diffstat (limited to '')
-rw-r--r-- | source/cChunk.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/source/cChunk.h b/source/cChunk.h index 60e11b133..2576e2412 100644 --- a/source/cChunk.h +++ b/source/cChunk.h @@ -73,6 +73,9 @@ public: class cChunk
{
public:
+ static const int c_NumBlocks = 16 * 128 * 16;
+ static const int c_BlockDataSize = c_NumBlocks * 2 + (c_NumBlocks/2); // 2.5 * numblocks
+
cChunk(int a_X, int a_Y, int a_Z, cWorld* a_World);
~cChunk();
@@ -98,6 +101,9 @@ public: /// Sets all chunk data
void SetAllData(const char * a_BlockData, cEntityList & a_Entities, cBlockEntityList & a_BlockEntities);
+ /// Copies m_BlockData into a_Blocks, only the block types
+ void GetBlocks(char a_Blocks[cChunk::c_NumBlocks]);
+
/// Returns true if there is a block entity at the coords specified
bool HasBlockEntityAt(int a_BlockX, int a_BlockY, int a_BlockZ);
@@ -183,9 +189,6 @@ public: m_IsSaving = false;
}
- static const int c_NumBlocks = 16*128*16;
- static const int c_BlockDataSize = c_NumBlocks * 2 + (c_NumBlocks/2); // 2.5 * numblocks
-
private:
bool m_IsValid; // True if the chunk is loaded / generated
|