summaryrefslogtreecommitdiffstats
path: root/src/Generating/ChunkDesc.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/Generating/ChunkDesc.h')
-rw-r--r--src/Generating/ChunkDesc.h40
1 files changed, 20 insertions, 20 deletions
diff --git a/src/Generating/ChunkDesc.h b/src/Generating/ChunkDesc.h
index 1033242f8..aa689fcd6 100644
--- a/src/Generating/ChunkDesc.h
+++ b/src/Generating/ChunkDesc.h
@@ -35,28 +35,28 @@ public:
1 = solid
Indexed as [y + 256 * x + 256 * 16 * z]. */
typedef Byte Shape[256 * 16 * 16];
-
+
/** Uncompressed block metas, 1 meta per byte */
typedef NIBBLETYPE BlockNibbleBytes[cChunkDef::NumBlocks];
-
+
cChunkDesc(int a_ChunkX, int a_ChunkZ);
~cChunkDesc();
void SetChunkCoords(int a_ChunkX, int a_ChunkZ);
-
+
// tolua_begin
int GetChunkX(void) const { return m_ChunkX; }
int GetChunkZ(void) const { return m_ChunkZ; }
-
+
void FillBlocks(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);
-
+
void SetBlockMeta(int a_RelX, int a_RelY, int a_RelZ, NIBBLETYPE a_BlockMeta);
NIBBLETYPE GetBlockMeta(int a_RelX, int a_RelY, int a_RelZ);
@@ -100,7 +100,7 @@ public:
/** Returns the minimum height value in the heightmap. */
HEIGHTTYPE GetMinHeight(void) const;
-
+
/** Fills the relative cuboid with specified block; allows cuboid out of range of this chunk */
void FillRelCuboid(
int a_MinX, int a_MaxX,
@@ -108,7 +108,7 @@ public:
int a_MinZ, int a_MaxZ,
BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta
);
-
+
/** Fills the relative cuboid with specified block; allows cuboid out of range of this chunk */
void FillRelCuboid(const cCuboid & a_RelCuboid, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta)
{
@@ -119,7 +119,7 @@ public:
a_BlockType, a_BlockMeta
);
}
-
+
/** Replaces the specified src blocks in the cuboid by the dst blocks; allows cuboid out of range of this chunk */
void ReplaceRelCuboid(
int a_MinX, int a_MaxX,
@@ -128,7 +128,7 @@ public:
BLOCKTYPE a_SrcType, NIBBLETYPE a_SrcMeta,
BLOCKTYPE a_DstType, NIBBLETYPE a_DstMeta
);
-
+
/** Replaces the specified src blocks in the cuboid by the dst blocks; allows cuboid out of range of this chunk */
void ReplaceRelCuboid(
const cCuboid & a_RelCuboid,
@@ -152,7 +152,7 @@ public:
int a_MinZ, int a_MaxZ,
BLOCKTYPE a_DstType, NIBBLETYPE a_DstMeta
);
-
+
/** Replaces the blocks in the cuboid by the dst blocks if they are considered non-floor (air, water); allows cuboid out of range of this chunk */
void FloorRelCuboid(
const cCuboid & a_RelCuboid,
@@ -166,7 +166,7 @@ public:
a_DstType, a_DstMeta
);
}
-
+
/** Fills the relative cuboid with specified block with a random chance; allows cuboid out of range of this chunk */
void RandomFillRelCuboid(
int a_MinX, int a_MaxX,
@@ -175,7 +175,7 @@ public:
BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta,
int a_RandomSeed, int a_ChanceOutOf10k
);
-
+
/** Fills the relative cuboid with specified block with a random chance; allows cuboid out of range of this chunk */
void RandomFillRelCuboid(
const cCuboid & a_RelCuboid, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta,
@@ -190,18 +190,18 @@ public:
a_RandomSeed, a_ChanceOutOf10k
);
}
-
+
/** Returns the block entity at the specified coords.
If there is no block entity at those coords, tries to create one, based on the block type
If the blocktype doesn't support a block entity, returns nullptr. */
cBlockEntity * GetBlockEntity(int a_RelX, int a_RelY, int a_RelZ);
-
+
/** Updates the heightmap to match the current contents.
Useful for plugins when writing custom block areas into the chunk */
void UpdateHeightmap(void);
-
+
// tolua_end
-
+
// Accessors used by cChunkGenerator::Generator descendants:
inline cChunkDef::BiomeMap & GetBiomeMap (void) { return m_BiomeMap; }
inline cChunkDef::BlockTypes & GetBlockTypes (void) { return *(reinterpret_cast<cChunkDef::BlockTypes *>(m_BlockArea.GetBlockTypes())); }
@@ -211,19 +211,19 @@ public:
inline cChunkDef::HeightMap & GetHeightMap (void) { return m_HeightMap; }
inline cEntityList & GetEntities (void) { return m_Entities; }
inline cBlockEntityList & GetBlockEntities (void) { return m_BlockEntities; }
-
+
/** Compresses the metas from the BlockArea format (1 meta per byte) into regular format (2 metas per byte) */
void CompressBlockMetas(cChunkDef::BlockNibbles & a_DestMetas);
-
+
#ifdef _DEBUG
/** Verifies that the heightmap corresponds to blocktype contents; if not, asserts on that column */
void VerifyHeightmap(void);
#endif // _DEBUG
-
+
private:
int m_ChunkX;
int m_ChunkZ;
-
+
cChunkDef::BiomeMap m_BiomeMap;
cBlockArea m_BlockArea;
cChunkDef::HeightMap m_HeightMap;