settings: send particleStatus to the server - #4049
Merged
Merged
Conversation
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.
bot.settings.particleStatushas defaulted to'all'since the field was added, but thesettingspacket mineflayer writes on login never included it. On 1.21.3+ (particleStatusis a mapper:all/decreased/minimal) the field was serialized fromundefined. It only came out as0=allbecause protodef's compiled mapper falls an unmapped value through to the numeric type, whereNaNwrites as0; the interpreted mapper throws on the same input.ProtoDef-io/node-protodef#176 (merged, unreleased — latest protodef is 1.19.0 from 2025-04) makes the compiled mapper strict too, which turns this into a serialization error on every 1.21.3+ login. Send the field. The companion fix for node-minecraft-protocol's configuration-phase
settingsis PrismarineJS/node-minecraft-protocol#1519.No version gate needed: protodef containers only write the fields the version defines, so the extra property is ignored pre-1.21.3. Confirmed in minecraft-data —
packet_common_settingscarriesparticleStatusfrom 1.21.3 on, and 1.21.1 / 1.16.5 / 1.8.8 have no such field.This re-lands #4045, which was opened against the
ci/duration-commentbranch by mistake and merged there instead of into master, so the fix never reached master.Tests: no test can fail without this change on the current protodef. Serializing the 1.21.4
settingspacket both ways gives identical bytes (…000100withparticleStatusomitted and with'all'), while'minimal'writes02— the field is wired through correctly and is a no-op on the wire until protodef ships the strict mapper. Once it does, every existing 1.21.3+ external test exercises this (login would throw without it).Ran locally: internal suite 688 passing; external suite 51 passing on each of 1.16.5, 1.20.4 and 1.21.4; lint clean.