[PR #1975] [MERGED] Drop a pending server trip when its player is teleported within the level #3904

Closed
opened 2026-11-03 04:13:08 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/1975
Author: @kacpherek
Created: 10/25/2026
Status: ✅ Merged
Merged: 10/26/2026
Merged by: @ludovic111

Base: main ← Head: fix/1523-tp-during-arrival


📝 Commits (1)

  • f988ed4 Drop a pending server trip when its player is teleported within the level

📊 Changes

2 files changed (+11 additions, -0 deletions)

View changed files

📝 crates/horizon-client/src/game/commands.rs (+6 -0)
📝 tools/test_server_dimension_players_parity.py (+5 -0)

📄 Description

Fixes #1523.

What and why

On the server thread a player sent into another level waits on a trip until the chunks around its target
load; until then the server leaves its body alone and tick_server_travel skips its portal checks. A /tp
within the level while that arrival was still loading left the trip behind. Its target lost its loading
tickets, so the trip never finished, and Nether portals, End portals and End gateways stopped taking the
player until they went back to the abandoned spot and waited for it to load.

ServerPlayer.teleport within a level places the player at once, so a same-level teleport of a server's
player (teleport_to for the acting player in commands.rs) now drops the player's pending trip. A
teleport into another level already replaced it (run_level_teleports).

Vanilla reference

ServerPlayer.teleport (same level: connection.teleport, nothing pending), TeleportCommand,
Entity.handlePortal.

Harness: tools/test_server_dimension_players_parity.py gains three steps. Bob is sent to the Nether at
x=8192 and teleported back to the origin before the far chunks load, then steps into an End portal there,
then comes back by command.

  • Without the fix (new steps only): transcripts differ, horizon is missing
    Bob step=bob-retarget-portal respawn minecraft:the_end
  • With the fix: server dimension players: 50 lines identical

In game (release build, fresh world): /execute in minecraft:the_nether run tp @s 8192.5 100 0.5, then at
once /tp @s 0.5 100 0.5, then /setblock 0 101 3 minecraft:end_portal and /tp @s 0.5 101 3.5. Server
thread (default): the player ends up in the End at 100.5 49 0.5. --in-frame: same result (that path has
no trips and was already fine).

Self-check

I did not paste a tools/pr_ready.py block: I work on Windows, where tools/parity.py cannot run (it needs
fcntl) and three horizon-client tests fail on upstream/main as well
(crash::tests::stacks_start_at_the_panicking_frame,
packs::cache::tests::directory_inputs_config_and_owned_output_recovery,
save::tests::session_lock_is_exclusive). cargo fmt --all -- --check passes; CI runs clippy and the
tests on Linux, and the harnesses above were run one by one (python tools/test_<name>_parity.py).


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/1975 **Author:** [@kacpherek](https://github.com/kacpherek) **Created:** 10/25/2026 **Status:** ✅ Merged **Merged:** 10/26/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/1523-tp-during-arrival` --- ### 📝 Commits (1) - [`f988ed4`](https://github.com/horizon-rust/horizon/commit/f988ed417a70f61f285cadf00cc627afb56a0128) Drop a pending server trip when its player is teleported within the level ### 📊 Changes **2 files changed** (+11 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/commands.rs` (+6 -0) 📝 `tools/test_server_dimension_players_parity.py` (+5 -0) </details> ### 📄 Description Fixes #1523. ## What and why On the server thread a player sent into another level waits on a trip until the chunks around its target load; until then the server leaves its body alone and `tick_server_travel` skips its portal checks. A `/tp` within the level while that arrival was still loading left the trip behind. Its target lost its loading tickets, so the trip never finished, and Nether portals, End portals and End gateways stopped taking the player until they went back to the abandoned spot and waited for it to load. `ServerPlayer.teleport` within a level places the player at once, so a same-level teleport of a server's player (`teleport_to` for the acting player in `commands.rs`) now drops the player's pending trip. A teleport into another level already replaced it (`run_level_teleports`). ## Vanilla reference `ServerPlayer.teleport` (same level: `connection.teleport`, nothing pending), `TeleportCommand`, `Entity.handlePortal`. Harness: `tools/test_server_dimension_players_parity.py` gains three steps. Bob is sent to the Nether at x=8192 and teleported back to the origin before the far chunks load, then steps into an End portal there, then comes back by command. - Without the fix (new steps only): `transcripts differ`, horizon is missing `Bob step=bob-retarget-portal respawn minecraft:the_end` - With the fix: `server dimension players: 50 lines identical` In game (release build, fresh world): `/execute in minecraft:the_nether run tp @s 8192.5 100 0.5`, then at once `/tp @s 0.5 100 0.5`, then `/setblock 0 101 3 minecraft:end_portal` and `/tp @s 0.5 101 3.5`. Server thread (default): the player ends up in the End at 100.5 49 0.5. `--in-frame`: same result (that path has no trips and was already fine). ## Self-check I did not paste a `tools/pr_ready.py` block: I work on Windows, where `tools/parity.py` cannot run (it needs `fcntl`) and three horizon-client tests fail on upstream/main as well (`crash::tests::stacks_start_at_the_panicking_frame`, `packs::cache::tests::directory_inputs_config_and_owned_output_recovery`, `save::tests::session_lock_is_exclusive`). `cargo fmt --all -- --check` passes; CI runs clippy and the tests on Linux, and the harnesses above were run one by one (`python tools/test_<name>_parity.py`). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:13:08 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#3904
No description provided.