12 #include "../BlockArea.h" 13 #include "../Cuboid.h" 106 void ReadBlockArea(
cBlockArea & a_Dest,
int a_MinRelX,
int a_MaxRelX,
int a_MinRelY,
int a_MaxRelY,
int a_MinRelZ,
int a_MaxRelZ);
116 int a_MinX,
int a_MaxX,
117 int a_MinY,
int a_MaxY,
118 int a_MinZ,
int a_MaxZ,
126 a_RelCuboid.
p1.
x, a_RelCuboid.
p2.
x,
127 a_RelCuboid.
p1.
y, a_RelCuboid.
p2.
y,
128 a_RelCuboid.
p1.
z, a_RelCuboid.
p2.
z,
129 a_BlockType, a_BlockMeta
135 int a_MinX,
int a_MaxX,
136 int a_MinY,
int a_MaxY,
137 int a_MinZ,
int a_MaxZ,
150 a_RelCuboid.
p1.
x, a_RelCuboid.
p2.
x,
151 a_RelCuboid.
p1.
y, a_RelCuboid.
p2.
y,
152 a_RelCuboid.
p1.
z, a_RelCuboid.
p2.
z,
153 a_SrcType, a_SrcMeta,
160 int a_MinX,
int a_MaxX,
161 int a_MinY,
int a_MaxY,
162 int a_MinZ,
int a_MaxZ,
173 a_RelCuboid.
p1.
x, a_RelCuboid.
p2.
x,
174 a_RelCuboid.
p1.
y, a_RelCuboid.
p2.
y,
175 a_RelCuboid.
p1.
z, a_RelCuboid.
p2.
z,
182 int a_MinX,
int a_MaxX,
183 int a_MinY,
int a_MaxY,
184 int a_MinZ,
int a_MaxZ,
186 int a_RandomSeed,
int a_ChanceOutOf10k
192 int a_RandomSeed,
int a_ChanceOutOf10k
196 a_RelCuboid.
p1.
x, a_RelCuboid.
p2.
x,
197 a_RelCuboid.
p1.
y, a_RelCuboid.
p2.
y,
198 a_RelCuboid.
p1.
z, a_RelCuboid.
p2.
z,
199 a_BlockType, a_BlockMeta,
200 a_RandomSeed, a_ChanceOutOf10k
234 void VerifyHeightmap(
void);
HEIGHTTYPE GetMaxHeight(void) const
Returns the maximum height value in the heightmap.
BlockNibbleBytes & GetBlockMetasUncompressed(void)
std::map< size_t, cBlockEntity * > cBlockEntities
NIBBLETYPE BlockNibbleBytes[cChunkDef::NumBlocks]
Uncompressed block metas, 1 meta per byte.
Byte Shape[256 *16 *16]
The datatype used to represent the entire chunk worth of shape.
void SetBlockType(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_BlockType)
void FillRelCuboid(int a_MinX, int a_MaxX, int a_MinY, int a_MaxY, 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...
NIBBLETYPE GetBlockMeta(int a_RelX, int a_RelY, int a_RelZ) const
cChunkDesc(cChunkCoords a_Coords)
bool m_bUseDefaultComposition
cChunkDef::BlockTypes & GetBlockTypes(void)
BLOCKTYPE BlockTypes[NumBlocks]
The type used for block type operations and storage, AXIS_ORDER ordering.
void SetUseDefaultHeight(bool a_bUseDefaultHeight)
unsigned char BLOCKTYPE
The datatype used by blockdata.
void GetShapeFromHeight(Shape &a_Shape) const
Sets the shape in a_Shape to match the heightmap stored currently in m_HeightMap. ...
eMergeStrategy
The per-block strategy to use when merging another block area into this object.
bool IsUsingDefaultBiomes(void) const
static const int NumBlocks
void ReplaceRelCuboid(const cCuboid &a_RelCuboid, 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...
void GetBlockTypeMeta(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE &a_BlockType, NIBBLETYPE &a_BlockMeta) const
Returns the BlockType and BlockMeta at the specified coords.
cChunkDef::HeightMap m_HeightMap
EMCSBiome GetBiome(int a_RelX, int a_RelZ) const
void SetUseDefaultFinish(bool a_bUseDefaultFinish)
unsigned char NIBBLETYPE
The datatype used by nibbledata (meta, light, skylight)
bool IsUsingDefaultComposition(void) const
const cChunkDef::BiomeMap & GetBiomeMap() const
EMCSBiome
Biome IDs The first batch corresponds to the clientside biomes, used by MineCraft.
void SetBlockMeta(int a_RelX, int a_RelY, int a_RelZ, NIBBLETYPE a_BlockMeta)
cChunkDef::BiomeMap m_BiomeMap
unsigned char HEIGHTTYPE
The type used by the heightmap.
void WriteBlockArea(const cBlockArea &a_BlockArea, int a_RelX, int a_RelY, int a_RelZ, cBlockArea::eMergeStrategy a_MergeStrategy=cBlockArea::msOverwrite)
Writes the block area into the chunk, with its origin set at the specified relative coords...
void UpdateHeightmap(void)
Updates the heightmap to match the current contents.
bool IsUsingDefaultFinish(void) const
void SetHeight(int a_RelX, int a_RelZ, HEIGHTTYPE a_Height)
BLOCKTYPE GetBlockType(int a_RelX, int a_RelY, int a_RelZ) const
cChunkCoords GetChunkCoords() const
void ReadBlockArea(cBlockArea &a_Dest, int a_MinRelX, int a_MaxRelX, int a_MinRelY, int a_MaxRelY, int a_MinRelZ, int a_MaxRelZ)
Reads an area from the chunk into a cBlockArea, blocktypes and blockmetas.
void CompressBlockMetas(cChunkDef::BlockNibbles &a_DestMetas)
Compresses the metas from the BlockArea format (1 meta per byte) into regular format (2 metas per byt...
cChunkDef::HeightMap & GetHeightMap(void)
const cChunkDef::HeightMap & GetHeightMap() const
cBlockEntities m_BlockEntities
std::vector< OwnedEntity > cEntityList
const cChunkDef::BlockTypes & GetBlockTypes() const
void SetUseDefaultComposition(bool a_bUseDefaultComposition)
void RandomFillRelCuboid(const cCuboid &a_RelCuboid, 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 th...
void FloorRelCuboid(int a_MinX, int a_MaxX, int a_MinY, int a_MaxY, 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...
cBlockEntity * GetBlockEntity(int a_RelX, int a_RelY, int a_RelZ)
Returns the block entity at the specified coords.
cEntityList & GetEntities(void)
HEIGHTTYPE GetHeight(int a_RelX, int a_RelZ) const
HEIGHTTYPE GetMinHeight(void) const
Returns the minimum height value in the heightmap.
void RandomFillRelCuboid(int a_MinX, int a_MaxX, int a_MinY, int a_MaxY, int a_MinZ, int a_MaxZ, 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 th...
bool IsUsingDefaultHeight(void) const
void FillRelCuboid(const cCuboid &a_RelCuboid, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta)
Fills the relative cuboid with specified block; allows cuboid out of range of this chunk...
void FloorRelCuboid(const cCuboid &a_RelCuboid, BLOCKTYPE a_DstType, NIBBLETYPE a_DstMeta)
Replaces the blocks in the cuboid by the dst blocks if they are considered non-floor (air...
void ReplaceRelCuboid(int a_MinX, int a_MaxX, int a_MinY, int a_MaxY, int a_MinZ, int a_MaxZ, 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...
void SetChunkCoords(cChunkCoords a_Coords)
BLOCKTYPE * GetBlockTypes(void) const
Returns the internal pointer to the block types.
NIBBLETYPE BlockNibbles[NumBlocks/2]
The type used for block data in nibble format, AXIS_ORDER ordering.
void SetBiome(int a_RelX, int a_RelZ, EMCSBiome a_BiomeID)
NIBBLETYPE * GetBlockMetas(void) const
void FillBlocks(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta)
cBlockEntities & GetBlockEntities(void)
void SetUseDefaultBiomes(bool a_bUseDefaultBiomes)
HEIGHTTYPE HeightMap[Width *Width]
The type used for any heightmap operations and storage; idx = x + Width * z; Height points to the hig...
EMCSBiome BiomeMap[Width *Width]
The type used for any biomemap operations and storage inside Cuberite, using Cuberite biomes (need no...
void SetBlockTypeMeta(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta)
cChunkDef::BiomeMap & GetBiomeMap(void)
void SetHeightFromShape(const Shape &a_Shape)
Sets the heightmap to match the given shape data.