fix(input): use Bedrock local axes for strafing - #429
Closed
AlexProgrammerDE wants to merge 1 commit into
Closed
AlexProgrammerDE wants to merge 1 commit into
AlexProgrammerDE wants to merge 1 commit into
Conversation
Bedrock defines left as negative local X and right as positive local X. The bridge sent the opposite move vector while its direction flags used the correct side, causing server movement corrections during strafing.
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.
Why
Mojang documents local left as negative X and right as positive X in the Player Auth Input changelog. The bridge currently sends the opposite signs in both movement vectors while setting the corresponding left/right input flags. This makes the packet's vector disagree with its flags.
Change
Use negative X for left and positive X for right when constructing the move vector and raw move vector.
Protocol version note
The published 1.26.51 input enum labels its build
1.26.51-beta.1and listsUp=9. The 1.26.60 beta input enum listsUp=10, which matches the running1.26.51.1dedicated server. The same discrepancy appears in player actions. All 63 existing input flag values and all 35 existing player action values match enums extracted from that server build. This PR changes only the local move vector sign.Verification and limit
./gradlew test checkstyleMainpasses. On the local Bedrock 1.26.51.1 server, both the original and changed signs allowed W/S/A/D movement without visible snapback. With the original sign, a diagnostic run recorded sixCorrectPlayerMovePredictionpackets while the tester was an operator in creative mode. This confirms the server sends corrections, but the test does not show that the sign change reduces them. The earlier severe snapback stopped after restoring the server's actual input enum values, so this PR should be reviewed as a protocol consistency fix rather than a proven fix for that symptom.