Fix Soul Speed + Swift Sneak simulation false positive on 1.21+#2606
Open
Szabolcs05 wants to merge 1 commit into
Open
Fix Soul Speed + Swift Sneak simulation false positive on 1.21+#2606Szabolcs05 wants to merge 1 commit into
Szabolcs05 wants to merge 1 commit into
Conversation
On 1.21+, Soul Speed uses a location_changed enchantment effect that sets movement_efficiency to 1.0 client-side immediately when stepping on soul speed blocks. GrimAC relied on the server-sent UPDATE_ATTRIBUTES packet for this value, which arrives with latency. During bridging (sneaking + placing blocks over soul sand), the constant block position changes caused the attribute updates to lag behind the client's local state, resulting in continuous simulation false positives. The fix removes the 1.21 version gate in getBlockSpeedFactor so Soul Speed is checked directly from the player's boots inventory for all 1.16.2+ clients, matching the client's local behavior.
Contributor
|
does this break if soul_speed.json is changed? |
Contributor
|
This is incorrect. This behaviour has changed at some point. |
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.
Description
Fixes continuous simulation false positives when a player with Swift Sneak 3 leggings and Soul Speed 3 boots is sneaking and bridging over soul sand/soul soil on 1.21+ servers.
Root Cause
In vanilla 1.21+, Soul Speed is a location_changed enchantment effect (soul_speed.json). When the player steps on a soul speed block, the client applies the movement_efficiency = 1.0 modifier locally and immediately. However, the server sends the UPDATE_ATTRIBUTES packet asynchronously.
GrimAC's getBlockSpeedFactor for 1.21+ clients deferred to the MOVEMENT_EFFICIENCY attribute (via getModernVelocityMultiplier), relying on the server-sent value. During bridging where block position changes constantly the attribute updates lagged behind the client's local state, causing GrimAC to predict with movement_efficiency = 0 (soul sand slowdown) while the client used 1.0 (no slowdown).
Fix
Removed the V_1_21 version gate in getBlockSpeedFactor so Soul Speed is checked directly from the player's boots inventory for all 1.16.2+ clients, matching the client's local behavior and avoiding the attribute timing desync.
Testing