[PR #3329] [MERGED] Carry a rider through a Nether portal on its vehicle (Supersedes #2691) #4906

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

📋 Pull Request Information

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

Base: main ← Head: fix/portal-rider-vehicle-timer


📝 Commits (6)

  • 33e81f4 Keep a rider with the vehicle it rides through a portal
  • 44850bd Merge upstream/main into the portal rider travel branch
  • 7e68f1e Remove the duplicate rabbit arm in entity_nbt
  • 42be301 Merge origin/main into the portal rider travel branch
  • 9ff0d98 Let the vehicle take its riders through a portal at once
  • 74c2d13 Merge origin/main into the portal rider travel branch

📊 Changes

6 files changed (+394 additions, -12 deletions)

View changed files

📝 crates/horizon-client/src/entity_nbt.rs (+1 -0)
📝 crates/horizon-client/src/game/lan_vehicles.rs (+8 -0)
📝 crates/horizon-client/src/game/levels.rs (+35 -4)
📝 crates/horizon-client/src/game/nether_portal.rs (+57 -4)
📝 crates/horizon-client/src/game/server_travel.rs (+211 -4)
📝 tools/lan_e2e.py (+82 -0)

📄 Description

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

Supersedes #2691 by @levzzz5154, who found and fixed the core of #1486; Ludovic asked us to take it over after it went quiet with conflicts. Their three commits are kept as they were, and the commits added here carry Co-Authored-By: levzzz5154. Thank you, levzzz!

What and why

On a server thread (single player's default path, LAN guests, dedicated servers), riding a horse into a Nether portal left the player in the Nether on foot. The horse went through on its own as an entity (saved, restored with a new id) while the player travelled alone, so the ride broke (#1486).

From #2691 (levzzz5154): the trip carries the vehicle the player rides. When the trip arrives, the vehicle moves from the source level to the destination with the same entity id, UUID and loaded compound, stands where its rider arrives, and gets Entity.setPortalCooldown. The ride is never broken.

Added here (the open review change): in vanilla the vehicle uses the portal and carries its rider at once. #2691 still let the rider's own timer decide, so a survival rider waited 80 ticks (4 s). Now:

  • a server player who rides starts no Nether or End portal process (Entity.canUsePortal(false) is false for a passenger, and NetherPortalBlock.entityInside / EndPortalBlock.entityInside skip it);
  • on a server, a horse, boat or minecart ridden only by server players uses the entity portal path. Its transition time is 0 (NetherPortalBlock.getPortalTransitionTime returns 0 for anything that isn't a Player), so it goes through on the next tick. Once through, each rider's trip starts with the vehicle (carry_riders_through_portals → start_server_trip, the plan computed from the vehicle's own position and size, as getPortalDestination(level, vehicle));
  • out of the End, every rider must have seen the credits (Entity.canTeleport);
  • the level the vehicle waits in is not closed as idle until the vehicle has moved;
  • where players can't change level (an in-frame LAN host), a ridden vehicle no longer goes through on its own and leaves its rider behind.

Merged with main (conflicts in levels.rs, nether_portal.rs, server_travel.rs: main's set_portal_cooldown(id) from #2352, the world spawn trip from #2355, leash knot ids from #2123).

Fixes #1486

Vanilla reference (26.3 bytecode, tools/rea_vanilla.py)

  • Entity.canUsePortal(boolean): (ignorePassenger || !isPassenger()) && isAlive(); LivingEntity adds !isSleeping().
  • NetherPortalBlock.entityInside: if (entity.canUsePortal(false)) entity.setAsInsidePortal(this, pos).
  • NetherPortalBlock.getPortalTransitionTime: the player game rule delays for a Player, else 0.
  • PortalProcessor.processPortalTeleportation: portalTime++ >= transitionTime.
  • Entity.handlePortal → setPortalCooldown, teleportToPortalDestination → canTeleport (End → Overworld: every ServerPlayer passenger has seenCredits) → teleport → teleportCrossDimension: each passenger is teleported with calculatePassengerTransition (transitionAsPassenger), the vehicle is recreated, and every passenger rides it again with startRiding(newEntity, true, false).
  • ServerPlayer.teleport: if (!transition.asPassenger()) removeVehicle(), so a passenger keeps its vehicle.

Proof

New lan_e2e check portal_rider (--server-thread): a survival guest rides a tame horse, the portal is lit around them, and the check asserts the guest leaves within 40 ticks and arrives in the Nether still riding the same horse, with the horse under it.

Build Result
#2691 merged with main (42be3018d, before the review change) ❌ the guest left after 75 ticks: its own delay (80), not the horse's (0)
this branch ✅ left after 5 ticks, riding: 271 (the same horse) in the Nether, the horse at the rider's feet

lan_e2e.py --server-thread --check portals (the existing players-through-portals check) passes too.

Single player, horizon-ctl --offscreen, isolated data folders, survival player on a tame horse, portal lit around them:

Path Result
server thread (default) in the Nether after 0.33 s, still riding the same horse (id 27)
--in-frame stays in the Overworld on its horse, same as before this PR: the in-frame path has no rider travel at all (the player can't use a portal while riding, and its vehicle is left out). Unchanged here; it's the fallback path, not what players run

Not covered: End gateways (the rider still uses the gateway itself, since vehicles don't use gateways yet: #2689).

Self-check

pr_ready (tools/pr_ready.py on ludovics-mac-mini, against origin/main at f66f66c3b, 20 min 46 s)

Check Result
Scope ✅ 6 files, +394 −12
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 401 passed (1 min 11 s)
rustfmt ✅ (5 s)
clippy ✅ (2 min 2 s)
tests: horizon-client ✅ 1272 passed (3 min 42 s)
doc tests ✅ 0 passed (1 min 3 s)
content root tests ➖ content root untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ✅ 41 affected, 12 passed (12 min 29 s)
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

🤖 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/3329 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/28/2026 **Status:** ✅ Merged **Merged:** 10/28/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/portal-rider-vehicle-timer` --- ### 📝 Commits (6) - [`33e81f4`](https://github.com/horizon-rust/horizon/commit/33e81f464ef138a17731b18967dd3839282a167a) Keep a rider with the vehicle it rides through a portal - [`44850bd`](https://github.com/horizon-rust/horizon/commit/44850bdd557c84f1fff31125a792b429648d2101) Merge upstream/main into the portal rider travel branch - [`7e68f1e`](https://github.com/horizon-rust/horizon/commit/7e68f1ed321622ff16629845f645e57bd312309d) Remove the duplicate rabbit arm in entity_nbt - [`42be301`](https://github.com/horizon-rust/horizon/commit/42be3018dddb90cc71e3e247c7ba43632c4ea963) Merge origin/main into the portal rider travel branch - [`9ff0d98`](https://github.com/horizon-rust/horizon/commit/9ff0d980109b5637030af31116220810adf7f172) Let the vehicle take its riders through a portal at once - [`74c2d13`](https://github.com/horizon-rust/horizon/commit/74c2d13d77c3a2cc88653eb3b4c8d1ac4f129e0b) Merge origin/main into the portal rider travel branch ### 📊 Changes **6 files changed** (+394 additions, -12 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/entity_nbt.rs` (+1 -0) 📝 `crates/horizon-client/src/game/lan_vehicles.rs` (+8 -0) 📝 `crates/horizon-client/src/game/levels.rs` (+35 -4) 📝 `crates/horizon-client/src/game/nether_portal.rs` (+57 -4) 📝 `crates/horizon-client/src/game/server_travel.rs` (+211 -4) 📝 `tools/lan_e2e.py` (+82 -0) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Supersedes #2691 by @levzzz5154, who found and fixed the core of #1486; Ludovic asked us to take it over after it went quiet with conflicts. Their three commits are kept as they were, and the commits added here carry `Co-Authored-By: levzzz5154`. Thank you, levzzz! ## What and why On a server thread (single player's default path, LAN guests, dedicated servers), riding a horse into a Nether portal left the player in the Nether **on foot**. The horse went through on its own as an entity (saved, restored with a new id) while the player travelled alone, so the ride broke (#1486). **From #2691 (levzzz5154):** the trip carries the vehicle the player rides. When the trip arrives, the vehicle moves from the source level to the destination **with the same entity id**, UUID and loaded compound, stands where its rider arrives, and gets `Entity.setPortalCooldown`. The ride is never broken. **Added here (the open review change):** in vanilla the *vehicle* uses the portal and carries its rider at once. #2691 still let the rider's own timer decide, so a survival rider waited 80 ticks (4 s). Now: - a server player who rides starts no Nether or End portal process (`Entity.canUsePortal(false)` is false for a passenger, and `NetherPortalBlock.entityInside` / `EndPortalBlock.entityInside` skip it); - on a server, a horse, boat or minecart ridden only by server players uses the entity portal path. Its transition time is 0 (`NetherPortalBlock.getPortalTransitionTime` returns 0 for anything that isn't a `Player`), so it goes through on the next tick. Once through, each rider's trip starts with the vehicle (`carry_riders_through_portals` → `start_server_trip`, the plan computed from the vehicle's own position and size, as `getPortalDestination(level, vehicle)`); - out of the End, every rider must have seen the credits (`Entity.canTeleport`); - the level the vehicle waits in is not closed as idle until the vehicle has moved; - where players can't change level (an in-frame LAN host), a ridden vehicle no longer goes through on its own and leaves its rider behind. Merged with main (conflicts in `levels.rs`, `nether_portal.rs`, `server_travel.rs`: main's `set_portal_cooldown(id)` from #2352, the world spawn trip from #2355, leash knot ids from #2123). Fixes #1486 ## Vanilla reference (26.3 bytecode, `tools/rea_vanilla.py`) - `Entity.canUsePortal(boolean)`: `(ignorePassenger || !isPassenger()) && isAlive()`; `LivingEntity` adds `!isSleeping()`. - `NetherPortalBlock.entityInside`: `if (entity.canUsePortal(false)) entity.setAsInsidePortal(this, pos)`. - `NetherPortalBlock.getPortalTransitionTime`: the player game rule delays for a `Player`, else `0`. - `PortalProcessor.processPortalTeleportation`: `portalTime++ >= transitionTime`. - `Entity.handlePortal` → `setPortalCooldown`, `teleportToPortalDestination` → `canTeleport` (End → Overworld: every `ServerPlayer` passenger has `seenCredits`) → `teleport` → `teleportCrossDimension`: each passenger is teleported with `calculatePassengerTransition` (`transitionAsPassenger`), the vehicle is recreated, and every passenger rides it again with `startRiding(newEntity, true, false)`. - `ServerPlayer.teleport`: `if (!transition.asPassenger()) removeVehicle()`, so a passenger keeps its vehicle. ## Proof **New lan_e2e check `portal_rider`** (`--server-thread`): a survival guest rides a tame horse, the portal is lit around them, and the check asserts the guest leaves within 40 ticks and arrives in the Nether still riding the same horse, with the horse under it. | Build | Result | | --- | --- | | #2691 merged with main (`42be3018d`, before the review change) | ❌ `the guest left after 75 ticks: its own delay (80), not the horse's (0)` | | this branch | ✅ left after 5 ticks, `riding: 271` (the same horse) in the Nether, the horse at the rider's feet | `lan_e2e.py --server-thread --check portals` (the existing players-through-portals check) passes too. **Single player, horizon-ctl `--offscreen`, isolated data folders**, survival player on a tame horse, portal lit around them: | Path | Result | | --- | --- | | server thread (default) | in the Nether after 0.33 s, still riding the same horse (id 27) | | `--in-frame` | stays in the Overworld on its horse, same as before this PR: the in-frame path has no rider travel at all (the player can't use a portal while riding, and its vehicle is left out). Unchanged here; it's the fallback path, not what players run | Not covered: End gateways (the rider still uses the gateway itself, since vehicles don't use gateways yet: #2689). ## Self-check **pr_ready** (`tools/pr_ready.py` on ludovics-mac-mini, against origin/main at f66f66c3b, 20 min 46 s) | Check | Result | | --- | --- | | Scope | ✅ 6 files, +394 −12 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 401 passed (1 min 11 s) | | rustfmt | ✅ (5 s) | | clippy | ✅ (2 min 2 s) | | tests: horizon-client | ✅ 1272 passed (3 min 42 s) | | doc tests | ✅ 0 passed (1 min 3 s) | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ✅ 41 affected, 12 passed (12 min 29 s) | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | 🤖 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 05:08:48 +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#4906
No description provided.