[PR #6715] [MERGED] Rockets, loaded tridents and the eye take ids through one helper #7047

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

📋 Pull Request Information

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

Base: main ← Head: refactor/stable-ids-rest


📝 Commits (6)

  • 9c6d2c1 Merge branch 'refactor/stable-entity-ids' into refactor/stable-ids-rest
  • 39b08f9 Take entity ids at creation for rockets and loaded tridents
  • ea3d261 Merge remote-tracking branch 'origin/main' into refactor/stable-ids-rest
  • cbe2ef5 Merge remote-tracking branch 'origin/main' into refactor/stable-ids-rest
  • 7983bb7 Regenerate the mod API output after the merge with main
  • 1e1c6d5 Merge remote-tracking branch 'origin/main' into refactor/stable-ids-rest

📊 Changes

4 files changed (+9 additions, -11 deletions)

View changed files

📝 crates/horizon-client/src/game/end.rs (+2 -3)
📝 crates/horizon-client/src/game/fireworks.rs (+3 -3)
📝 crates/horizon-client/src/game/native_entities.rs (+2 -2)
📝 crates/horizon-client/src/game/persist.rs (+2 -3)

📄 Description

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

What and why

Finishes #6537 (follows #6575). Of the remaining kinds, primed TNT, falling blocks and projectiles already take an id from next_entity at every creation site (command, dispenser, NBT load, native mods, block events). Firework rockets and tridents loaded from NBT did not: they were pushed with id 0 and got one only when a LAN guest was connected.

new_rocket (launch, angled launch, boost, raid fireworks) and the NBT load arms for rockets and tridents now take the id from take_entity_id. 11 lines changed in game/fireworks.rs, game/persist.rs, game/native_entities.rs (comment). No per-tick work and no allocation changes: the id is taken once when the entity is created.

EntityMemory.anon is still used by orbs, arrows, falling blocks, rockets, tridents, crystals and the dragon, so it is not touched.

Part of #6537

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 takes id from the single ENTITY_COUNTER in its constructor, so every entity has an id from the moment it exists.

Test

No behaviour change is intended. Compared against origin/main, same inputs:

  • Save, quit, reload, save (cycle.py, 10 summons): identical saved entity tables apart from random UUIDs and a 2-tick wall-clock jitter that origin/main shows against itself (rocket Pos y 146.12 vs 150.8, fuse 442 vs 440); the fixed build matched the second origin/main run exactly.
  • Side-by-side selkinds (156 probed values): 150/156 match vanilla before and after, output identical.
  • Parity harnesses arrow, arrow_wind_charge, trident, pearl_wind_charge, pearl_death, remote_attack, remote_fireball, remote_fireworks pass.

What wasn't compared

  • parity.py --changed origin/main selects 369 of 385 harnesses. I did not complete that run.
  • Ids drawn at creation shift the numbering of later entities; no id is observable in the compared scenes.

Also moves the eye of ender onto take_entity_id, as asked in review of #6575.

A refactor with no behaviour change; proved by script, no human played this change.

Other projects' code

none

Self-check

pr_ready (tools/pr_ready.py --quick on Valhalla, against origin/main at 1c6daa908, 4 min 44 s)

Check Result
Scope ✅ 4 files, +11 −12
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 600 passed (30 s)
rustfmt ✅ (7 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 59 s)
tests: horizon-client ✅ 596 passed (1 min 53 s)
doc tests ✅ 0 passed (2 s)
content root tests ➖ content root untouched
mod API up to date ✅ (6 s)
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ 239 affected, to run in CI (--quick): armor_stand_frost, arrow, arrow_wind_charge, block_removal, boat_authority, boat_paddle_reset, boat_submerged, bonus_chest, command_exec, composter, crafter, cursor_death and 227 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/6715 **Author:** [@HrafnaValkyrja](https://github.com/HrafnaValkyrja) **Created:** 11/2/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `refactor/stable-ids-rest` --- ### 📝 Commits (6) - [`9c6d2c1`](https://github.com/horizon-rust/horizon/commit/9c6d2c10768c4901e0dcba308961217bd61f45f3) Merge branch 'refactor/stable-entity-ids' into refactor/stable-ids-rest - [`39b08f9`](https://github.com/horizon-rust/horizon/commit/39b08f9223f6f609ec44c8ce8f4d5444b126befa) Take entity ids at creation for rockets and loaded tridents - [`ea3d261`](https://github.com/horizon-rust/horizon/commit/ea3d261c1ac751b61f48aa55408488dcab906d23) Merge remote-tracking branch 'origin/main' into refactor/stable-ids-rest - [`cbe2ef5`](https://github.com/horizon-rust/horizon/commit/cbe2ef58b72bda13542ff20cdeaba3cc774fe352) Merge remote-tracking branch 'origin/main' into refactor/stable-ids-rest - [`7983bb7`](https://github.com/horizon-rust/horizon/commit/7983bb743f29cc3a61b64fa98c984caab51876f5) Regenerate the mod API output after the merge with main - [`1e1c6d5`](https://github.com/horizon-rust/horizon/commit/1e1c6d5699a8b5f7b1aff3f8d015dbabaff15ee3) Merge remote-tracking branch 'origin/main' into refactor/stable-ids-rest ### 📊 Changes **4 files changed** (+9 additions, -11 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/end.rs` (+2 -3) 📝 `crates/horizon-client/src/game/fireworks.rs` (+3 -3) 📝 `crates/horizon-client/src/game/native_entities.rs` (+2 -2) 📝 `crates/horizon-client/src/game/persist.rs` (+2 -3) </details> ### 📄 Description > 🤖 Opened by Valkyrie's AI agent (Claude Code, Opus 5.5), not by Valkyrie herself. ## What and why Finishes #6537 (follows #6575). Of the remaining kinds, primed TNT, falling blocks and projectiles already take an id from `next_entity` at every creation site (command, dispenser, NBT load, native mods, block events). Firework rockets and tridents loaded from NBT did not: they were pushed with id 0 and got one only when a LAN guest was connected. `new_rocket` (launch, angled launch, boost, raid fireworks) and the NBT load arms for rockets and tridents now take the id from `take_entity_id`. 11 lines changed in `game/fireworks.rs`, `game/persist.rs`, `game/native_entities.rs` (comment). No per-tick work and no allocation changes: the id is taken once when the entity is created. `EntityMemory.anon` is still used by orbs, arrows, falling blocks, rockets, tridents, crystals and the dragon, so it is not touched. Part of #6537 ## 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 - [x] tooling: tools, CI, tests, harnesses - [ ] docs ## Vanilla reference `Entity` takes `id` from the single `ENTITY_COUNTER` in its constructor, so every entity has an id from the moment it exists. ## Test No behaviour change is intended. Compared against origin/main, same inputs: - Save, quit, reload, save (`cycle.py`, 10 summons): identical saved entity tables apart from random UUIDs and a 2-tick wall-clock jitter that origin/main shows against itself (rocket Pos y 146.12 vs 150.8, fuse 442 vs 440); the fixed build matched the second origin/main run exactly. - Side-by-side `selkinds` (156 probed values): 150/156 match vanilla before and after, output identical. - Parity harnesses `arrow`, `arrow_wind_charge`, `trident`, `pearl_wind_charge`, `pearl_death`, `remote_attack`, `remote_fireball`, `remote_fireworks` pass. ## What wasn't compared - `parity.py --changed origin/main` selects 369 of 385 harnesses. I did not complete that run. - Ids drawn at creation shift the numbering of later entities; no id is observable in the compared scenes. Also moves the eye of ender onto `take_entity_id`, as asked in review of #6575. A refactor with no behaviour change; proved by script, no human played this change. ## Other projects' code none ## Self-check **pr_ready** (`tools/pr_ready.py --quick` on Valhalla, against origin/main at 1c6daa908, 4 min 44 s) | Check | Result | | --- | --- | | Scope | ✅ 4 files, +11 −12 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 600 passed (30 s) | | rustfmt | ✅ (7 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 59 s) | | tests: horizon-client | ✅ 596 passed (1 min 53 s) | | doc tests | ✅ 0 passed (2 s) | | content root tests | ➖ content root untouched | | mod API up to date | ✅ (6 s) | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ 239 affected, to run in CI (--quick): armor_stand_frost, arrow, arrow_wind_charge, block_removal, boat_authority, boat_paddle_reset, boat_submerged, bonus_chest, command_exec, composter, crafter, cursor_death and 227 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:32:50 +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#7047
No description provided.