[PR #5585] [MERGED] native_summon: return TNT, falling-block and firework IDs immediately #6369

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/5585
Author: @Xmilon
Created: 10/31/2026
Status: ✅ Merged
Merged: 11/1/2026
Merged by: @ludovic111

Base: main ← Head: native/summon-root-ids


📝 Commits (1)

  • f4103d2 fix(mods): return deferred summon root IDs immediately

📊 Changes

2 files changed (+37 additions, -5 deletions)

View changed files

📝 crates/horizon-client/src/game/lan_entities.rs (+26 -4)
📝 crates/horizon-client/src/game/native_entities.rs (+11 -1)

📄 Description

🤖 Opened by Xmilon's AI agent (Codex, GPT-6), not by Xmilon personally.

What and why

Fixes #5539. Part of #4953.

A successful native_summon of primed TNT, a falling block or a firework rocket returned None because those roots load with ID 0 and receive an ID only during tracking. Assign the newly appended root its real ID before returning, using the same allocator as tracking. The tracking pass preserves that ID instead of assigning another.

Only native_summon allocates these roots early; normal chunk loading and command Target variants stay unchanged. Existing authority, dimension, position and loaded-chunk checks are preserved. A failed spawn appends no root and still returns None. The type's previous vector length selects the new root, so older deferred entities cannot be mistaken for it.

This is separate from #5480 (orb return IDs and passenger placement); no orb or passenger behavior is changed here. No catalog fragment/version is needed for fixing the existing helper's promised return value.

Kind

  • bug: a crash or a breakage

Vanilla reference

Horizon-only native helper contract. The existing NBT loaders and tracking behavior are retained.

Other projects' code

None.

Self-check

Windows, RUST_MIN_STACK=33554432, -j1:

  • cargo fmt --all -- --check: pass.
  • cargo clippy -p horizon-client --lib --bins --tests -- -D warnings: pass (2m32s).
  • The actual allocator and its regression test were compiled and run as an isolated rustc test: pass. Three early IDs are unique, a later tracking pass retains them, and the next deferred entity gets the next unused ID.
  • Upstream CI verify passed at f4103d272, including workspace linting and tests: https://github.com/horizon-rust/horizon/actions/runs/41254575905. Launcher reported success with its checks skipped because this change does not affect launcher dependencies. Parity jobs were skipped.
  • No real-game or dedicated-server test was performed; no prepared resources in this worktree. No player data or installed game files were changed.

🤖 Generated with Codex


🔄 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/5585 **Author:** [@Xmilon](https://github.com/Xmilon) **Created:** 10/31/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `native/summon-root-ids` --- ### 📝 Commits (1) - [`f4103d2`](https://github.com/horizon-rust/horizon/commit/f4103d272e84c0bd894b7fb23b7607c2ff7c33de) fix(mods): return deferred summon root IDs immediately ### 📊 Changes **2 files changed** (+37 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/lan_entities.rs` (+26 -4) 📝 `crates/horizon-client/src/game/native_entities.rs` (+11 -1) </details> ### 📄 Description > 🤖 Opened by Xmilon's AI agent (Codex, GPT-6), not by Xmilon personally. ## What and why Fixes #5539. Part of #4953. A successful native_summon of primed TNT, a falling block or a firework rocket returned None because those roots load with ID 0 and receive an ID only during tracking. Assign the newly appended root its real ID before returning, using the same allocator as tracking. The tracking pass preserves that ID instead of assigning another. Only native_summon allocates these roots early; normal chunk loading and command Target variants stay unchanged. Existing authority, dimension, position and loaded-chunk checks are preserved. A failed spawn appends no root and still returns None. The type's previous vector length selects the new root, so older deferred entities cannot be mistaken for it. This is separate from #5480 (orb return IDs and passenger placement); no orb or passenger behavior is changed here. No catalog fragment/version is needed for fixing the existing helper's promised return value. ## Kind - [x] bug: a crash or a breakage ## Vanilla reference Horizon-only native helper contract. The existing NBT loaders and tracking behavior are retained. ## Other projects' code None. ## Self-check Windows, RUST_MIN_STACK=33554432, -j1: - cargo fmt --all -- --check: pass. - cargo clippy -p horizon-client --lib --bins --tests -- -D warnings: pass (2m32s). - The actual allocator and its regression test were compiled and run as an isolated rustc test: pass. Three early IDs are unique, a later tracking pass retains them, and the next deferred entity gets the next unused ID. - Upstream CI verify passed at f4103d272, including workspace linting and tests: https://github.com/horizon-rust/horizon/actions/runs/41254575905. Launcher reported success with its checks skipped because this change does not affect launcher dependencies. Parity jobs were skipped. - No real-game or dedicated-server test was performed; no prepared resources in this worktree. No player data or installed game files were changed. 🤖 Generated with [Codex](https://openai.com/codex/) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:19:17 +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#6369
No description provided.