mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Change how world is stored & Bug fix
This commit is contained in:
parent
c90ea0e92b
commit
9089bb4cdb
4 changed files with 21 additions and 98 deletions
|
|
@ -71,14 +71,11 @@ namespace MinecraftClient.Protocol.Handlers
|
|||
// Indirect Mode: For block states with bits per entry <= 4, 4 bits are used to represent a block.
|
||||
if (bitsPerEntry < 4) bitsPerEntry = 4;
|
||||
|
||||
int entryPerLong = 64 / bitsPerEntry; // entryPerLong = sizeof(long) / bitsPerEntry
|
||||
|
||||
// Direct Mode: Bit mask covering bitsPerEntry bits
|
||||
// EG, if bitsPerEntry = 5, valueMask = 00011111 in binary
|
||||
uint valueMask = (uint)((1 << bitsPerEntry) - 1);
|
||||
|
||||
int paletteLength = 0; // Assume zero when length is absent
|
||||
if (usePalette) paletteLength = dataTypes.ReadNextVarInt(cache);
|
||||
int paletteLength = usePalette ? dataTypes.ReadNextVarInt(cache) : 0; // Assume zero when length is absent
|
||||
|
||||
Span<uint> palette = paletteLength < 256 ? stackalloc uint[paletteLength] : new uint[paletteLength];
|
||||
for (int i = 0; i < paletteLength; i++)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue