mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Fixed the requested changes for Terrain Movement. Tested and working.
This commit is contained in:
parent
9f197d415e
commit
af6f655d5e
7 changed files with 60 additions and 72 deletions
|
|
@ -332,7 +332,7 @@ namespace MinecraftClient.Protocol.Handlers
|
|||
currentDimensionName = dataTypes.ReadNextString(packetData); // Dimension Name (World Name) - 1.16 and above
|
||||
|
||||
if (protocolversion >= MC1162Version)
|
||||
handler.GetWorld().SetDimension(currentDimensionName, currentDimensionType);
|
||||
World.SetDimension(currentDimensionName, currentDimensionType);
|
||||
|
||||
if (protocolversion >= MC115Version)
|
||||
dataTypes.ReadNextLong(packetData); // Hashed world seed - 1.15 and above
|
||||
|
|
@ -391,10 +391,7 @@ namespace MinecraftClient.Protocol.Handlers
|
|||
dimensionNameInRespawn = dataTypes.ReadNextString(packetData); // Dimension Name (World Name) - 1.16 and above
|
||||
|
||||
if (protocolversion >= MC1162Version)
|
||||
new Task(() =>
|
||||
{
|
||||
handler.GetWorld().SetDimension(dimensionNameInRespawn, dimensionTypeInRespawn);
|
||||
}).Start();
|
||||
World.SetDimension(dimensionNameInRespawn, dimensionTypeInRespawn);
|
||||
|
||||
if (protocolversion < MC114Version)
|
||||
dataTypes.ReadNextByte(packetData); // Difficulty - 1.13 and below
|
||||
|
|
@ -470,12 +467,13 @@ namespace MinecraftClient.Protocol.Handlers
|
|||
}
|
||||
|
||||
int dataSize = dataTypes.ReadNextVarInt(packetData); // Size
|
||||
|
||||
Interlocked.Increment(ref handler.GetWorld().chunkCnt);
|
||||
Interlocked.Increment(ref handler.GetWorld().chunkLoadNotCompleted);
|
||||
new Task(() =>
|
||||
{
|
||||
handler.GetWorld().chunkCnt++;
|
||||
handler.GetWorld().chunkLoadNotCompleted++;
|
||||
pTerrain.ProcessChunkColumnData(chunkX, chunkZ, verticalStripBitmask, packetData);
|
||||
handler.GetWorld().chunkLoadNotCompleted--;
|
||||
Interlocked.Decrement(ref handler.GetWorld().chunkLoadNotCompleted);
|
||||
}).Start();
|
||||
}
|
||||
else
|
||||
|
|
@ -752,7 +750,8 @@ namespace MinecraftClient.Protocol.Handlers
|
|||
int chunkZ = dataTypes.ReadNextInt(packetData);
|
||||
|
||||
if (handler.GetWorld()[chunkX, chunkZ] != null)
|
||||
handler.GetWorld().chunkCnt--;
|
||||
Interlocked.Decrement(ref handler.GetWorld().chunkCnt);
|
||||
// Warning: It is legal to include unloaded chunks in the UnloadChunk packet. Since chunks that have not been loaded are not recorded, this may result in loading chunks that should be unloaded and inaccurate statistics.
|
||||
|
||||
handler.GetWorld()[chunkX, chunkZ] = null;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -147,10 +147,8 @@ namespace MinecraftClient.Protocol.Handlers
|
|||
public void ProcessChunkColumnData(int chunkX, int chunkZ, ulong[] verticalStripBitmask, Queue<byte> cache)
|
||||
{
|
||||
var world = handler.GetWorld();
|
||||
if (world.GetDimension() == null)
|
||||
return;
|
||||
|
||||
int chunkColumnSize = (world.GetDimension().height + 15) / 16;
|
||||
int chunkColumnSize = (World.GetDimension().height + 15) / 16; // Round up
|
||||
|
||||
if (protocolversion >= Protocol18Handler.MC117Version)
|
||||
{
|
||||
|
|
@ -223,7 +221,7 @@ namespace MinecraftClient.Protocol.Handlers
|
|||
/// <param name="cache">Cache for reading chunk data</param>
|
||||
public void ProcessChunkColumnData(int chunkX, int chunkZ, ushort chunkMask, ushort chunkMask2, bool hasSkyLight, bool chunksContinuous, int currentDimension, Queue<byte> cache)
|
||||
{
|
||||
const int chunkColumnSize = 16;
|
||||
const int chunkColumnSize = 16;
|
||||
if (protocolversion >= Protocol18Handler.MC19Version)
|
||||
{
|
||||
// 1.9 and above chunk format
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue