diff --git a/package.json b/package.json index cecd9d4..5d77f58 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ "buffer-equal": "1.0.0", "minecraft-data": "^1.0.3", "prismarine-nbt": "0.2.1", - "protodef": "^1.0.1", + "protodef": "^1.1.1", "readable-stream": "^2.0.5", "ursa-purejs": "0.0.3", "uuid-1345": "^0.99.6", diff --git a/src/transforms/framing.js b/src/transforms/framing.js index 3ca7adb..5f96648 100644 --- a/src/transforms/framing.js +++ b/src/transforms/framing.js @@ -1,5 +1,4 @@ const [readVarInt, writeVarInt, sizeOfVarInt] = require("protodef").types.varint; -const {PartialReadError} = require("protodef").utils; const Transform = require("readable-stream").Transform; module.exports.createSplitter = function() { @@ -54,7 +53,7 @@ class Splitter extends Transform { ({ value, size, error } = readVarInt(this.buffer, offset)); } catch(e) { - if(!(e instanceof PartialReadError)) { + if(!(e.partialReadError)) { throw e; } else @@ -68,7 +67,7 @@ class Splitter extends Transform { ({value, size, error} = readVarInt(this.buffer, offset)); } catch(e) { - if(e instanceof PartialReadError) { + if(e.partialReadError) { break; } else