Skip to content

fix(jumprun): debounce the mode switch and accidental stops - #421

Merged
TheMeinerLP merged 4 commits into
mainfrom
fix/jumprun-mode-switch-debounce
Oct 25, 2026
Merged

TheMeinerLP merged 4 commits into
mainfrom
fix/jumprun-mode-switch-debounce

Conversation

@TheMeinerLP

@TheMeinerLP TheMeinerLP commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Root causes

  1. Mode switch skips: one physical sneak + right-click can reach the jumprun item more than once (use-on-block packet, then the plain use-item packet), and each arrival cycled the mode. The hand is not the cause: the hotbar dispatches the stack of the hand that fired.
  2. Runs aborted at score 0 within seconds (94 ABORT runs in a week): use() toggles, so a double click or the follow-up use packet of a click on a real lobby block stopped the run.

Fix

  • Mode switch: further switch requests within 5 player ticks (250 ms) of a switch are ignored. The window runs from the switch, not from the ignored clicks.
  • Start grace: a started run ignores use for 20 ticks (1 s) after its start, reusing the suppressedUntil mechanism.
  • Run end clears click state: ending a run by any reason (abort, fall, death, return to spawn, leaving the instance, disconnect) removes its start grace and pending click state, so an earlier run can no longer refuse the next start within a second.
  • Block clicks: the plain use packet that follows a click on a real or fake block is ignored for 2 ticks only while a run is going on. Between runs a click on a lobby block does not affect the item, so the item still starts the run or switches the mode.
  • Time is the player tick counter, so Env tests drive it with env.tick().

Spec

OpenSpec change openspec/changes/jumprun-click-debounce (proposal fix(jumprun)). Its delta MODIFIES the requirements "Schwierigkeitsmodi" (every sneak click switches the mode, except within the 5-tick window after a switch) and "Laufende" (the item ends a run, except within the 20-tick start grace; block clicks during and outside a run), each with scenarios. The change is validated; its tasks are checked, and the last one is this PR.

Tests

  • Mode and stop tests now go through the lobby item (useItem, sneak use) instead of the module's toggle, so they exercise the use path.
  • New tests, observed red on their assertions before the fix:
    • a click on a lobby block followed by the item starts a run;
    • a click on a lobby block followed by a sneak use switches the mode;
    • a run ended by death or by returning to spawn inside the start grace does not block the next start.
  • Existing test kept green: a block placement during a run does not stop it.
  • F.I.R.S.T.: no sleeps or system time, a fresh fixture per test, ticks driven by fixture.tick / fixture.tickPastGrace, a fixed UUID in the leaver test.
  • ./gradlew spotlessApply and ./gradlew build are green locally.

https://claude.ai/code/session_01DWzXyozSMX1ngvbMZGLvwA

@TheMeinerLP
TheMeinerLP requested a review from a team as a code owner October 12, 2026 20:42
@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Test results

  447 files    447 suites   26m 21s ⏱️
3 351 tests 3 350 ✅ 1 💤 0 ❌
3 364 runs  3 363 ✅ 1 💤 0 ❌

Results for commit af01085.

♻️ This comment has been updated with latest results.

@TheMeinerLP
TheMeinerLP force-pushed the fix/jumprun-mode-switch-debounce branch from 173d5e4 to 177c3f8 Compare October 12, 2026 21:02
@TheMeinerLP TheMeinerLP changed the title fix(jumprun): debounce the mode switch fix(jumprun): debounce the mode switch and accidental stops Oct 12, 2026
@TheMeinerLP
TheMeinerLP force-pushed the fix/jumprun-mode-switch-debounce branch from 177c3f8 to 350f907 Compare October 17, 2026 16:36
The mode tests ended runs with the module's toggle, so nothing exercised
the use path they are about. They now end and switch through the lobby
item after the grace period. The tick loops and the random UUID of the
leaver test move to the fixture, which now has tick and tickPastGrace.

Claude-Session: https://claude.ai/code/session_01DWzXyozSMX1ngvbMZGLvwA
A block placement only suppresses the follow-up use while a run is
going on. Between runs the use after a click on a lobby block starts the
run or switches the mode, as the item itself would. Ending a run now
clears its start grace and pending click state whatever ended it, so a
restart right after a death or a return to spawn is not refused.

Four new click tests failed on their assertions before this change.

Claude-Session: https://claude.ai/code/session_01DWzXyozSMX1ngvbMZGLvwA
The mode switch debounce and the start grace of a run contradict the
sneak-click and item-toggle requirements of lobby-jumprun. The delta
states the 5 tick mode window, the 20 tick start grace, the 2 tick
follow-up of a block click during a run, and that the grace ends with
the run.

Claude-Session: https://claude.ai/code/session_01DWzXyozSMX1ngvbMZGLvwA
@TheMeinerLP
TheMeinerLP force-pushed the fix/jumprun-mode-switch-debounce branch from 350f907 to af01085 Compare October 25, 2026 09:10
@TheMeinerLP
TheMeinerLP merged commit 7f40115 into main Oct 25, 2026
9 checks passed
@TheMeinerLP
TheMeinerLP deleted the fix/jumprun-mode-switch-debounce branch October 25, 2026 09:15
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.

1 participant