Fixes to protocol Holder implementation#1355
Merged
rom1504 merged 18 commits intoPrismarineJS:masterfrom Jul 1, 2025
Merged
Conversation
Member
|
this still fails |
Member
Author
|
Next is to finish this PR and update mineflayer |
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR removes deprecated numeric and flag type handling in favor of new “holder” objects and updates related code, tests, examples, and docs.
- Switch chat and sound packet fields from raw numbers/flags to holder objects (e.g.,
{chatType},{soundId}). - Remove obsolete
arrayWithLengthOffsetand bitflag compiler routines fromsrc/datatypes. - Update client/server logic, tests, examples, docs, and CI to align with the new holder-based packet definitions.
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| test/serverTest.js | Updated chat type feature flag check to use new chatType holder |
| test/packetTest.js | Added player_info payload fixtures and new holder types (IDSet, ItemSoundHolder, ChatTypesHolder) |
| src/server.js | Simplified disconnect reason assignment using ` |
| src/datatypes/minecraft.js | Removed deprecated arrayWithLengthOffset datatype entry |
| src/datatypes/compiler-minecraft.js | Purged obsolete compiler logic for numeric arrays and bitflags |
| src/client/play.js | Moved playerJoin emission after chat handler initialization |
| src/client/chat.js | Refactored player_info handler to use holder properties instead of raw flags/numbers |
| src/client.js | Enhanced error messages with buffer length and hex snippet |
| examples/server_helloworld/server_helloworld.js | Updated example to use new chatType holder |
| examples/server/server.js | Updated broadcast example to use new chatType holder |
| docs/README.md | Updated documentation examples to reflect new chatType holder |
| .github/workflows/ci.yml | Added CI step to clone the updated minecraft-data branch for protodef changes |
Comments suppressed due to low confidence (1)
.github/workflows/ci.yml:59
- [nitpick] This CI step chains many commands in one line. Splitting it into separate, named steps (e.g., backup, clone, generate) would improve readability and debugging.
- run: cd node_modules && cd minecraft-data && mv minecraft-data minecraft-data-old && git clone -b pc-proto-updates https://github.com/extremeheat/minecraft-data --depth 1 && node bin/generate_data.js
Member
|
Looks like tests are passing. Next step the mineflayer side PR? |
Member
|
/makerelease |
Merged
This was referenced Jul 25, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix #1359
Coreq PrismarineJS/minecraft-data#948