Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support 1.21.3 #1347

Merged
merged 7 commits into from
Dec 4, 2024
Merged

support 1.21.3 #1347

merged 7 commits into from
Dec 4, 2024

Conversation

rom1504
Copy link
Member

@rom1504 rom1504 commented Oct 27, 2024

No description provided.

Copy link

@jforge jforge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Env: Node 22.1.0)

After replaying these changes, this successfully mitigates the message
Error: unsupported protocol version: 1.21.3

And the version set to 1.21.3 no longer throws with my 1.21.3 server:
Error: This server is version 1.21.3, you are using version 1.21.1, please specify the correct version in the options.

From this perspective, this seems to be a valid change, but I get a sequent error on another level in the end, does it correlate with the change or is it something else?

/node_modules/protodef/src/compiler.js:405
      throw new Error('Unknown parametrizable type: ' + type[0])
      ^

Error: Unknown parametrizable type: registryEntryHolder
    at SizeOfCompiler.compileType (node_modules/protodef/src/compiler.js:405:13)
    at SizeOfCompiler.callType (node_modules/protodef/src/compiler.js:426:23)
    at module.exports.SizeOf.container (node_modules/protodef/src/datatypes/compiler-structures.js:159:39)
    at SizeOfCompiler.compileType (node_modules/protodef/src/compiler.js:401:90)
    at SizeOfCompiler.callType (node_modules/protodef/src/compiler.js:426:23)
    at module.exports.SizeOf.switch (node_modules/protodef/src/datatypes/compiler-conditional.js:76:67)
    at SizeOfCompiler.compileType (node_modules/protodef/src/compiler.js:401:90)
    at SizeOfCompiler.callType (node_modules/protodef/src/compiler.js:426:23)
    at module.exports.SizeOf.container (node_modules/protodef/src/datatypes/compiler-structures.js:159:39)
    at SizeOfCompiler.compileType (node_modules/protodef/src/compiler.js:401:90)

@GroobleDierne
Copy link
Contributor

(Env: Node 22.1.0)

After replaying these changes, this successfully mitigates the message Error: unsupported protocol version: 1.21.3

And the version set to 1.21.3 no longer throws with my 1.21.3 server: Error: This server is version 1.21.3, you are using version 1.21.1, please specify the correct version in the options.

From this perspective, this seems to be a valid change, but I get a sequent error on another level in the end, does it correlate with the change or is it something else?

/node_modules/protodef/src/compiler.js:405
      throw new Error('Unknown parametrizable type: ' + type[0])
      ^

Error: Unknown parametrizable type: registryEntryHolder
    at SizeOfCompiler.compileType (node_modules/protodef/src/compiler.js:405:13)
    at SizeOfCompiler.callType (node_modules/protodef/src/compiler.js:426:23)
    at module.exports.SizeOf.container (node_modules/protodef/src/datatypes/compiler-structures.js:159:39)
    at SizeOfCompiler.compileType (node_modules/protodef/src/compiler.js:401:90)
    at SizeOfCompiler.callType (node_modules/protodef/src/compiler.js:426:23)
    at module.exports.SizeOf.switch (node_modules/protodef/src/datatypes/compiler-conditional.js:76:67)
    at SizeOfCompiler.compileType (node_modules/protodef/src/compiler.js:401:90)
    at SizeOfCompiler.callType (node_modules/protodef/src/compiler.js:426:23)
    at module.exports.SizeOf.container (node_modules/protodef/src/datatypes/compiler-structures.js:159:39)
    at SizeOfCompiler.compileType (node_modules/protodef/src/compiler.js:401:90)

This is still a work-in-progress PR. 1.21.3 support is scattered among multiple repositories, so you shouldn't expect it to work based on the PR of only one repository.

const set = []
let accSize = nSize
for (let i = 0; i < n - 1; i++) {
const entry = ${compiler.callType(opts.otherwise.type)}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change to const entry = ${compiler.callType(opts.otherwise.type, 'offset + accSize')}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

return compiler.wrapCode(`
const { value: n, size: nSize } = ${compiler.callType('varint')}
if (n === 0) {
const base = ${compiler.callType(opts.base.type)}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change to const base = ${compiler.callType(opts.base.type, 'offset + nSize')}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -61,6 +62,56 @@ module.exports = {
code += '}\n'
code += 'return { value: data, size }'
return compiler.wrapCode(code)
}],
bitflags: ['parametrizable', (compiler, { type, flags, shift, big }) => {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is bit flags here instead of protodef?

rom1504 and others added 2 commits December 3, 2024 22:07
* Remove debug logging

* Fix benchmark tests for 1.21.3

* Start updating packetTest for 1.21.3

* Update packetTest.js with new types

* Fix minecraft-compiler

* Speedup tests by setting world type to flat and disabling structures.

* Didn't mean to commit that
@rom1504 rom1504 merged commit 2224d82 into master Dec 4, 2024
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Closed
Development

Successfully merging this pull request may close these issues.

4 participants