Fix zigzag type move in prismarine-nbt (#471)

* Fix rename of zigzag varint type in prismarine-nbt

* fix
This commit is contained in:
extremeheat 2023-12-27 12:53:39 -05:00 committed by GitHub
commit 7b74cbf712
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 6 deletions

View file

@ -5,7 +5,7 @@ const UUID = require('uuid-1345')
const protoLE = nbt.protos.little
const protoLEV = nbt.protos.littleVarint
// TODO: deal with this:
const zigzag = require('prismarine-nbt/compiler-zigzag')
const zigzag = require('prismarine-nbt/zigzag')
function readUUID (buffer, offset) {
if (offset + 16 > buffer.length) { throw new PartialReadError() }
@ -160,6 +160,6 @@ module.exports = {
entityMetadataLoop: [readEntityMetadata, writeEntityMetadata, sizeOfEntityMetadata],
ipAddress: [readIpAddress, writeIpAddress, 4],
endOfArray: [readEndOfArray, writeEndOfArray, sizeOfEndOfArray],
zigzag32: zigzag.zigzag32,
zigzag64: zigzag.zigzag64
zigzag32: zigzag.interpret.zigzag32,
zigzag64: zigzag.interpret.zigzag64
}

View file

@ -37,7 +37,7 @@ function createProtocol (version) {
const compiler = new ProtoDefCompiler()
compiler.addTypesToCompile(protocol.types)
compiler.addTypes(require('../datatypes/compiler-minecraft'))
compiler.addTypes(require('prismarine-nbt/compiler-zigzag'))
compiler.addTypes(require('prismarine-nbt/zigzag').compiler)
const compiledProto = compiler.compileProtoDefSync()
return compiledProto
@ -47,7 +47,7 @@ function createProtocol (version) {
function getProtocol (version) {
const compiler = new ProtoDefCompiler()
compiler.addTypes(require(join(__dirname, '../datatypes/compiler-minecraft')))
compiler.addTypes(require('prismarine-nbt/compiler-zigzag'))
compiler.addTypes(require('prismarine-nbt/zigzag').compiler)
global.PartialReadError = require('protodef/src/utils').PartialReadError
const compile = (compiler, file) => require(file)(compiler.native)

View file

@ -15,7 +15,7 @@ function createProtocol (version) {
const compiler = new ProtoDefCompiler()
const protocol = mcData('bedrock_' + version).protocol.types
compiler.addTypes(require('../src/datatypes/compiler-minecraft'))
compiler.addTypes(require('prismarine-nbt/compiler-zigzag'))
compiler.addTypes(require('prismarine-nbt/zigzag').compiler)
compiler.addTypesToCompile(protocol)
fs.writeFileSync('./read.js', 'module.exports = ' + compiler.readCompiler.generate().replace('() =>', 'native =>'))