mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Bug fix: Incorrect handling of Chunk.FullyLoaded in 1.17[.1]
This commit is contained in:
parent
b125b0f10a
commit
64915c87cf
1 changed files with 18 additions and 1 deletions
|
|
@ -158,6 +158,23 @@ namespace MinecraftClient.Protocol.Handlers
|
||||||
// Unloading chunks is handled by a separate packet
|
// Unloading chunks is handled by a separate packet
|
||||||
for (int chunkY = 0; chunkY < chunkColumnSize; chunkY++)
|
for (int chunkY = 0; chunkY < chunkColumnSize; chunkY++)
|
||||||
{
|
{
|
||||||
|
int lastChunkY = 0;
|
||||||
|
if (protocolversion == Protocol18Handler.MC_1_17_Version || protocolversion == Protocol18Handler.MC_1_17_1_Version)
|
||||||
|
{
|
||||||
|
for (int i = verticalStripBitmask!.Length - 1; i >= 0; --i)
|
||||||
|
{
|
||||||
|
if (verticalStripBitmask![i] != 0)
|
||||||
|
{
|
||||||
|
lastChunkY = (sizeof(ulong) * 8 * i) + (sizeof(ulong) * 8 - 1 - BitOperations.LeadingZeroCount(verticalStripBitmask![i]));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
lastChunkY = chunkColumnSize - 1;
|
||||||
|
}
|
||||||
|
|
||||||
if (cancellationToken.IsCancellationRequested)
|
if (cancellationToken.IsCancellationRequested)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
@ -180,7 +197,7 @@ namespace MinecraftClient.Protocol.Handlers
|
||||||
//We have our chunk, save the chunk into the world
|
//We have our chunk, save the chunk into the world
|
||||||
handler.InvokeOnMainThread(() =>
|
handler.InvokeOnMainThread(() =>
|
||||||
{
|
{
|
||||||
world.StoreChunk(chunkX, chunkY, chunkZ, chunkColumnSize, chunk, chunkY == (chunkColumnSize - 1));
|
world.StoreChunk(chunkX, chunkY, chunkZ, chunkColumnSize, chunk, chunkY == lastChunkY);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Skip Read Biomes (Type: Paletted Container) - 1.18(1.18.1) and above
|
// Skip Read Biomes (Type: Paletted Container) - 1.18(1.18.1) and above
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue