summaryrefslogtreecommitdiffstats
path: root/src/Protocol/ChunkDataSerializer.h
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@outlook.com>2021-03-05 14:03:55 +0100
committerGitHub <noreply@github.com>2021-03-05 14:03:55 +0100
commit868cd94ee9a5a0638c014a4cc42224f01ff234c8 (patch)
treecd23dc866f77de5b0b3e89a5eafeeb2ef24ffbdd /src/Protocol/ChunkDataSerializer.h
parentfixed the crash on generating in the SinglePiceStructuresGen (#5136) (diff)
downloadcuberite-868cd94ee9a5a0638c014a4cc42224f01ff234c8.tar
cuberite-868cd94ee9a5a0638c014a4cc42224f01ff234c8.tar.gz
cuberite-868cd94ee9a5a0638c014a4cc42224f01ff234c8.tar.bz2
cuberite-868cd94ee9a5a0638c014a4cc42224f01ff234c8.tar.lz
cuberite-868cd94ee9a5a0638c014a4cc42224f01ff234c8.tar.xz
cuberite-868cd94ee9a5a0638c014a4cc42224f01ff234c8.tar.zst
cuberite-868cd94ee9a5a0638c014a4cc42224f01ff234c8.zip
Diffstat (limited to 'src/Protocol/ChunkDataSerializer.h')
-rw-r--r--src/Protocol/ChunkDataSerializer.h19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/Protocol/ChunkDataSerializer.h b/src/Protocol/ChunkDataSerializer.h
index 47d92e2ee..d440098f6 100644
--- a/src/Protocol/ChunkDataSerializer.h
+++ b/src/Protocol/ChunkDataSerializer.h
@@ -49,25 +49,28 @@ public:
/** For each client, serializes the chunk into their protocol version and sends it.
Parameters are the coordinates of the chunk to serialise, and the data and biome data read from the chunk. */
- void SendToClients(int a_ChunkX, int a_ChunkZ, const cChunkData & a_Data, const unsigned char * a_BiomeData, const ClientHandles & a_SendTo);
+ void SendToClients(int a_ChunkX, int a_ChunkZ, const ChunkBlockData & a_BlockData, const ChunkLightData & a_LightData, const unsigned char * a_BiomeMap, const ClientHandles & a_SendTo);
private:
/** Serialises the given chunk, storing the result into the given cache entry, and sends the data.
If the cache entry is already present, simply re-uses it. */
- inline void Serialize(const ClientHandles::value_type & a_Client, int a_ChunkX, int a_ChunkZ, const cChunkData & a_Data, const unsigned char * a_BiomeData, CacheVersion a_CacheVersion);
+ inline void Serialize(const ClientHandles::value_type & a_Client, int a_ChunkX, int a_ChunkZ, const ChunkBlockData & a_BlockData, const ChunkLightData & a_LightData, const unsigned char * a_BiomeMap, CacheVersion a_CacheVersion);
- inline void Serialize47 (int a_ChunkX, int a_ChunkZ, const cChunkData & a_Data, const unsigned char * a_BiomeData); // Release 1.8
- inline void Serialize107(int a_ChunkX, int a_ChunkZ, const cChunkData & a_Data, const unsigned char * a_BiomeData); // Release 1.9
- inline void Serialize110(int a_ChunkX, int a_ChunkZ, const cChunkData & a_Data, const unsigned char * a_BiomeData); // Release 1.9.4
+ inline void Serialize47 (int a_ChunkX, int a_ChunkZ, const ChunkBlockData & a_BlockData, const ChunkLightData & a_LightData, const unsigned char * a_BiomeMap); // Release 1.8
+ inline void Serialize107(int a_ChunkX, int a_ChunkZ, const ChunkBlockData & a_BlockData, const ChunkLightData & a_LightData, const unsigned char * a_BiomeMap); // Release 1.9
+ inline void Serialize110(int a_ChunkX, int a_ChunkZ, const ChunkBlockData & a_BlockData, const ChunkLightData & a_LightData, const unsigned char * a_BiomeMap); // Release 1.9.4
template <auto Palette>
- inline void Serialize393(int a_ChunkX, int a_ChunkZ, const cChunkData & a_Data, const unsigned char * a_BiomeData); // Release 1.13 - 1.13.2
- inline void Serialize477(int a_ChunkX, int a_ChunkZ, const cChunkData & a_Data, const unsigned char * a_BiomeData); // Release 1.14 - 1.14.4
+ inline void Serialize393(int a_ChunkX, int a_ChunkZ, const ChunkBlockData & a_BlockData, const ChunkLightData & a_LightData, const unsigned char * a_BiomeMap); // Release 1.13 - 1.13.2
+ inline void Serialize477(int a_ChunkX, int a_ChunkZ, const ChunkBlockData & a_BlockData, const ChunkLightData & a_LightData, const unsigned char * a_BiomeMap); // Release 1.14 - 1.14.4
/** Writes all blocks in a chunk section into a series of Int64.
Writes start from the bit directly subsequent to the previous write's end, possibly crossing over to the next Int64. */
template <auto Palette>
- inline void WriteSectionDataSeamless(const cChunkData::sChunkSection & a_Section, const UInt8 a_BitsPerEntry);
+ inline void WriteBlockSectionSeamless(const ChunkBlockData::BlockArray * a_Blocks, const ChunkBlockData::MetaArray * a_Metas, UInt8 a_BitsPerEntry);
+
+ /** Copies all lights in a chunk section into the packet, block light followed immediately by sky light. */
+ inline void WriteLightSectionGrouped(const ChunkLightData::LightArray * a_BlockLights, const ChunkLightData::LightArray * a_SkyLights);
/** Finalises the data, compresses it if required, and stores it into cache. */
inline void CompressPacketInto(ChunkDataCache & a_Cache);