[PR #2845] [MERGED] The structure pieces ask isSolidRender, not the collision cube #4652

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/2845
Author: @levzzz5154
Created: 10/27/2026
Status: ✅ Merged
Merged: 10/29/2026
Merged by: @ludovic111

Base: main ← Head: fix/structure-solid-render


📝 Commits (1)

  • 2dc154f The structure pieces ask isSolidRender, not the collision cube

📊 Changes

3 files changed (+150 additions, -30 deletions)

View changed files

📝 crates/horizon-world/src/worldgen/generator_decoration.rs (+7 -0)
📝 crates/horizon-world/src/worldgen/structure/legacy.rs (+140 -30)
📝 crates/horizon-world/src/worldgen/structure/start.rs (+3 -0)

📄 Description

🤖 Opened by levzzz5154's AI agent (Claude Code), not by levzzz5154 himself.

What and why

The legacy structure pieces asked "is the collision shape a full block"
for the blocks around them. That is a different set of blocks than
vanilla's BlockState.isSolidRender:

Block isSolidRender (vanilla) full collision (Horizon)
glass, leaves, ice, spawner, barrier no yes
soul sand, mud yes no

The two places that asked it are StructurePiece.reorient (the facing of
a chest in the desert and jungle temples, the strongholds, the fortresses
and the buried treasure) and the mineshaft's floor check (the rails on a
floor that is not air). A chest next to glass, leaves or a spawner took a
different facing than vanilla's, and a mineshaft's rail was placed on a
floor vanilla would not have put one on.

Horizon already has the right flag: the worldgen keeps every state's
BlockProperty::SolidRender for each state (the exporter writes it from
state.isSolidRender()), and the monster room's own copy of reorient
already asks it. The structure pieces now ask the same flag:

  • PieceContext carries the blocks' facts, and legacy::solid_render is
    BlockState.isSolidRender of a state, not "a full collision cube that
    is not a liquid".
  • The chest's facing is decided in reorient_facing, which takes the four
    horizontal neighbours and the flag source, so the rule can be checked
    against vanilla's.

The exported full_block table stays: it is StructureTemplate's
ordering class (the lava check in the processors and the template
placement still use it).

Fixes #2788

Vanilla reference

  • net.minecraft.world.level.levelgen.structure.StructurePiece.reorient
    (26.3, lines 407-448): the chest's facing from the blocks around it.
    It asks state.isSolidRender() of every horizontal neighbour (the
    checks at the if (state.isSolidRender()) lines), and it keeps the
    state when a chest is next to it.
  • net.minecraft.world.level.block.state.BlockBehaviour$BlockStateBase.isSolidRender
    (line 660) and the field it returns (line 516):
    this.solidRender = Block.isShapeFullBlock(this.occlusionShape); —
    the state's occlusion shape, not its collision shape. That is why
    glass and leaves are not solid to render while soul sand and mud are.
  • net.minecraft.world.level.levelgen.structure.mineshaft.MineShaftCorridor
    (createChest's floor check): the rail goes on a floor that is not air
    and is solid to render.
  • The exporter Horizon reads: VanillaGameplayFactsExporter.java writes
    state.isSolidRender() as the solid_render property, and the
    worldgen's BlockProperty::SolidRender is that property.

Self-check

pr_ready (tools/pr_ready.py --quick --base upstream/main on cachyos-x8664, against upstream/main at 21123aaa3, 3 min 48 s)

Check Result
Scope ✅ 3 files, +150 −30
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 336 passed (19 s)
rustfmt ✅ (7 s)
clippy ✅ (1 min 50 s)
tests: horizon-world ✅ 259 passed (1 min 16 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 ➖ 119 affected, to run in CI (--quick): arrow, attribute_updates, auto_jump, bamboo, biome_weather, block_blob, block_column, block_entity_anim, block_entity_render, block_entity_tickers, block_particles, block_pile and 107 more
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)
  • cargo test -p horizon-world --lib -- legacy::tests

    running 3 tests
    test worldgen::structure::legacy::tests::a_chest_next_to_a_chest_keeps_its_facing ... ok
    test worldgen::structure::legacy::tests::two_solid_neighbours_turn_the_chest_away_from_one_of_them ... ok
    test worldgen::structure::legacy::tests::a_chest_next_to_glass_faces_away_from_the_stone ... ok
    
    test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 178 filtered out; finished in 0.00s
    

    The first test is vanilla's rule with vanilla's data: a chest with
    glass to the north and stone to the east faces west, because glass does
    not draw as solid. With the old "full collision cube" the glass counted
    as solid as well, the two solid neighbours cancelled each other and the
    chest faced south — the old answer, and the wrong one.

  • cargo test -p horizon-world --lib -- structure:: — 46 passed, 0 failed
    (the whole structure module).

  • cargo check --workspace --all-targets — no errors, no warnings.

  • cargo fmt -p horizon-world — the tree is rustfmt-clean.

  • cargo clippy -p horizon-world --all-targets — nothing in the files this
    pull request touches.

🤖 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/2845 **Author:** [@levzzz5154](https://github.com/levzzz5154) **Created:** 10/27/2026 **Status:** ✅ Merged **Merged:** 10/29/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/structure-solid-render` --- ### 📝 Commits (1) - [`2dc154f`](https://github.com/horizon-rust/horizon/commit/2dc154ff7f7356e5369d63498b4540d14811fb1b) The structure pieces ask isSolidRender, not the collision cube ### 📊 Changes **3 files changed** (+150 additions, -30 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-world/src/worldgen/generator_decoration.rs` (+7 -0) 📝 `crates/horizon-world/src/worldgen/structure/legacy.rs` (+140 -30) 📝 `crates/horizon-world/src/worldgen/structure/start.rs` (+3 -0) </details> ### 📄 Description > 🤖 Opened by levzzz5154's AI agent (Claude Code), not by levzzz5154 himself. ## What and why The legacy structure pieces asked "is the collision shape a full block" for the blocks around them. That is a different set of blocks than vanilla's `BlockState.isSolidRender`: | Block | `isSolidRender` (vanilla) | full collision (Horizon) | |---|---|---| | glass, leaves, ice, spawner, barrier | no | yes | | soul sand, mud | yes | no | The two places that asked it are `StructurePiece.reorient` (the facing of a chest in the desert and jungle temples, the strongholds, the fortresses and the buried treasure) and the mineshaft's floor check (the rails on a floor that is not air). A chest next to glass, leaves or a spawner took a different facing than vanilla's, and a mineshaft's rail was placed on a floor vanilla would not have put one on. Horizon already has the right flag: the worldgen keeps every state's `BlockProperty::SolidRender` for each state (the exporter writes it from `state.isSolidRender()`), and the monster room's own copy of `reorient` already asks it. The structure pieces now ask the same flag: - `PieceContext` carries the blocks' facts, and `legacy::solid_render` is `BlockState.isSolidRender` of a state, not "a full collision cube that is not a liquid". - The chest's facing is decided in `reorient_facing`, which takes the four horizontal neighbours and the flag source, so the rule can be checked against vanilla's. The exported `full_block` table stays: it is `StructureTemplate`'s ordering class (the lava check in the processors and the template placement still use it). Fixes #2788 ## Vanilla reference - `net.minecraft.world.level.levelgen.structure.StructurePiece.reorient` (26.3, lines 407-448): the chest's facing from the blocks around it. It asks `state.isSolidRender()` of every horizontal neighbour (the checks at the `if (state.isSolidRender())` lines), and it keeps the state when a chest is next to it. - `net.minecraft.world.level.block.state.BlockBehaviour$BlockStateBase.isSolidRender` (line 660) and the field it returns (line 516): `this.solidRender = Block.isShapeFullBlock(this.occlusionShape);` — the state's *occlusion* shape, not its collision shape. That is why glass and leaves are not solid to render while soul sand and mud are. - `net.minecraft.world.level.levelgen.structure.mineshaft.MineShaftCorridor` (`createChest`'s floor check): the rail goes on a floor that is not air and is solid to render. - The exporter Horizon reads: `VanillaGameplayFactsExporter.java` writes `state.isSolidRender()` as the `solid_render` property, and the worldgen's `BlockProperty::SolidRender` is that property. ## Self-check **pr_ready** (`tools/pr_ready.py --quick --base upstream/main` on cachyos-x8664, against upstream/main at 21123aaa3, 3 min 48 s) | Check | Result | | --- | --- | | Scope | ✅ 3 files, +150 −30 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 336 passed (19 s) | | rustfmt | ✅ (7 s) | | clippy | ✅ (1 min 50 s) | | tests: horizon-world | ✅ 259 passed (1 min 16 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 | ➖ 119 affected, to run in CI (--quick): arrow, attribute_updates, auto_jump, bamboo, biome_weather, block_blob, block_column, block_entity_anim, block_entity_render, block_entity_tickers, block_particles, block_pile and 107 more | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | * `cargo test -p horizon-world --lib -- legacy::tests` ``` running 3 tests test worldgen::structure::legacy::tests::a_chest_next_to_a_chest_keeps_its_facing ... ok test worldgen::structure::legacy::tests::two_solid_neighbours_turn_the_chest_away_from_one_of_them ... ok test worldgen::structure::legacy::tests::a_chest_next_to_glass_faces_away_from_the_stone ... ok test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 178 filtered out; finished in 0.00s ``` The first test is vanilla's rule with vanilla's data: a chest with glass to the north and stone to the east faces west, because glass does not draw as solid. With the old "full collision cube" the glass counted as solid as well, the two solid neighbours cancelled each other and the chest faced south — the old answer, and the wrong one. * `cargo test -p horizon-world --lib -- structure::` — 46 passed, 0 failed (the whole structure module). * `cargo check --workspace --all-targets` — no errors, no warnings. * `cargo fmt -p horizon-world` — the tree is rustfmt-clean. * `cargo clippy -p horizon-world --all-targets` — nothing in the files this pull request touches. 🤖 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 05:06:57 +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#4652
No description provided.