[PR #6075] [MERGED] Primed TNT travels through nether portals #6644

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

📋 Pull Request Information

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

Base: main ← Head: fix/tnt-portal-travel


📝 Commits (1)

  • c25499d Primed TNT goes through nether portals

📊 Changes

3 files changed (+65 additions, -1 deletions)

View changed files

📝 crates/horizon-client/src/entity_nbt.rs (+22 -0)
📝 crates/horizon-client/src/game/nether_portal.rs (+41 -1)
📝 crates/horizon-client/src/game/persist.rs (+2 -0)

📄 Description

🤖 Opened by xFedeT's AI agent (Claude Code, Sonnet 5.5), not by xFedeT personally.

Fixes #6018.

What was wrong

Entity.handlePortal applies to every entity that canUsePortal. Horizon's entity portal travel (game/nether_portal.rs) lists what it sweeps through a portal and sends: items, mobs, boats and minecarts. Primed TNT was not in the list, so water could carry it to a portal and it just sat in it.

What changes

  • find_entity_portals / handle_entity_portals take the primed TNT (0.98 across, tracked by its entity id), and send_through_portal saves it as its tag (new entity_nbt::tnt_to_nbt: position, motion, OnGround, fuse) and puts it in the arrivals, which land it at the exit portal as for the other entities.
  • The TNT loader (persist.rs) now remembers the tag, which restores the PortalCooldown (Entity.load). Without it the TNT that arrived inside the exit portal went straight back, and again.
  • A TNT that carries a mob stays (canUsePortal(false): the rider would be left behind).

Verification

Live, offscreen with horizon-ctl: a portal frame at z=0 on a dirt floor and a primed TNT (fuse:200) thrown at it.

  • Before: it stays at the portal and explodes in the Overworld (the floor behind it is blown).
  • After: the floor is intact; the TNT is in the Nether, comes out of the exit portal and blows a crater there (screenshot of the crater below the Nether portal), and it does not bounce back.
  • cargo test -p horizon-client unchanged; clippy clean for the changed files except the existing needless_borrow in horizon-world.

Not done

  • The TNT's owner (who lit it) is not kept across the portal (the loader reads none, as for a saved TNT).
  • Nothing in this PR saves primed TNT with a chunk; only the portal writes its tag.
  • No automated test: the travel needs a whole Game. The parity harnesses covering these files (portal travel, TNT) could not run on this machine (its Python lacks hashlib.file_digest); CI runs them.

🤖 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/6075 **Author:** [@xFedeT](https://github.com/xFedeT) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/tnt-portal-travel` --- ### 📝 Commits (1) - [`c25499d`](https://github.com/horizon-rust/horizon/commit/c25499d50437f2f3e3117e7080f89c87cee52346) Primed TNT goes through nether portals ### 📊 Changes **3 files changed** (+65 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/entity_nbt.rs` (+22 -0) 📝 `crates/horizon-client/src/game/nether_portal.rs` (+41 -1) 📝 `crates/horizon-client/src/game/persist.rs` (+2 -0) </details> ### 📄 Description > 🤖 Opened by xFedeT's AI agent (Claude Code, Sonnet 5.5), not by xFedeT personally. Fixes #6018. ## What was wrong `Entity.handlePortal` applies to every entity that `canUsePortal`. Horizon's entity portal travel (`game/nether_portal.rs`) lists what it sweeps through a portal and sends: items, mobs, boats and minecarts. Primed TNT was not in the list, so water could carry it to a portal and it just sat in it. ## What changes - `find_entity_portals` / `handle_entity_portals` take the primed TNT (0.98 across, tracked by its entity id), and `send_through_portal` saves it as its tag (new `entity_nbt::tnt_to_nbt`: position, motion, `OnGround`, `fuse`) and puts it in the arrivals, which land it at the exit portal as for the other entities. - The TNT loader (`persist.rs`) now `remember`s the tag, which restores the `PortalCooldown` (`Entity.load`). Without it the TNT that arrived inside the exit portal went straight back, and again. - A TNT that carries a mob stays (`canUsePortal(false)`: the rider would be left behind). ## Verification Live, offscreen with `horizon-ctl`: a portal frame at z=0 on a dirt floor and a primed TNT (`fuse:200`) thrown at it. - Before: it stays at the portal and explodes in the Overworld (the floor behind it is blown). - After: the floor is intact; the TNT is in the Nether, comes out of the exit portal and blows a crater there (screenshot of the crater below the Nether portal), and it does not bounce back. - `cargo test -p horizon-client` unchanged; clippy clean for the changed files except the existing `needless_borrow` in `horizon-world`. ## Not done - The TNT's owner (who lit it) is not kept across the portal (the loader reads none, as for a saved TNT). - Nothing in this PR saves primed TNT with a chunk; only the portal writes its tag. - No automated test: the travel needs a whole `Game`. The parity harnesses covering these files (portal travel, TNT) could not run on this machine (its Python lacks `hashlib.file_digest`); CI runs them. 🤖 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 06:24:16 +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#6644
No description provided.