16 virtual void OnStartUsingReserve()
override {}
17 virtual void OnEndUsingReserve()
override {}
18 virtual void OnOutOfReserve()
override {}
31 m_IsLightValid(false),
32 m_IsHeightMapValid(false),
33 m_AreBiomesValid(false),
34 m_ShouldMarkDirty(a_ShouldMarkDirty)
43 int a_ChunkX,
int a_ChunkZ,
52 bool a_ShouldMarkDirty
57 ASSERT(a_BlockTypes !=
nullptr);
58 ASSERT(a_BlockMetas !=
nullptr);
65 if ((a_BlockLight !=
nullptr) && (a_SkyLight !=
nullptr))
73 if (a_HeightMap !=
nullptr)
80 if (a_Biomes !=
nullptr)
98 size_t MaxSection = 0;
113 for (
int y = MaxHeight; y > -1; y--)
137 if (EntityBlockType != WorldBlockType)
140 FLOGD(
"Block entity blocktype mismatch at {0}: entity for blocktype {1}({2}) in block {3}({4}). Deleting the block entity.",
std::map< size_t, cBlockEntity * > cBlockEntities
cBlockEntities m_BlockEntities
cChunkDef::HeightMap m_HeightMap
std::unique_ptr< T > make_unique(Args &&...args)
BLOCKTYPE GetBlockType() const
unsigned char BLOCKTYPE
The datatype used by blockdata.
const sChunkSection * GetSection(size_t a_SectionNum) const
Return a pointer to the chunk section or nullptr if all air.
BLOCKTYPE GetBlock(Vector3i a_RelPos) const
void SetBlockLight(const NIBBLETYPE *a_Src)
Copies the blocklight data from the specified flat array into the internal representation.
unsigned char NIBBLETYPE
The datatype used by nibbledata (meta, light, skylight)
void CalculateHeightMap(void)
Calculates the heightmap based on the contained blocktypes and marks it valid.
unsigned char HEIGHTTYPE
The type used by the heightmap.
void SetBlockTypes(const BLOCKTYPE *a_Src)
Copies the blocktype data from the specified flat array into the internal representation.
cSetChunkData(int a_ChunkX, int a_ChunkZ, bool a_ShouldMarkDirty)
Constructs a new instance with empty data.
std::vector< OwnedEntity > cEntityList
void SetSkyLight(const NIBBLETYPE *a_Src)
Copies the skylight data from the specified flat array into the internal representation.
cChunkDef::BiomeMap m_Biomes
void RemoveInvalidBlockEntities(void)
Removes the block entities that don't have a proper blocktype at their corresponding coords...
static const size_t NumSections
void SetMetas(const NIBBLETYPE *a_Src)
Copies the metadata from the specified flat array into the internal representation.
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...
AString ItemTypeToString(short a_ItemType)
Translates itemtype into a string.
static const int SectionHeight