[PR #1183] [MERGED] Ender pearls: a server always sends the thrower the teleport #3395

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

📋 Pull Request Information

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

Base: main ← Head: fix/pearl-teleport-packet


📝 Commits (1)

  • 743cc8e Ender pearls: a server always sends the thrower the teleport

📊 Changes

3 files changed (+20 additions, -6 deletions)

View changed files

📝 crates/horizon-client/src/game/creatures.rs (+11 -4)
📝 crates/horizon-client/src/game/lan_actions.rs (+4 -2)
📝 crates/horizon-client/src/motion.rs (+5 -0)

📄 Description

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

What

An ender pearl now teleports its thrower the way vanilla's server does, so a guest always gets the position packet.

  • ThrownEnderpearl.onHit moves the owner to oldPosition() (where the pearl started its last tick) with ServerPlayer.teleport, and that always sends the position packet, whatever the distance. Horizon used the hit point instead.
  • leave_guest sent a teleport only when the guest moved more than 0.01 blocks or turned. A pearl thrown at one's feet often lands within that distance, so no packet went out.
  • The pearl now uses the previous position and sets PlayerMotion.teleported. The end of the guest's turn sends the teleport when that flag is set, even if the player stays put.
  • /rotate keeps going through teleport_to without the flag, because vanilla sends it as a rotation, not a teleport.

Why

This is flakes-1 flake 1. dedicated_server play-pearl reported teleported 0 time(s) where vanilla's server sends 1, in about one run in four on the desktop (2 of 4 failed in the baseline).

How tested

  • cargo fmt --check: OK
  • cargo clippy --workspace --all-targets -- -D warnings: exit 0
  • cargo test -p horizon-client: all passed
  • tools/parity.py dedicated_server --repeat 10 --fresh under load on the desktop: Horizon never reported "teleported 0" in any of the 10 runs. The remaining failures in those runs were other modes, all timing waits on the oracle side: the villager not seen yet, the off-hand snowball, and the furnace slow on vanilla. The stacked PR (dedicated_server waits) fixes those.

Needs Ludovic

Nothing.

🤖 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/1183 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/22/2026 **Status:** ✅ Merged **Merged:** 10/22/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/pearl-teleport-packet` --- ### 📝 Commits (1) - [`743cc8e`](https://github.com/horizon-rust/horizon/commit/743cc8e0696e4d54fc2a9f2f3564dc89a119287f) Ender pearls: a server always sends the thrower the teleport ### 📊 Changes **3 files changed** (+20 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/creatures.rs` (+11 -4) 📝 `crates/horizon-client/src/game/lan_actions.rs` (+4 -2) 📝 `crates/horizon-client/src/motion.rs` (+5 -0) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. ## What An ender pearl now teleports its thrower the way vanilla's server does, so a guest always gets the position packet. - `ThrownEnderpearl.onHit` moves the owner to `oldPosition()` (where the pearl started its last tick) with `ServerPlayer.teleport`, and that always sends the position packet, whatever the distance. Horizon used the hit point instead. - `leave_guest` sent a teleport only when the guest moved more than 0.01 blocks or turned. A pearl thrown at one's feet often lands within that distance, so no packet went out. - The pearl now uses the previous position and sets `PlayerMotion.teleported`. The end of the guest's turn sends the teleport when that flag is set, even if the player stays put. - `/rotate` keeps going through `teleport_to` without the flag, because vanilla sends it as a rotation, not a teleport. ## Why This is flakes-1 flake 1. `dedicated_server` play-pearl reported `teleported 0 time(s)` where vanilla's server sends 1, in about one run in four on the desktop (2 of 4 failed in the baseline). ## How tested - `cargo fmt --check`: OK - `cargo clippy --workspace --all-targets -- -D warnings`: exit 0 - `cargo test -p horizon-client`: all passed - `tools/parity.py dedicated_server --repeat 10 --fresh` under load on the desktop: Horizon never reported "teleported 0" in any of the 10 runs. The remaining failures in those runs were other modes, all timing waits on the oracle side: the villager not seen yet, the off-hand snowball, and the furnace slow on vanilla. The stacked PR (dedicated_server waits) fixes those. ## Needs Ludovic Nothing. 🤖 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-03 04:09:14 +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#3395
No description provided.