Add Velocity proxy support for 1.20.2+ configuration phase#3834
Add Velocity proxy support for 1.20.2+ configuration phase#3834plainprince wants to merge 4 commits into
Conversation
Fixes PrismarineJS#3764 This commit adds proper handling of the configuration phase introduced in Minecraft 1.20.2 and extended in 1.21+, which is required for server transfers via Velocity proxy. Changes: - New velocity plugin to manage configuration phase state - Modified physics plugin to block movement packets during configuration - Automatic resource pack acceptance during configuration phase - New examples demonstrating Velocity proxy connection and transfers The bot will no longer be kicked with 'Disconnected, while in configuration phase' errors during Velocity server transfers.
The velocity plugin was activating during the initial 1.20.2+ login configuration phase, which is already handled by node-minecraft-protocol. This caused duplicate finish_configuration packets and disabled physics during login, making the bot unable to spawn on 1.20.2+ servers. Changes: - Only activate configuration phase handling after first spawn - Remove duplicate finish_configuration write (minecraft-protocol handles it) - Remove redundant registry_data/select_known_packs listeners - Fix missing newlines at EOF (lint errors) - Fix object-shorthand lint warnings Co-authored-by: Cursor <cursoragent@cursor.com>
|
How can we add tests for this ? |
Consider setting up two new Paper servers and a Velocity proxy for testing. Then use /server paper2 and /server paper1 to switch between them and verify whether the bot gets kicked. |
|
Automated tests for Velocity proxy server transfers aren't feasible to add to CI because they require:
The current CI infrastructure only spins up a single vanilla Minecraft server per test run, with no proxy support. Setting up a multi-server + proxy environment would significantly increase CI complexity and runtime. This would need to be validated through manual testing with an actual Velocity proxy setup, or by adding dedicated integration test infrastructure that can orchestrate multiple servers and a proxy. |
1 similar comment
|
Automated tests for Velocity proxy server transfers aren't feasible to add to CI because they require:
The current CI infrastructure only spins up a single vanilla Minecraft server per test run, with no proxy support. Setting up a multi-server + proxy environment would significantly increase CI complexity and runtime. This would need to be validated through manual testing with an actual Velocity proxy setup, or by adding dedicated integration test infrastructure that can orchestrate multiple servers and a proxy. |
|
We should not have to do any special logic for mods if vanilla client works as is. It seems you are describing an issue in nmp that should be fixed there, not here |
Summary
Picks up #3786 by @StarWeizz and fixes the CI failures.
Adds a velocity plugin that handles the re-configuration phase during Velocity proxy server transfers (1.20.2+). Without this, the bot sends gameplay packets (movement, physics) during configuration, causing disconnections.
What the plugin does
CI fix
The original PR's velocity plugin was activating during the initial login configuration phase (which node-minecraft-protocol already handles), causing:
finish_configurationacknowledgement packetsFixed by only activating after the bot's first spawn -- the initial login configuration is left entirely to node-minecraft-protocol.
Other fixes
registry_data/select_known_packslisteners (minecraft-protocol handles these)Fixes #3764
Supersedes #3786
Test plan
Made with Cursor