From fa908f577d1b30be21cdbbb94eb2a5642e5cab32 Mon Sep 17 00:00:00 2001 From: Filip <54005272+MightyFilipns@users.noreply.github.com> Date: Mon, 4 Nov 2024 10:01:31 +0100 Subject: Temp fix for disappearing chunk sections in 1.14 (#5560) * Temp fix for dissapearing section in 1.13 and 1.14 versions Previously the value for nonEmptyBlocks in each chunk section was -1. This was probably set with the intention to set it to the max value. However, the game also interprets the value as signed. meaning when a block is placed the value is incremented to 0. But when the nonEmptyBlocks value is 0 the game treats that section as empty and stops rendering blocks in it. This patch makes sure that the value sent is 4096, the amount of blocks in any section. This will probably lead to the inverse bug where the game will treat empty sections as non-empty. * Use named constant for section size rather than magic number. --------- Co-authored-by: Alexander Harkness --- src/Protocol/ChunkDataSerializer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Protocol/ChunkDataSerializer.cpp b/src/Protocol/ChunkDataSerializer.cpp index cfabc6e31..6b5553ee7 100644 --- a/src/Protocol/ChunkDataSerializer.cpp +++ b/src/Protocol/ChunkDataSerializer.cpp @@ -502,7 +502,7 @@ inline void cChunkDataSerializer::Serialize477(const int a_ChunkX, const int a_C // Write each chunk section... ChunkDef_ForEachSection(a_BlockData, a_LightData, { - m_Packet.WriteBEInt16(-1); + m_Packet.WriteBEInt16(ChunkBlockData::SectionBlockCount); // a temp fix to make sure sections don't disappear m_Packet.WriteBEUInt8(BitsPerEntry); m_Packet.WriteVarInt32(static_cast(ChunkSectionDataArraySize)); WriteBlockSectionSeamless<&Palette477>(Blocks, Metas, BitsPerEntry); -- cgit v1.2.3