This commit is contained in:
BruceChen 2022-08-30 20:05:53 +08:00
parent aceccaf5b5
commit 3d13eb51e6
4 changed files with 24 additions and 38 deletions

View file

@ -87,7 +87,7 @@ namespace MinecraftClient.Protocol.Handlers
//// Block IDs are packed in the array of 64-bits integers
dataTypes.SkipNextVarInt(cache); // Entry length
Span<byte> entryDataByte = stackalloc byte[8];
Span<long> entryDataLong = MemoryMarshal.Cast<byte, long>(entryDataByte);
Span<long> entryDataLong = MemoryMarshal.Cast<byte, long>(entryDataByte); // Faster than MemoryMarshal.Read<long>
Block[] blocks = new Block[Chunk.SizeX * Chunk.SizeY * Chunk.SizeZ];
int startOffset = 64; // Read the first data immediately

View file

@ -97,7 +97,5 @@ namespace MinecraftClient.Protocol.Session
return session;
}
}
}