[PR #6465] [MERGED] XP orbs and thrown projectiles go through portals #6894

Closed
opened 2026-11-03 06:28:44 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/6465
Author: @HrafnaValkyrja
Created: 11/1/2026
Status: ✅ Merged
Merged: 11/1/2026
Merged by: @ludovic111

Base: main ← Head: fix/portals-entity-kinds


📝 Commits (1)

  • 415ef54 Portals carry XP orbs and thrown projectiles

📊 Changes

2 files changed (+73 additions, -23 deletions)

View changed files

📝 crates/horizon-client/src/game/nether_portal.rs (+63 -23)
📝 crates/horizon-client/src/game/persist.rs (+10 -0)

📄 Description

🤖 Opened by Valkyrie's AI agent (Claude Code, Opus 5.5), not by Valkyrie herself.

What and why

Experience orbs, snowballs, eggs, potions and fireballs ignored nether and End portals: they stayed where they were. In vanilla they go through like dropped items. This sweeps them for portal blocks, saves them, spawns them in the other dimension and keeps their portal cooldown there so they do not go straight back.

Primed TNT and arrows already travel on main. Thrown tridents and firework rockets also stay behind; they have no save writer yet (see #6426), so they are a follow-up.

Changed: game/nether_portal.rs (sweep, send, orb branch, projectile branch), game/persist.rs (restore the portal cooldown for orbs and projectiles).

Fixes #6464

Kind

  • parity: Horizon now does what vanilla 26.3 does
  • bug: a crash or a breakage
  • perf: faster, or less memory
  • feature: something new for players (listed under New in the release notes)
  • extra: Horizon-only, off by default
  • tooling: tools, CI, tests, harnesses
  • docs

Vanilla reference

Entity.canUsePortal is (ignorePassenger || !isPassenger()) && isAlive() and no orb or projectile class overrides it, so every one of them takes NetherPortalBlock.entityInside / EndPortalBlock.entityInside and Entity.handlePortal. Ender pearls and wind charges are left as they were (own rules / not saved).

Numbers

Side-by-side scenes against the pinned vanilla server (dedicated, no player, entities summoned inside a lit portal, counted per dimension each tick):

Nether portal vanilla Horizon before Horizon after
experience orb in the nether by tick 2 stays in the overworld in the nether by tick 2
snowball, egg in the nether by tick 1 stay in the overworld in the nether by tick 2
values matching (162 probed) 101 129

End portal (132 values, orb, TNT, snowball, egg, arrow, item): 132 of 132 match with the fix; 128 of 132 without it (the orb, snowball and egg do not go through).

Left over of the 33 unmatched nether values: 14 tridents and 8 firework rockets (not carried, see above), 6 values where snowballs, eggs and arrows are in the nether one tick later than vanilla (tick 2 instead of 1), and 5 that follow from that one-tick delay (snowball and egg dying one tick later, a falling block, an item). Arrows have the same one-tick delay on main.

What wasn't compared

  • Tridents, rockets, ender pearls, wind charges, End gateway travel.
  • Players riding or standing in the portal; only the entities above.

Proved by script against the real 26.3 server; no human played this change.

Other projects' code

none

Self-check

pr_ready (tools/pr_ready.py --quick on Valhalla, against origin/main at ed102e059, 3 min 32 s)

Check Result
Scope ✅ 3 files, +73 −23
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 594 passed (27 s)
rustfmt ✅ (6 s)
Rust ⚠️ 1.98.0 is older than CI's stable (1.99): clippy may flag lints CI doesn't, update with rustup update
clippy ✅ (1 min 32 s)
tests: horizon-client ✅ 590 passed (1 min 24 s)
doc tests ✅ 0 passed (1 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 ➖ 330 affected, to run in CI (--quick): armor_stand_frost, arrow, arrow_wind_charge, block_removal, boat_authority, boat_paddle_reset, boat_submerged, bulk_section, bundle_weight, camera, canyon_carver, carving_geometry and 318 more
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

🤖 Generated with Claude Code

https://claude.ai/code/session_018zuDTsnyHkP28bzn3u7S3m


🔄 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/6465 **Author:** [@HrafnaValkyrja](https://github.com/HrafnaValkyrja) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/portals-entity-kinds` --- ### 📝 Commits (1) - [`415ef54`](https://github.com/horizon-rust/horizon/commit/415ef54a47fae9f1608d8f6d3e85ec643ec9a040) Portals carry XP orbs and thrown projectiles ### 📊 Changes **2 files changed** (+73 additions, -23 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/nether_portal.rs` (+63 -23) 📝 `crates/horizon-client/src/game/persist.rs` (+10 -0) </details> ### 📄 Description > 🤖 Opened by Valkyrie's AI agent (Claude Code, Opus 5.5), not by Valkyrie herself. ## What and why Experience orbs, snowballs, eggs, potions and fireballs ignored nether and End portals: they stayed where they were. In vanilla they go through like dropped items. This sweeps them for portal blocks, saves them, spawns them in the other dimension and keeps their portal cooldown there so they do not go straight back. Primed TNT and arrows already travel on main. Thrown tridents and firework rockets also stay behind; they have no save writer yet (see #6426), so they are a follow-up. Changed: `game/nether_portal.rs` (sweep, send, orb branch, projectile branch), `game/persist.rs` (restore the portal cooldown for orbs and projectiles). Fixes #6464 ## Kind - [x] parity: Horizon now does what vanilla 26.3 does - [ ] bug: a crash or a breakage - [ ] perf: faster, or less memory - [ ] feature: something new for players (listed under New in the release notes) - [ ] extra: Horizon-only, off by default - [ ] tooling: tools, CI, tests, harnesses - [ ] docs ## Vanilla reference `Entity.canUsePortal` is `(ignorePassenger || !isPassenger()) && isAlive()` and no orb or projectile class overrides it, so every one of them takes `NetherPortalBlock.entityInside` / `EndPortalBlock.entityInside` and `Entity.handlePortal`. Ender pearls and wind charges are left as they were (own rules / not saved). ## Numbers Side-by-side scenes against the pinned vanilla server (dedicated, no player, entities summoned inside a lit portal, counted per dimension each tick): | Nether portal | vanilla | Horizon before | Horizon after | |---|---|---|---| | experience orb | in the nether by tick 2 | stays in the overworld | in the nether by tick 2 | | snowball, egg | in the nether by tick 1 | stay in the overworld | in the nether by tick 2 | | values matching (162 probed) | | 101 | 129 | End portal (132 values, orb, TNT, snowball, egg, arrow, item): 132 of 132 match with the fix; 128 of 132 without it (the orb, snowball and egg do not go through). Left over of the 33 unmatched nether values: 14 tridents and 8 firework rockets (not carried, see above), 6 values where snowballs, eggs and arrows are in the nether one tick later than vanilla (tick 2 instead of 1), and 5 that follow from that one-tick delay (snowball and egg dying one tick later, a falling block, an item). Arrows have the same one-tick delay on main. ## What wasn't compared - Tridents, rockets, ender pearls, wind charges, End gateway travel. - Players riding or standing in the portal; only the entities above. Proved by script against the real 26.3 server; no human played this change. ## Other projects' code none ## Self-check **pr_ready** (`tools/pr_ready.py --quick` on Valhalla, against origin/main at ed102e059, 3 min 32 s) | Check | Result | | --- | --- | | Scope | ✅ 3 files, +73 −23 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 594 passed (27 s) | | rustfmt | ✅ (6 s) | | Rust | ⚠️ 1.98.0 is older than CI's stable (1.99): clippy may flag lints CI doesn't, update with `rustup update` | | clippy | ✅ (1 min 32 s) | | tests: horizon-client | ✅ 590 passed (1 min 24 s) | | doc tests | ✅ 0 passed (1 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 | ➖ 330 affected, to run in CI (--quick): armor_stand_frost, arrow, arrow_wind_charge, block_removal, boat_authority, boat_paddle_reset, boat_submerged, bulk_section, bundle_weight, camera, canyon_carver, carving_geometry and 318 more | | 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) https://claude.ai/code/session_018zuDTsnyHkP28bzn3u7S3m --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:28:44 +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#6894
No description provided.