Cuberite
A lightweight, fast and extensible game server for Minecraft
|
#include <SetChunkData.h>
Public Member Functions | |
bool | AreBiomesValid (void) const |
Returns whether the biomes stored in this object are valid. More... | |
void | CalculateHeightMap (void) |
Calculates the heightmap based on the contained blocktypes and marks it valid. More... | |
cSetChunkData (int a_ChunkX, int a_ChunkZ, bool a_ShouldMarkDirty) | |
Constructs a new instance with empty data. More... | |
cSetChunkData (int a_ChunkX, int a_ChunkZ, const BLOCKTYPE *a_BlockTypes, const NIBBLETYPE *a_BlockMetas, const NIBBLETYPE *a_BlockLight, const NIBBLETYPE *a_SkyLight, const cChunkDef::HeightMap *a_HeightMap, const cChunkDef::BiomeMap *a_Biomes, cEntityList &&a_Entities, cBlockEntities &&a_BlockEntities, bool a_ShouldMarkDirty) | |
Constructs a new instance based on data existing elsewhere, will copy all the memory. More... | |
cChunkDef::BiomeMap & | GetBiomes (void) |
Returns the internal storage for biomes, read-write. More... | |
cBlockEntities & | GetBlockEntities (void) |
Returns the internal storage for block entities, read-write. More... | |
cChunkData & | GetChunkData (void) |
Returns the internal storage of block types, metas and lighting. More... | |
int | GetChunkX (void) const |
int | GetChunkZ (void) const |
cEntityList & | GetEntities (void) |
Returns the internal storage for entities, read-write. More... | |
const cChunkDef::HeightMap & | GetHeightMap (void) const |
Returns the internal storage for heightmap, read-only. More... | |
bool | IsHeightMapValid (void) const |
Returns whether the heightmap stored in this object is valid. More... | |
bool | IsLightValid (void) const |
Returns whether both light arrays stored in this object are valid. More... | |
void | MarkBiomesValid (void) |
Marks the biomes stored in this object as valid. More... | |
void | RemoveInvalidBlockEntities (void) |
Removes the block entities that don't have a proper blocktype at their corresponding coords. More... | |
bool | ShouldMarkDirty (void) const |
Returns whether the chunk should be marked as dirty after its data is set. More... | |
Protected Attributes | |
bool | m_AreBiomesValid |
cChunkDef::BiomeMap | m_Biomes |
cBlockEntities | m_BlockEntities |
cChunkData | m_ChunkData |
int | m_ChunkX |
int | m_ChunkZ |
cEntityList | m_Entities |
cChunkDef::HeightMap | m_HeightMap |
bool | m_IsHeightMapValid |
bool | m_IsLightValid |
cListAllocationPool< cChunkData::sChunkSection > | m_Pool |
bool | m_ShouldMarkDirty |
Definition at line 14 of file SetChunkData.h.
cSetChunkData::cSetChunkData | ( | int | a_ChunkX, |
int | a_ChunkZ, | ||
bool | a_ShouldMarkDirty | ||
) |
Constructs a new instance with empty data.
Allocates new buffers for the block data. Prefer to use this constructor, then fill the object with data and then send it to cWorld, as this will reduce the copying required to queue the set operation.
Definition at line 26 of file SetChunkData.cpp.
cSetChunkData::cSetChunkData | ( | int | a_ChunkX, |
int | a_ChunkZ, | ||
const BLOCKTYPE * | a_BlockTypes, | ||
const NIBBLETYPE * | a_BlockMetas, | ||
const NIBBLETYPE * | a_BlockLight, | ||
const NIBBLETYPE * | a_SkyLight, | ||
const cChunkDef::HeightMap * | a_HeightMap, | ||
const cChunkDef::BiomeMap * | a_Biomes, | ||
cEntityList && | a_Entities, | ||
cBlockEntities && | a_BlockEntities, | ||
bool | a_ShouldMarkDirty | ||
) |
Constructs a new instance based on data existing elsewhere, will copy all the memory.
Prefer to use the other constructor as much as possible. Will move the entity list and blockentities into the internal storage, and invalidate a_Entities and a_BlockEntities. When passing an lvalue, a_Entities and a_BlockEntities must be explicitly converted to an rvalue beforehand with std::move(). a_BlockTypes and a_BlockMetas must always be valid. If either of the light arrays are nullptr, the chunk data will be marked as not having any light at all and will be scheduled for re-lighting once it is set into the chunkmap. If a_Biomes is not valid, the internal flag is set and the world will calculate the biomes using the chunk generator when setting the chunk data. If a_HeightMap is not assigned, the world will calculate the heightmap based on the blocktypes when setting the chunk data.
Definition at line 42 of file SetChunkData.cpp.
|
inline |
Returns whether the biomes stored in this object are valid.
Definition at line 74 of file SetChunkData.h.
void cSetChunkData::CalculateHeightMap | ( | void | ) |
Calculates the heightmap based on the contained blocktypes and marks it valid.
Definition at line 95 of file SetChunkData.cpp.
|
inline |
Returns the internal storage for biomes, read-write.
Definition at line 59 of file SetChunkData.h.
|
inline |
Returns the internal storage for block entities, read-write.
Definition at line 65 of file SetChunkData.h.
|
inline |
Returns the internal storage of block types, metas and lighting.
Definition at line 53 of file SetChunkData.h.
|
inline |
Definition at line 49 of file SetChunkData.h.
|
inline |
Definition at line 50 of file SetChunkData.h.
|
inline |
Returns the internal storage for entities, read-write.
Definition at line 62 of file SetChunkData.h.
|
inline |
Returns the internal storage for heightmap, read-only.
Definition at line 56 of file SetChunkData.h.
|
inline |
Returns whether the heightmap stored in this object is valid.
Definition at line 71 of file SetChunkData.h.
|
inline |
Returns whether both light arrays stored in this object are valid.
Definition at line 68 of file SetChunkData.h.
|
inline |
Marks the biomes stored in this object as valid.
Definition at line 81 of file SetChunkData.h.
void cSetChunkData::RemoveInvalidBlockEntities | ( | void | ) |
Removes the block entities that don't have a proper blocktype at their corresponding coords.
Definition at line 130 of file SetChunkData.cpp.
|
inline |
Returns whether the chunk should be marked as dirty after its data is set.
Used by the generator to save chunks after generating.
Definition at line 78 of file SetChunkData.h.
|
protected |
Definition at line 102 of file SetChunkData.h.
|
protected |
Definition at line 96 of file SetChunkData.h.
|
protected |
Definition at line 98 of file SetChunkData.h.
|
protected |
Definition at line 94 of file SetChunkData.h.
|
protected |
Definition at line 90 of file SetChunkData.h.
|
protected |
Definition at line 91 of file SetChunkData.h.
|
protected |
Definition at line 97 of file SetChunkData.h.
|
protected |
Definition at line 95 of file SetChunkData.h.
|
protected |
Definition at line 101 of file SetChunkData.h.
|
protected |
Definition at line 100 of file SetChunkData.h.
|
protected |
Definition at line 93 of file SetChunkData.h.
|
protected |
Definition at line 103 of file SetChunkData.h.