mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-24 05:03:34 -04:00
Minor performance optimisation for sending level in classic+hax mode.
This commit is contained in:
parent
deeb68f2a9
commit
31110aa3d4
@ -392,9 +392,12 @@ namespace MCGalaxy {
|
||||
byte* convCPE = stackalloc byte[256];
|
||||
for (int i = 0; i < 256; i++)
|
||||
conv[i] = Block.Convert((byte)i);
|
||||
|
||||
if (!hasCustomBlocks) {
|
||||
for (int i = 0; i < 256; i++)
|
||||
for (int i = 0; i < 256; i++) {
|
||||
convCPE[i] = Block.ConvertCPE((byte)i);
|
||||
conv[i] = Block.ConvertCPE(conv[i]);
|
||||
}
|
||||
}
|
||||
|
||||
using (GZipStream compressor = new GZipStream(dst, CompressionMode.Compress, true)) {
|
||||
@ -425,7 +428,7 @@ namespace MCGalaxy {
|
||||
block = hasBlockDefs ? level.GetExtTile(i) : level.GetFallbackExtTile(i);
|
||||
buffer[bIndex] = convCPE[block];
|
||||
} else {
|
||||
buffer[bIndex] = convCPE[conv[block]];
|
||||
buffer[bIndex] = conv[block];
|
||||
}
|
||||
|
||||
bIndex++;
|
||||
|
Loading…
x
Reference in New Issue
Block a user