properly use protodef nbt inside prismarine-nbt

This commit is contained in:
Romain Beaumont 2015-11-15 03:25:14 +01:00
parent 9a6e7f8f42
commit c9290e664b

View File

@ -85,18 +85,15 @@ function sizeOfSlot(value) {
function readNbt(buffer, offset) { function readNbt(buffer, offset) {
buffer = buffer.slice(offset); return nbt.proto.read(buffer,offset,"nbt");
return nbt.parseUncompressed(buffer);
} }
function writeNbt(value, buffer, offset) { function writeNbt(value, buffer, offset) {
var newbuf = nbt.writeUncompressed(value); return nbt.proto.write(value,buffer,offset,"nbt");
newbuf.copy(buffer, offset);
return offset + newbuf.length;
} }
function sizeOfNbt(value) { function sizeOfNbt(value) {
return nbt.writeUncompressed(value).length; return nbt.proto.sizeOf(value,"nbt");
} }