diff --git a/lib/protocol.js b/lib/protocol.js index 6e2d12a..2adac4f 100644 --- a/lib/protocol.js +++ b/lib/protocol.js @@ -264,7 +264,7 @@ var packets = { { name: "groundUp", type: "bool" }, { name: "bitMap", type: "ushort" }, { name: "addBitMap", type: "ushort" }, - { name: "compressedData", type: "byteArray32" } + { name: "compressedChunkData", type: "byteArray32" } ], 0x34: [ { name: "chunkX", type: "int" }, @@ -635,21 +635,21 @@ function readMapChunkBulk (buffer, offset) { cursor = compressedChunkDataEnd; var meta = []; - var i, chunkX, chunkZ, primaryBitMap, addBitMap; + var i, chunkX, chunkZ, bitMap, addBitMap; for (i = 0; i < chunkCount; ++i) { chunkX = buffer.readInt32BE(cursor); cursor += 4; chunkZ = buffer.readInt32BE(cursor); cursor += 4; - primaryBitMap = buffer.readUInt16BE(cursor); + bitMap = buffer.readUInt16BE(cursor); cursor += 2; addBitMap = buffer.readUInt16BE(cursor); cursor += 2; meta.push({ - chunkX: chunkX, - chunkZ: chunkZ, - primaryBitMap: primaryBitMap, + x: chunkX, + z: chunkZ, + bitMap: bitMap, addBitMap: addBitMap, }); } @@ -657,6 +657,7 @@ function readMapChunkBulk (buffer, offset) { return { value: { skyLightSent: skyLightSent, + chunkCount: chunkCount, compressedChunkData: compressedChunkData, meta: meta, },