mirror of
https://github.com/unmojang/node-minecraft-protocol.git
synced 2025-09-28 13:45:37 -04:00
Fix tests, fix small bug in protocol.js
This commit is contained in:
parent
de0ea4f3f6
commit
db4c25883e
@ -380,7 +380,7 @@ var packets = {
|
||||
{ name: "offsetY", type: "float" },
|
||||
{ name: "offsetZ", type: "float" },
|
||||
{ name: "particleData", type: "float" },
|
||||
{ name: "particles", type: "count", typeArgs: { countFor: "data" } },
|
||||
{ name: "particles", type: "count", typeArgs: { countFor: "data", type: "int" } },
|
||||
{ name: "data", type: "array", typeArgs: { count: "particles", type: "varint" } }
|
||||
]},
|
||||
game_state_change: {id: 0x2b, fields: [
|
||||
@ -1158,7 +1158,7 @@ function writeSlot(value, buffer, offset) {
|
||||
if (value.nbtData)
|
||||
{
|
||||
var newbuf = nbt.writeUncompressed(value.nbtData);
|
||||
buffer.write(newbuf, offset + 5);
|
||||
newbuf.copy(buffer, offset + 5);
|
||||
nbtDataLen = newbuf.length;
|
||||
}
|
||||
else
|
||||
|
@ -93,7 +93,7 @@ var values = {
|
||||
id: 5,
|
||||
itemCount: 56,
|
||||
itemDamage: 2,
|
||||
nbtData: new Buffer(90),
|
||||
nbtData: { root: "test", value: { test: { type: "string", value: "ohi" } } }
|
||||
},
|
||||
'long': [0, 1],
|
||||
'entityMetadata': [
|
||||
@ -186,6 +186,7 @@ describe("packets", function() {
|
||||
} else {
|
||||
client.once([state, packetId], function(receivedPacket) {
|
||||
delete receivedPacket.id;
|
||||
delete receivedPacket.state;
|
||||
assertPacketsMatch(packet, receivedPacket);
|
||||
done();
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user