mirror of
https://github.com/unmojang/node-minecraft-protocol.git
synced 2025-09-29 06:03:33 -04:00
update protodef
This commit is contained in:
parent
ba2d791d75
commit
836b36640a
@ -45,7 +45,7 @@
|
|||||||
"buffer-equal": "1.0.0",
|
"buffer-equal": "1.0.0",
|
||||||
"minecraft-data": "^1.0.3",
|
"minecraft-data": "^1.0.3",
|
||||||
"prismarine-nbt": "0.2.1",
|
"prismarine-nbt": "0.2.1",
|
||||||
"protodef": "^1.0.1",
|
"protodef": "^1.1.1",
|
||||||
"readable-stream": "^2.0.5",
|
"readable-stream": "^2.0.5",
|
||||||
"ursa-purejs": "0.0.3",
|
"ursa-purejs": "0.0.3",
|
||||||
"uuid-1345": "^0.99.6",
|
"uuid-1345": "^0.99.6",
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
const [readVarInt, writeVarInt, sizeOfVarInt] = require("protodef").types.varint;
|
const [readVarInt, writeVarInt, sizeOfVarInt] = require("protodef").types.varint;
|
||||||
const {PartialReadError} = require("protodef").utils;
|
|
||||||
const Transform = require("readable-stream").Transform;
|
const Transform = require("readable-stream").Transform;
|
||||||
|
|
||||||
module.exports.createSplitter = function() {
|
module.exports.createSplitter = function() {
|
||||||
@ -54,7 +53,7 @@ class Splitter extends Transform {
|
|||||||
({ value, size, error } = readVarInt(this.buffer, offset));
|
({ value, size, error } = readVarInt(this.buffer, offset));
|
||||||
}
|
}
|
||||||
catch(e) {
|
catch(e) {
|
||||||
if(!(e instanceof PartialReadError)) {
|
if(!(e.partialReadError)) {
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -68,7 +67,7 @@ class Splitter extends Transform {
|
|||||||
({value, size, error} = readVarInt(this.buffer, offset));
|
({value, size, error} = readVarInt(this.buffer, offset));
|
||||||
}
|
}
|
||||||
catch(e) {
|
catch(e) {
|
||||||
if(e instanceof PartialReadError) {
|
if(e.partialReadError) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user