Send Client Information (settings) packet during configuration phase#1499
Send Client Information (settings) packet during configuration phase#1499AChompSitsIn wants to merge 2 commits into
Conversation
extremeheat
left a comment
There was a problem hiding this comment.
mineflayer on login does send its own settings, so sending them inside nmp can conflict with mineflayer's own settings.
How does this PR handle that?
| client.write('settings', { | ||
| locale: 'en_us', | ||
| viewDistance: 10, | ||
| chatFlags: 0, | ||
| chatColors: true, | ||
| skinParts: 127, | ||
| mainHand: 1, | ||
| enableTextFiltering: false, | ||
| enableServerListing: true | ||
| }) |
There was a problem hiding this comment.
These should be configurable parameters
|
Good points, thanks. On the conflict with mineflayer's settings: there isn't one. This mirrors the vanilla client, which sends Client Information in both the configuration and play phases. The config-phase send only exists to unblock servers (like Hypixel) that won't send On configurability: done. The values now come from a createClient({
// ...
clientSettings: { viewDistance: 4, locale: 'en_gb', mainHand: 0 } // any subset
})If you'd prefer, mineflayer can pass its Tested: lint, |
On 1.20.2+ the vanilla client sends Client Information (
settings) during theconfiguration phase; node-minecraft-protocol never does. Servers that gate
finish_configurationon it (e.g. Hypixel) never advance and drop the clientwith
socketClosedright afterlogin_acknowledged— so bots can't join on1.20.2–1.21.x.
Fix: write
settingsimmediately after theCONFIGURATIONstate flip inenterConfigState(inside the existinghasConfigurationStatebranch, so 1.20.2+only).
particleStatus(1.21.2+) is omitted so one payload serializes on everyconfig-phase version.
Supersedes #1402, which wrote the packet before the state flip (still
loginstate → serialization error → CI failed on exactly 1.20.2–1.21.4).
Tested: lint, serverTest (319), packet/cyclePacket (5983), and real-server
clientTest on 1.21.4 + 1.21.9 all pass. mineflayer joins Hypixel 1.21.9 with this
change;
socketClosedwithout.Fixes PrismarineJS/mineflayer#3623