Skip to content

settings: send particleStatus to the server - #4045

Merged
rom1504 merged 2 commits into
ci/duration-commentfrom
fix/settings-particle-status
Sep 4, 2026
Merged

settings: send particleStatus to the server#4045
rom1504 merged 2 commits into
ci/duration-commentfrom
fix/settings-particle-status

Conversation

@u9g

@u9g u9g commented Sep 2, 2026

Copy link
Copy Markdown
Member

bot.settings.particleStatus has defaulted to 'all' since the field was added, but the settings packet mineflayer writes on login never included it. On 1.21.3+ (particleStatus is a mapper: all / decreased / minimal) the field was serialized from undefined. It only came out as 0 = all because protodef's compiled mapper falls an unmapped value through to the numeric type, where NaN writes as 0; the interpreted mapper throws on the same input.

ProtoDef-io/node-protodef#176 makes the compiled mapper strict too (throw on a value not in the mappings), 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 settings is 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.

Tests: no test can fail without this change today — with the current protodef the bytes on the wire are identical (undefined0all). Once protodef#176 lands, every existing 1.21.3+ external test exercises it (login would throw without it). Ran locally: internal suite (688 passing, all versions), external chat on 1.8.8, 1.16.5 and 1.21.8, lint clean.

@rom1504

rom1504 commented Sep 4, 2026

Copy link
Copy Markdown
Member

CI fails

@u9g
u9g force-pushed the fix/settings-particle-status branch from 8634a4b to c657bf3 Compare September 4, 2026 12:15
Test durations are too noisy for a hard gate: fishing and nether vary by
2-3x between identical runs, and master itself is failing the 1.5x check.
Keep the comparison, but post the slower tests as a PR comment instead.

Fork PRs run CI with a read-only token, so the matrix jobs upload the
slower tests as an artifact and a workflow_run job posts (or updates) the
comment. The PR number travels in the artifact because
workflow_run.pull_requests is empty for forks.

Mineflayer-Review-Complete: Done
bot.settings has defaulted particleStatus to 'all' since the field was added,
but the settings packet never included it, so on 1.21.3+ the mapper was
serialized from `undefined`. It only came out as 0 ("all") because the
compiled protodef mapper falls unmapped values through to the numeric type,
where NaN writes as 0; ProtoDef-io/node-protodef is making that a
serialization error, which would break every 1.21.3+ login. Send the field.

Mineflayer-Review-Complete: Done
@u9g
u9g force-pushed the fix/settings-particle-status branch from c657bf3 to 6c45ee6 Compare September 4, 2026 12:29
@u9g
u9g changed the base branch from master to ci/duration-comment September 4, 2026 12:29
@rom1504
rom1504 merged commit 6204bc3 into ci/duration-comment Sep 4, 2026
12 checks passed
@u9g
u9g deleted the fix/settings-particle-status branch September 4, 2026 19:22
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.

2 participants