[PR #790] [MERGED] fix(server): move players to another dimension with execute in … run tp #2813

Closed
opened 2026-11-02 15:59:15 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/790
Author: @ludovic111
Created: 10/18/2026
Status: ✅ Merged
Merged: 10/18/2026
Merged by: @ludovic111

Base: main ← Head: fix/server-players-across-dimensions


📝 Commits (2)

  • 9a2d87e fix(server): move players to another dimension with execute in ... run tp
  • 4ac29bf docs(hosting): players travel between dimensions on their own

📊 Changes

10 files changed (+292 additions, -14 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+3 -0)
📝 crates/horizon-client/src/game/command_blocks.rs (+1 -0)
📝 crates/horizon-client/src/game/commands.rs (+16 -0)
📝 crates/horizon-client/src/game/commands/execute.rs (+7 -0)
📝 crates/horizon-client/src/game/lan_actions.rs (+2 -0)
📝 crates/horizon-client/src/game/server_travel.rs (+54 -1)
📝 crates/horizon-client/src/lan/hub.rs (+20 -7)
📝 docs/hosting.md (+5 -2)
📝 mods/horizon/src/test/java/dev/horizonlab/parity/LocatorBarClient.java (+34 -4)
➕ tools/test_server_dimension_players_parity.py (+150 -0)

📄 Description

🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself.

What

On a dedicated server, an operator running execute in minecraft:the_nether run tp @s 0 100 0 stayed in their own level: Horizon moved them inside it. This PR makes it work like vanilla's TeleportCommand, which calls ServerPlayer.teleport into the other level:

  • the Respawn packet keeps all data, then the usual packet order, with no portal sound (TeleportTransition.DO_NOTHING);
  • the command's feedback comes after the move;
  • players already in that level are tracked to the arriving player, and the players in the old level remove them.

Portal trips worked before this PR. They now go through the same change_level, which takes the portal sound and the pitch as arguments.

Proof

tools/test_server_dimension_players_parity.py (new) uses a vanilla 26.3 server and Horizon's --dedicated --nogui on the same flat world. Two vanilla-protocol players (LocatorBarClient) join. Bob goes to the Nether and back, Alice goes to the End, Bob follows her, both come back, then Bob walks into an End portal and returns. For each step, each player records the players it was sent (AddEntity) and lost (RemoveEntities), and the dimensions it respawned into.

  • On origin/main the run fails: no respawns, and no one is removed or added.
  • With this PR: server dimension players: 22 lines identical.

Changes to LocatorBarClient:

  • players on turns on these records.
  • still NAME sends the position reminder a client standing still sends every second, wrapped in ClientTickEnd like a real client. Without it, whether vanilla tracks an arriving player depends on timing: ChunkMap.move runs at the teleport ack, possibly before the chunk is sent.

Self-check: cargo fmt --check, cargo clippy -p horizon-client --all-targets -D warnings, cargo test -p horizon-client --lib lan:: commands (28 passed). tools/parity.py --changed origin/main results will be posted as a comment.

Notes

  • docs/hosting.md said portals don't move remote players with several online. That was written before the per-level server (server_travel.rs) merged, and the End portal leg of the harness shows it works. The line now describes what works and the console gap below.

  • #779 also edits LocatorBarClient (chat on|off). If one merges first, the other may get a small conflict in the script switch and the javadoc; I'll fix it in whichever PR is left.

  • The console still can't target another player with tp across dimensions (execute in … run tp Bob … from the console). Horizon's commands only target the player running them. That is a separate gap.

🤖 Generated with Claude Code


🔄 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/790 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/18/2026 **Status:** ✅ Merged **Merged:** 10/18/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/server-players-across-dimensions` --- ### 📝 Commits (2) - [`9a2d87e`](https://github.com/horizon-rust/horizon/commit/9a2d87ec9708d417d6fa4e19fa99110da8e78e39) fix(server): move players to another dimension with execute in ... run tp - [`4ac29bf`](https://github.com/horizon-rust/horizon/commit/4ac29bf1c14e7785fa1c33f5e0aceaaef0aa9c4c) docs(hosting): players travel between dimensions on their own ### 📊 Changes **10 files changed** (+292 additions, -14 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+3 -0) 📝 `crates/horizon-client/src/game/command_blocks.rs` (+1 -0) 📝 `crates/horizon-client/src/game/commands.rs` (+16 -0) 📝 `crates/horizon-client/src/game/commands/execute.rs` (+7 -0) 📝 `crates/horizon-client/src/game/lan_actions.rs` (+2 -0) 📝 `crates/horizon-client/src/game/server_travel.rs` (+54 -1) 📝 `crates/horizon-client/src/lan/hub.rs` (+20 -7) 📝 `docs/hosting.md` (+5 -2) 📝 `mods/horizon/src/test/java/dev/horizonlab/parity/LocatorBarClient.java` (+34 -4) ➕ `tools/test_server_dimension_players_parity.py` (+150 -0) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. ## What On a dedicated server, an operator running `execute in minecraft:the_nether run tp @s 0 100 0` stayed in their own level: Horizon moved them inside it. This PR makes it work like vanilla's `TeleportCommand`, which calls `ServerPlayer.teleport` into the other level: - the Respawn packet keeps all data, then the usual packet order, with **no** portal sound (`TeleportTransition.DO_NOTHING`); - the command's feedback comes after the move; - players already in that level are tracked to the arriving player, and the players in the old level remove them. Portal trips worked before this PR. They now go through the same `change_level`, which takes the portal sound and the pitch as arguments. ## Proof `tools/test_server_dimension_players_parity.py` (new) uses a vanilla 26.3 server and Horizon's `--dedicated --nogui` on the same flat world. Two vanilla-protocol players (LocatorBarClient) join. Bob goes to the Nether and back, Alice goes to the End, Bob follows her, both come back, then Bob walks into an End portal and returns. For each step, each player records the players it was sent (`AddEntity`) and lost (`RemoveEntities`), and the dimensions it respawned into. - On `origin/main` the run fails: no respawns, and no one is removed or added. - With this PR: `server dimension players: 22 lines identical`. Changes to LocatorBarClient: - `players on` turns on these records. - `still NAME` sends the position reminder a client standing still sends every second, wrapped in `ClientTickEnd` like a real client. Without it, whether vanilla tracks an arriving player depends on timing: `ChunkMap.move` runs at the teleport ack, possibly before the chunk is sent. Self-check: `cargo fmt --check`, `cargo clippy -p horizon-client --all-targets -D warnings`, `cargo test -p horizon-client --lib lan:: commands` (28 passed). `tools/parity.py --changed origin/main` results will be posted as a comment. ## Notes - docs/hosting.md said portals don't move remote players with several online. That was written before the per-level server (`server_travel.rs`) merged, and the End portal leg of the harness shows it works. The line now describes what works and the console gap below. - #779 also edits LocatorBarClient (`chat on|off`). If one merges first, the other may get a small conflict in the script `switch` and the javadoc; I'll fix it in whichever PR is left. - The console still can't target another player with `tp` across dimensions (`execute in … run tp Bob …` from the console). Horizon's commands only target the player running them. That is a separate gap. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 15:59:15 +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#2813
No description provided.