[PR #1733] [MERGED] /tp: dismount players before teleporting #3727

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

📋 Pull Request Information

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

Base: main ← Head: t3/d8cfe14b


📝 Commits (2)

  • 5d19fca Dismount players before command teleports
  • d30be3d Merge main into t3/d8cfe14b: keep both sides' appended checks

📊 Changes

3 files changed (+100 additions, -0 deletions)

View changed files

📝 crates/horizon-client/src/game/commands.rs (+2 -0)
📝 tools/command_exec_corpus.py (+31 -0)
📝 tools/lan_e2e.py (+67 -0)

📄 Description

🤖 Opened by rdbt's AI agent (OpenCode, gpt-6.1-sol), not by rdbt himself.

What and why

Fixes #1473.

The player branch of teleport_to now calls the existing stop_riding() handler before setting the destination. This clears the riding relationship and the vehicle's rider state, and applies the destination after the dismount handler's beside-the-vehicle positioning. The following riding tick can no longer return the player to the horse.

Guest targets use the same player teleport path through for_player.

Regression coverage:

  • Extend command_exec with 36 comparisons covering absolute coordinates, relative horizontal coordinates, teleporting to an entity, invalid destinations preserving the mount, and the player/horse positions and riding relationship after 60 ticks.
  • Add lan_e2e's riding_teleport check: saddle and mount a horse with real right clicks, submit /tp through chat for the host and guest, and teleport a mounted guest by name from the host. Check dismounting, the destination on both client and server, and the horse left behind on both clients after 60 ticks.

Vanilla reference

Minecraft Java Edition 26.3:

  • TeleportCommand.performTeleport validates the destination and calls Entity.teleportTo.
  • Entity.teleportTo constructs the teleport transition.
  • ServerPlayer.teleport(TeleportTransition) calls removeVehicle when the transition is not as a passenger, before applying the destination through the player's connection.

Read the first two methods with tools/rea_vanilla.py --jar server-game; inspected ServerPlayer.teleport with javap -c -p because REA did not recover its body. The command_exec harness compares the new cases against the real pinned server jar.

Verification

The new end-to-end check reproduced the original bug on the unmodified game binary in both singleplayer modes: the command reported success, but the player was still riding at the horse's seat after 60 ticks.

Check Result
Full command_exec parity suite 824/824 commands match vanilla, including all 36 new comparisons
lan_e2e riding_teleport, in-frame host PASS: host chat, guest chat, host teleporting a mounted guest
lan_e2e riding_teleport, server-thread host PASS: host chat, guest chat, host teleporting a mounted guest

Both LAN runs used offscreen clients and fresh scratch homes. The check records before/after screenshots for every case in its --out directory.

One preceding full command-suite run differed only on /random reset * (11 versus 12 random sequences); a fresh rerun matched all 824 commands. All 36 riding-teleport comparisons matched on both runs.

The initial self-check found a missing local prepared-data report, registries.json. A worktree-local resource overlay supplied the existing pinned vanilla datagen report, and the complete self-check then passed:

The final checks used a worktree-local TMPDIR after a rerun exceeded the machine's system temporary-directory quota.

Self-check

pr_ready (tools/pr_ready.py --quick on archlinux, against origin/main at f2f58aca9, 4 min 4 s)

Check Result
Scope ✅ 3 files, +100 −0
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 252 passed (28 s)
rustfmt ✅ (9 s)
clippy ✅ (1 s)
tests: horizon-client ✅ 1201 passed (2 min 50 s)
doc tests ✅ 0 passed (10 s)
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ 84 affected, to run in CI (--quick): arrow, block_removal, command_exec, composter, crafter, dedicated_server, dispenser, locator_bar, mace, online_mode, save_roundtrip, sculk and 72 more
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

🤖 Generated with OpenCode (gpt-6.1-sol).


🔄 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/1733 **Author:** [@rdbtCVS](https://github.com/rdbtCVS) **Created:** 10/25/2026 **Status:** ✅ Merged **Merged:** 10/25/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `t3/d8cfe14b` --- ### 📝 Commits (2) - [`5d19fca`](https://github.com/horizon-rust/horizon/commit/5d19fcaa06c5c797d92e05d4f0176091025fbe41) Dismount players before command teleports - [`d30be3d`](https://github.com/horizon-rust/horizon/commit/d30be3d9941a4f58d9b55e02073cc76bd5340dfe) Merge main into t3/d8cfe14b: keep both sides' appended checks ### 📊 Changes **3 files changed** (+100 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/commands.rs` (+2 -0) 📝 `tools/command_exec_corpus.py` (+31 -0) 📝 `tools/lan_e2e.py` (+67 -0) </details> ### 📄 Description > 🤖 Opened by rdbt's AI agent (OpenCode, gpt-6.1-sol), not by rdbt himself. ## What and why Fixes #1473. The player branch of `teleport_to` now calls the existing `stop_riding()` handler before setting the destination. This clears the riding relationship and the vehicle's rider state, and applies the destination after the dismount handler's beside-the-vehicle positioning. The following riding tick can no longer return the player to the horse. Guest targets use the same player teleport path through `for_player`. Regression coverage: - Extend `command_exec` with 36 comparisons covering absolute coordinates, relative horizontal coordinates, teleporting to an entity, invalid destinations preserving the mount, and the player/horse positions and riding relationship after 60 ticks. - Add `lan_e2e`'s `riding_teleport` check: saddle and mount a horse with real right clicks, submit `/tp` through chat for the host and guest, and teleport a mounted guest by name from the host. Check dismounting, the destination on both client and server, and the horse left behind on both clients after 60 ticks. ## Vanilla reference Minecraft Java Edition 26.3: - `TeleportCommand.performTeleport` validates the destination and calls `Entity.teleportTo`. - `Entity.teleportTo` constructs the teleport transition. - `ServerPlayer.teleport(TeleportTransition)` calls `removeVehicle` when the transition is not as a passenger, before applying the destination through the player's connection. Read the first two methods with `tools/rea_vanilla.py --jar server-game`; inspected `ServerPlayer.teleport` with `javap -c -p` because REA did not recover its body. The `command_exec` harness compares the new cases against the real pinned server jar. ## Verification The new end-to-end check reproduced the original bug on the unmodified game binary in both singleplayer modes: the command reported success, but the player was still riding at the horse's seat after 60 ticks. | Check | Result | | --- | --- | | Full `command_exec` parity suite | 824/824 commands match vanilla, including all 36 new comparisons | | `lan_e2e` `riding_teleport`, in-frame host | PASS: host chat, guest chat, host teleporting a mounted guest | | `lan_e2e` `riding_teleport`, server-thread host | PASS: host chat, guest chat, host teleporting a mounted guest | Both LAN runs used offscreen clients and fresh scratch homes. The check records before/after screenshots for every case in its `--out` directory. One preceding full command-suite run differed only on `/random reset *` (11 versus 12 random sequences); a fresh rerun matched all 824 commands. All 36 riding-teleport comparisons matched on both runs. The initial self-check found a missing local prepared-data report, `registries.json`. A worktree-local resource overlay supplied the existing pinned vanilla datagen report, and the complete self-check then passed: The final checks used a worktree-local `TMPDIR` after a rerun exceeded the machine's system temporary-directory quota. ## Self-check **pr_ready** (`tools/pr_ready.py --quick` on archlinux, against origin/main at f2f58aca9, 4 min 4 s) | Check | Result | | --- | --- | | Scope | ✅ 3 files, +100 −0 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 252 passed (28 s) | | rustfmt | ✅ (9 s) | | clippy | ✅ (1 s) | | tests: horizon-client | ✅ 1201 passed (2 min 50 s) | | doc tests | ✅ 0 passed (10 s) | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ 84 affected, to run in CI (--quick): arrow, block_removal, command_exec, composter, crafter, dedicated_server, dispenser, locator_bar, mace, online_mode, save_roundtrip, sculk and 72 more | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | 🤖 Generated with [OpenCode](https://opencode.ai) (gpt-6.1-sol). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:11:46 +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#3727
No description provided.