Skip to content

fix(movement): release prediction wait after server teleport - #480

Open
AlexProgrammerDE wants to merge 1 commit into
ViaVersionAddons:mainfrom
StackAnvil:stackanvil/0062-release-prediction-wait-after-server-teleport
Open

AlexProgrammerDE wants to merge 1 commit into
ViaVersionAddons:mainfrom
StackAnvil:stackanvil/0062-release-prediction-wait-after-server-teleport

Conversation

@AlexProgrammerDE

Copy link
Copy Markdown
Collaborator

When a server teleport replaces a pending local chunk-boundary correction, its acknowledgement can leave the prediction wait set indefinitely and freeze subsequent movement. Clear that wait when the current position sync is acknowledged, and compare the exact signed Java teleport ID so stale, duplicate, zero, and wrong-sign acknowledgements cannot complete it.

Keep the latest authoritative teleport separate from a newer local correction. Its acknowledgement still reports HandledTeleport once, but cannot release the newer correction or grant its movement exception. Each new position sync also retires any unused exception from the previous teleport.

Validation against pinned upstream main da6391a:

  • Passed: bun run pr check viabedrock --patch 0062-release-prediction-wait-after-server-teleport.patch.
  • Passed: bun run pr build viabedrock --patch 0062-release-prediction-wait-after-server-teleport.patch (upstream clean build on Java 25; Java 17 language/toolchain baseline unchanged).
  • Main and tool Checkstyle reports contain zero violations. Production-only assertion and git diff --check passed.
  • One production commit changes only ClientPlayerEntity.java. Local tests and test configuration are excluded. The saved stack has regression coverage for overlapping teleports and acknowledgement IDs; those tests and native gameplay checks were not rerun for this PR.

A chunk boundary correction waits for its fake Java teleport acknowledgement. If a real server teleport supersedes that correction, the old acknowledgement no longer matches the pending ID. Previously the real acknowledgement admitted only one position packet and left the correction wait set forever, freezing subsequent server movement.

Clear the prediction wait when the current authoritative teleport is acknowledged. Preserve stale-ID protection and the HandledTeleport signal. The regression test covers a pending local correction replaced by a server teleport, stale acknowledgements, and the final matching acknowledgement.

Track the exact signed Java teleport ID. Ignore stale, duplicate, zero,
and opposite-sign acknowledgements before changing prediction wait or
reporting HandledTeleport. Only the current authoritative acknowledgement
can grant the post-teleport movement exception. The tests cover replacement
by a server teleport and wrong-sign acknowledgements for local corrections.

Keep the latest server teleport identity separate from the pending local
position sync. A later local correction must not retire the server
acknowledgement, and that acknowledgement must not unlock the newer
local correction or grant its position exception.
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.

3 participants