diff --git a/src/read.ts b/src/read.ts index 9664e07..9709c92 100644 --- a/src/read.ts +++ b/src/read.ts @@ -267,6 +267,7 @@ export class NBTReader { } const value = decoder.decode(this.#data.subarray(this.#byteOffset,this.#byteOffset + length)); this.#byteOffset += length; + console.log(value); return value; } diff --git a/test/index.js b/test/index.js index 5d7dbc5..ad2cdde 100644 --- a/test/index.js +++ b/test/index.js @@ -10,7 +10,7 @@ const result = await NBT.read(data); console.log(result,"\n"); const result2 = await NBT.write(result,{ bedrockLevel: null }) -.then(buffer => NBT.read(buffer,{ endian: "big" })); +.then(buffer => NBT.read(buffer.slice(0,-1),{ endian: "little" })); console.log(result2,"\n"); const recompile = Buffer.from(await NBT.write(result2));