[PR #7765] Restore block entities and inventory for falling chests #7805

Open
opened 2026-11-03 07:24:23 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/7765
Author: @TheMrZZ
Created: 11/2/2026
Status: 🔄 Open

Base: main ← Head: fix/h099-falling-chest-data


📝 Commits (1)

  • 2c7ad7f Create block entities when falling blocks land

📊 Changes

3 files changed (+191 additions, -0 deletions)

View changed files

📝 crates/horizon-client/src/game/falling_damage.rs (+23 -0)
📝 tools/port_map/game2-002.tsv (+1 -0)
➕ tools/test_falling_chest_parity.py (+167 -0)

📄 Description

🤖 Opened by TheMrZZ's AI agent (Codex, gpt-6.1-sol), not by TheMrZZ personally.

What and why

A falling chest currently lands as a chest block but has no block entity, so its supplied inventory is inaccessible. Create the block entity after successful landing, then overlay carried TileEntityData onto its saved defaults and load it through the existing block-entity NBT path. Fixes #7743.

Add a fresh dedicated-server regression covering empty and diamond-filled falling chests, pre-landing supplied data, direct chest placement/data modification, and ordinary falling sand. With the same fixture and identical fresh Java 26.3 records, old Horizon matches 21/26 observations and the fix matches 26/26. The five old differences are the empty chest's inventory query and four filled-inventory queries. Block state and falling-entity removal already match.

The scene uses bounded loaded-coordinate readiness and waits for 30 actual simulation ticks after each summon. Item counts use the existing codec; entity loading and general data-command updates are unchanged.

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

Java 26.3 FallingBlockEntity.tick places the block, gets its block entity, saves its defaults, copies each supplied block-data field over them, calls loadWithComponents and marks it changed. Placement through LevelChunk.setBlockState creates a block entity even when no data was supplied. Inspected the pinned official bytecode, including the field-copy lambda.

Regression: python3 tools/test_falling_chest_parity.py. The port-map row describes this landing portion; movement and survival checks remain in their existing paths.

Other projects' code

None.

Self-check

pr_ready (tools/pr_ready.py --quick on local validation, against origin/main at ec5f55a93, 11 min 43 s)

Check Result
Scope ✅ 3 files, +191 −0
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 614 passed (2 min 18 s)
rustfmt ✅ (17 s)
clippy ✅ (5 min 11 s)
tests: horizon-client ✅ 711 passed (3 min 19 s)
doc tests ✅ 0 passed (3 s)
content root tests ➖ content root untouched
mod API up to date ✅ (33 s)
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ not run (--quick): CI's parity job picks the affected harnesses
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

Also passed the focused old/fixed live regression above and port-map validation. Full affected parity was not run locally (--quick); the focused runtime was run separately.

🤖 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/7765 **Author:** [@TheMrZZ](https://github.com/TheMrZZ) **Created:** 11/2/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/h099-falling-chest-data` --- ### 📝 Commits (1) - [`2c7ad7f`](https://github.com/horizon-rust/horizon/commit/2c7ad7f2be0c286c033e85c6de53f6332c2db6d5) Create block entities when falling blocks land ### 📊 Changes **3 files changed** (+191 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/falling_damage.rs` (+23 -0) 📝 `tools/port_map/game2-002.tsv` (+1 -0) ➕ `tools/test_falling_chest_parity.py` (+167 -0) </details> ### 📄 Description > 🤖 Opened by TheMrZZ's AI agent (Codex, gpt-6.1-sol), not by TheMrZZ personally. ## What and why A falling chest currently lands as a chest block but has no block entity, so its supplied inventory is inaccessible. Create the block entity after successful landing, then overlay carried `TileEntityData` onto its saved defaults and load it through the existing block-entity NBT path. Fixes #7743. Add a fresh dedicated-server regression covering empty and diamond-filled falling chests, pre-landing supplied data, direct chest placement/data modification, and ordinary falling sand. With the **same fixture and identical fresh Java 26.3 records**, old Horizon matches **21/26** observations and the fix matches **26/26**. The five old differences are the empty chest's inventory query and four filled-inventory queries. Block state and falling-entity removal already match. The scene uses bounded loaded-coordinate readiness and waits for 30 actual simulation ticks after each summon. Item counts use the existing codec; entity loading and general data-command updates are unchanged. ## 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 Java 26.3 `FallingBlockEntity.tick` places the block, gets its block entity, saves its defaults, copies each supplied block-data field over them, calls `loadWithComponents` and marks it changed. Placement through `LevelChunk.setBlockState` creates a block entity even when no data was supplied. Inspected the pinned official bytecode, including the field-copy lambda. Regression: `python3 tools/test_falling_chest_parity.py`. The port-map row describes this landing portion; movement and survival checks remain in their existing paths. ## Other projects' code None. ## Self-check **pr_ready** (`tools/pr_ready.py --quick` on local validation, against origin/main at ec5f55a93, 11 min 43 s) | Check | Result | | --- | --- | | Scope | ✅ 3 files, +191 −0 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 614 passed (2 min 18 s) | | rustfmt | ✅ (17 s) | | clippy | ✅ (5 min 11 s) | | tests: horizon-client | ✅ 711 passed (3 min 19 s) | | doc tests | ✅ 0 passed (3 s) | | content root tests | ➖ content root untouched | | mod API up to date | ✅ (33 s) | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ not run (--quick): CI's parity job picks the affected harnesses | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | Also passed the focused old/fixed live regression above and port-map validation. Full affected parity was not run locally (`--quick`); the focused runtime was run separately. 🤖 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>
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#7805
No description provided.