mirror of
https://github.com/PrismarineJS/node-minecraft-protocol.git
synced 2025-05-09 12:50:26 -04:00
add chunkCount to 0x38
changed some more things for more API consistency * 0x33: compressedData -> compressedChunkData * 0x38: meta.chunkX -> meta.x * 0x38: meta.chunkZ -> meta.z * 0x38: meta.primaryBitMap -> meta.bitMap * 0x38: add chunkCount
This commit is contained in:
parent
37d1cdcca1
commit
08f71f11dc
1 changed files with 7 additions and 6 deletions
|
@ -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,
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue