|
Cuberite
A lightweight, fast and extensible game server for Minecraft
|
Go to the documentation of this file.
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
void SetChunkCoords(cChunkCoords a_Coords)
static const int NumBlocks
cChunkCoords GetChunkCoords() const
void SetBlockTypeMeta(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta)
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...
EMCSBiome BiomeMap[Width *Width]
The type used for any biomemap operations and storage inside Cuberite, using Cuberite biomes (need no...
NIBBLETYPE * GetBlockMetas(void) const
BlockNibbleBytes & GetBlockMetasUncompressed(void)
void FillBlocks(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta)
BLOCKTYPE * GetBlockTypes(void) const
Returns the internal pointer to the block types.
void SetUseDefaultFinish(bool a_bUseDefaultFinish)
cChunkDef::HeightMap & GetHeightMap(void)
Byte Shape[256 *16 *16]
The datatype used to represent the entire chunk worth of shape.
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 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,...
cBlockEntities & GetBlockEntities(void)
unsigned char NIBBLETYPE
The datatype used by nibbledata (meta, light, skylight)
EMCSBiome GetBiome(int a_RelX, int a_RelZ) const
bool m_bUseDefaultComposition
cEntityList & GetEntities(void)
void SetBlockMeta(int a_RelX, int a_RelY, int a_RelZ, NIBBLETYPE a_BlockMeta)
cChunkDef::BiomeMap & GetBiomeMap(void)
cChunkDesc(cChunkCoords a_Coords)
cBlockEntities m_BlockEntities
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.
cChunkDef::BlockTypes & GetBlockTypes(void)
NIBBLETYPE GetBlockMeta(int a_RelX, int a_RelY, int a_RelZ) const
bool IsUsingDefaultFinish(void) const
BLOCKTYPE GetBlockType(int a_RelX, int a_RelY, int a_RelZ) const
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.
cChunkDef::HeightMap m_HeightMap
unsigned char HEIGHTTYPE
The type used by the heightmap.
HEIGHTTYPE GetMaxHeight(void) const
Returns the maximum height value in the heightmap.
HEIGHTTYPE GetMinHeight(void) const
Returns the minimum height value in the heightmap.
void UpdateHeightmap(void)
Updates the heightmap to match the current contents.
void SetHeightFromShape(const Shape &a_Shape)
Sets the heightmap to match the given shape data.
EMCSBiome
Biome IDs The first batch corresponds to the clientside biomes, used by MineCraft.
NIBBLETYPE BlockNibbleBytes[cChunkDef::NumBlocks]
Uncompressed block metas, 1 meta per byte.
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,...
void CompressBlockMetas(cChunkDef::BlockNibbles &a_DestMetas)
Compresses the metas from the BlockArea format (1 meta per byte) into regular format (2 metas per byt...
void SetUseDefaultBiomes(bool a_bUseDefaultBiomes)
void SetBiome(int a_RelX, int a_RelZ, EMCSBiome a_BiomeID)
bool IsUsingDefaultHeight(void) const
std::unordered_map< size_t, OwnedBlockEntity > cBlockEntities
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.
HEIGHTTYPE HeightMap[Width *Width]
The type used for any heightmap operations and storage; idx = x + Width * z; Height points to the hig...
bool IsUsingDefaultBiomes(void) const
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...
BLOCKTYPE BlockTypes[NumBlocks]
The type used for block type operations and storage, AXIS_ORDER ordering.
unsigned char BLOCKTYPE
The datatype used by blockdata.
void SetHeight(int a_RelX, int a_RelZ, HEIGHTTYPE a_Height)
HEIGHTTYPE GetHeight(int a_RelX, int a_RelZ) const
void GetShapeFromHeight(Shape &a_Shape) const
Sets the shape in a_Shape to match the heightmap stored currently in m_HeightMap.
cBlockEntity * GetBlockEntity(int a_RelX, int a_RelY, int a_RelZ)
Returns the block entity at the specified coords.
bool IsUsingDefaultComposition(void) const
void SetUseDefaultHeight(bool a_bUseDefaultHeight)
void VerifyHeightmap(void)
Verifies that the heightmap corresponds to blocktype contents; if not, asserts on that column.
const cChunkDef::BlockTypes & GetBlockTypes() const
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...
cChunkDef::BiomeMap m_BiomeMap
void SetUseDefaultComposition(bool a_bUseDefaultComposition)
NIBBLETYPE BlockNibbles[NumBlocks/2]
The type used for block data in nibble format, AXIS_ORDER ordering.
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...
const cChunkDef::HeightMap & GetHeightMap() const
eMergeStrategy
The per-block strategy to use when merging another block area into this object.
void SetBlockType(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_BlockType)
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.
const cChunkDef::BiomeMap & GetBiomeMap() const
std::vector< OwnedEntity > cEntityList