Skip to content

Comments

Fixes to protocol Holder implementation#1355

Merged
rom1504 merged 18 commits intoPrismarineJS:masterfrom
extremeheat:20updates
Jul 1, 2025
Merged

Fixes to protocol Holder implementation#1355
rom1504 merged 18 commits intoPrismarineJS:masterfrom
extremeheat:20updates

Conversation

@extremeheat
Copy link
Member

@extremeheat extremeheat commented Dec 5, 2024

@extremeheat extremeheat changed the title Updates Remove numeric and flag types now in protodef Dec 22, 2024
@rom1504
Copy link
Member

rom1504 commented Jan 4, 2025

this still fails

@extremeheat extremeheat marked this pull request as draft January 5, 2025 21:31
@extremeheat extremeheat marked this pull request as ready for review June 29, 2025 11:08
@extremeheat extremeheat marked this pull request as draft June 29, 2025 11:08
@extremeheat
Copy link
Member Author

Next is to finish this PR and update mineflayer

@extremeheat extremeheat marked this pull request as ready for review June 29, 2025 21:59
@extremeheat extremeheat requested a review from Copilot June 29, 2025 21:59
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 arrayWithLengthOffset and bitflag compiler routines from src/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

@rom1504
Copy link
Member

rom1504 commented Jun 30, 2025

Looks like tests are passing. Next step the mineflayer side PR?

@extremeheat extremeheat changed the title Remove numeric and flag types now in protodef Fixes to protocol Holder implementation Jun 30, 2025
@rom1504 rom1504 merged commit 7207b61 into PrismarineJS:master Jul 1, 2025
28 checks passed
@rom1504
Copy link
Member

rom1504 commented Jul 1, 2025

/makerelease

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TypeError: Client.chat is not a function

2 participants