mirror of
https://github.com/unmojang/node-minecraft-protocol.git
synced 2025-09-28 05:35:56 -04:00
more packets parsed
This commit is contained in:
parent
8bfe1888e8
commit
7b92a88872
@ -81,8 +81,29 @@ var readers = {
|
||||
'mapChunkBulk': readMapChunkBulk,
|
||||
'entityMetadata': readEntityMetadata,
|
||||
'objectData': readObjectData,
|
||||
'intArray': readIntArray,
|
||||
};
|
||||
|
||||
function readIntArray(buffer, offset) {
|
||||
var results = readByte(buffer, offset);
|
||||
if (! results) return null;
|
||||
var count = results.value;
|
||||
var cursor = offset + results.size;
|
||||
|
||||
var endCursor = cursor + 4 * count;
|
||||
if (endCursor > buffer.length) return null;
|
||||
var array = [];
|
||||
for (var i = 0; i < count; ++i) {
|
||||
array.push(buffer.readInt32BE(cursor));
|
||||
cursor += 4;
|
||||
}
|
||||
|
||||
return {
|
||||
value: array,
|
||||
size: endCursor - offset,
|
||||
};
|
||||
}
|
||||
|
||||
var entityMetadataReaders = {
|
||||
0: readByte,
|
||||
1: readShort,
|
||||
|
64
packets.json
64
packets.json
@ -235,6 +235,70 @@
|
||||
"type": "short"
|
||||
}
|
||||
],
|
||||
"29": [
|
||||
{
|
||||
"name": "entityIds",
|
||||
"type": "intArray"
|
||||
}
|
||||
],
|
||||
"31": [
|
||||
{
|
||||
"name": "entityId",
|
||||
"type": "int"
|
||||
},
|
||||
{
|
||||
"name": "deltaX",
|
||||
"type": "byte"
|
||||
},
|
||||
{
|
||||
"name": "deltaY",
|
||||
"type": "byte"
|
||||
},
|
||||
{
|
||||
"name": "deltaZ",
|
||||
"type": "byte"
|
||||
}
|
||||
],
|
||||
"32": [
|
||||
{
|
||||
"name": "entityId",
|
||||
"type": "int"
|
||||
},
|
||||
{
|
||||
"name": "yaw",
|
||||
"type": "byte"
|
||||
},
|
||||
{
|
||||
"name": "pitch",
|
||||
"type": "byte"
|
||||
}
|
||||
],
|
||||
"34": [
|
||||
{
|
||||
"name": "entityId",
|
||||
"type": "int"
|
||||
},
|
||||
{
|
||||
"name": "x",
|
||||
"type": "int"
|
||||
},
|
||||
{
|
||||
"name": "y",
|
||||
"type": "int"
|
||||
},
|
||||
{
|
||||
"name": "z",
|
||||
"type": "int"
|
||||
},
|
||||
{
|
||||
"name": "yaw",
|
||||
"type": "byte"
|
||||
},
|
||||
{
|
||||
"name": "pitch",
|
||||
"type": "byte"
|
||||
}
|
||||
],
|
||||
"35": [
|
||||
{
|
||||
"name": "entityId",
|
||||
|
Loading…
x
Reference in New Issue
Block a user