Skip to content

1.21.1-NF: vault no longer cancels fast run#485

Open
erutobusiness wants to merge 1 commit into
alRex-U:1.21.1-NFfrom
erutobusiness:fix/fastrun-stops-after-vault
Open

1.21.1-NF: vault no longer cancels fast run#485
erutobusiness wants to merge 1 commit into
alRex-U:1.21.1-NFfrom
erutobusiness:fix/fastrun-stops-after-vault

Conversation

@erutobusiness

@erutobusiness erutobusiness commented Jun 4, 2026

Copy link
Copy Markdown

Vaulting over obstacles cancels vanilla sprint due to horizontal block collision in the first couple ticks of the vault animation. Since FastRun.canContinue() requires player.isSprinting(), this caused fast run to stop mid-vault, leaving the player walking after the vault completes.

The fix registers a sprint cancel marker in Vault.onStartInLocalClient so that the LivingEntityMixin setSprinting hook blocks vanilla's cancellation for the duration of the vault. This is the same pattern already used by RideZipline.

When vaulting, vanilla Minecraft cancels the sprint state due to the
horizontal block collision in the first 1-2 ticks of the vault
animation. This causes FastRun.canContinue() to fail (it requires
player.isSprinting()), stopping the fast run mid-vault.

Register a sprint cancel marker in Vault.onStartInLocalClient so that
the LivingEntityMixin setSprinting hook blocks vanilla's cancellation
for the duration of the vault (marker remains while isDoing() is true).
This follows the same pattern already used by RideZipline.
@erutobusiness erutobusiness changed the title fix: prevent sprint cancellation during Vault to preserve FastRun 1.21.1-NF: vault no longer cancels fast run Jun 4, 2026
@alRex-U

alRex-U commented Jun 28, 2026

Copy link
Copy Markdown
Owner

If I remember correctly addMarkerCancellingSprint will stops sprint always?
Anyway currently I'm working on v4 update on v1.19.2 branch, it overwrite most of basic system.
Please let me put off merging

@erutobusiness

Copy link
Copy Markdown
Author

Thanks for looking at it, and no rush at all on merging!

You're right that in RideZipline addMarkerCancellingSprint is used to keep sprint off — but that's because it's paired with an explicit setSprinting(false) right before the marker (RideZipline#onStartInLocalClient). The marker itself doesn't force sprint off: in LivingEntityMixin.onSetSprinting it only cancels the setSprinting() call (ci.cancel() at HEAD), so it just freezes whatever the current sprint state is.

In this PR I register the marker without calling setSprinting(false) first, so during a vault — where the player is already sprinting for fast run — it holds the sprint on and blocks vanilla's collision-triggered setSprinting(false) for the couple of ticks the vault lasts. So it's the same enforcer, just relied on to hold the current state instead of to suppress sprint.

If you'd rather not reuse the marker in the opposite direction like this, I'm open to a different approach — just let me know what fits ParCool best.

And totally fine to put off merging. Since the v4 rewrite on 1.19.2 reworks most of the basic system (and will flow up into this branch), please take your time. Once v4 is ready I'm happy to rebase or reimplement this on top of the new system, so just tell me if the fast-run-after-vault behavior still needs attention then.

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