[PR #919] [MERGED] Structures: Repurposed Structures' three rule tests (matter phase, piece-origin distance, height) #2912

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/919
Author: @ludovic111
Created: 10/18/2026
Status: ✅ Merged
Merged: 10/18/2026
Merged by: @ludovic111

Base: main ← Head: feat/structure-rule-tests


📝 Commits (1)

  • d634870 Structures: Repurposed's matter phase, piece origin and y value rule tests

📊 Changes

7 files changed (+342 additions, -42 deletions)

View changed files

📝 crates/horizon-world/src/block_properties.rs (+19 -4)
📝 crates/horizon-world/src/worldgen/block_feature.rs (+3 -0)
📝 crates/horizon-world/src/worldgen/fluid_predicate.rs (+3 -0)
📝 crates/horizon-world/src/worldgen/generator_structures.rs (+9 -1)
📝 crates/horizon-world/src/worldgen/rule_test.rs (+88 -1)
📝 crates/horizon-world/src/worldgen/structure/processor.rs (+143 -36)
📝 crates/horizon-world/tests/rule_test_bounds.rs (+77 -0)

📄 Description

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

What

Repurposed Structures' mineshafts and Nether monument test blocks with three rule tests of the mod's own, inside vanilla rule processors. The game now runs them under its own types, with the mod's fields:

  • horizon:matter_phase (MatterPhaseRuleTest): SOLID (not air, no fluid, canOcclude), LIQUID, AIR, AIR_RAIL_OR_CHAIN, LIQUID_RAIL_OR_CHAIN (26.3's iron chain), with invert_condition. A rule test on the block in the template or in the world.
  • horizon:piece_origin_axis_aligned_linear_pos (PieceOriginAxisAlignedLinearPosRuleTest): vanilla's axis-aligned linear chance over the block's distance from its template's origin (vanilla's measures from the piece's position in the world). Refuses an empty distance range or an unknown axis, as the mod does.
  • horizon:y_value (YValuePosRuleTest): the block's world height in min_y_value..=max_y_value.

To read canOcclude, structure processors now bind the block properties (BlockPropertiesRegistry::bind_can_occlude, a fifth flag bit next to solid, replaceable, liquid and solid render). Vanilla data never names these types.

Why

Vanilla, and the game, refuse a processor list naming a type they do not know, and with it every pool naming the list. In a ported All the Mods 10, Repurposed's 5 Nether mineshaft start pools never load, and its overworld mineshafts and Nether monument need them too.

The carry side (renaming the mod's types to these) is #920. Merge this one first.

Measured (All the Mods 10's carried mods, seed 1234, chunks -64..63, with the carry PR)

before after
Pools that fail to decode (Nether) 5 (Repurposed's mineshafts) 0
Nether starts 513 560 (+47 Repurposed mineshafts: Nether 22, crimson 11, soul 8, basalt 4, warped 2)
Nether pieces 5,364 72,467

The mineshafts sit under the lava sea (y 2 to 34) and decorate with their spawners.

Self-check

  • cargo fmt --check: clean
  • cargo clippy -p horizon-world -p horizon-port-pack --all-targets -- -D warnings: clean (workspace clippy runs on the integration of this agent's PRs)
  • cargo test -p horizon-world --lib processor, --test rule_test_bounds: pass. New: repurposed_position_rules, matter_phase_matches_what_a_block_is_made_of.
  • Vanilla structure-start oracle (seed 1234, chunks -24..23): 35 of 35 match
  • Parity harnesses closest to the change: basic_feature, block_properties, decorated_region, decoration, decoration_region, feature_catalog, feature_placement, feature_region, scattered_ore, structure_density, tree_feature, worldgen: 12 passed, 0 failed (31.4 min). The full --changed set (299 harnesses) runs once on the integration of this agent's game-side PRs; the result goes in a comment here.

Nothing here needs Ludovic. Mod jars, decompiled code and carried data stay local.

🤖 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/919 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/18/2026 **Status:** ✅ Merged **Merged:** 10/18/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/structure-rule-tests` --- ### 📝 Commits (1) - [`d634870`](https://github.com/horizon-rust/horizon/commit/d634870f1569cac382b38ceaebec541f13f24833) Structures: Repurposed's matter phase, piece origin and y value rule tests ### 📊 Changes **7 files changed** (+342 additions, -42 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-world/src/block_properties.rs` (+19 -4) 📝 `crates/horizon-world/src/worldgen/block_feature.rs` (+3 -0) 📝 `crates/horizon-world/src/worldgen/fluid_predicate.rs` (+3 -0) 📝 `crates/horizon-world/src/worldgen/generator_structures.rs` (+9 -1) 📝 `crates/horizon-world/src/worldgen/rule_test.rs` (+88 -1) 📝 `crates/horizon-world/src/worldgen/structure/processor.rs` (+143 -36) 📝 `crates/horizon-world/tests/rule_test_bounds.rs` (+77 -0) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. ## What Repurposed Structures' mineshafts and Nether monument test blocks with three rule tests of the mod's own, inside vanilla `rule` processors. The game now runs them under its own types, with the mod's fields: - `horizon:matter_phase` (MatterPhaseRuleTest): `SOLID` (not air, no fluid, canOcclude), `LIQUID`, `AIR`, `AIR_RAIL_OR_CHAIN`, `LIQUID_RAIL_OR_CHAIN` (26.3's iron chain), with `invert_condition`. A rule test on the block in the template or in the world. - `horizon:piece_origin_axis_aligned_linear_pos` (PieceOriginAxisAlignedLinearPosRuleTest): vanilla's axis-aligned linear chance over the block's distance from its template's origin (vanilla's measures from the piece's position in the world). Refuses an empty distance range or an unknown axis, as the mod does. - `horizon:y_value` (YValuePosRuleTest): the block's world height in `min_y_value..=max_y_value`. To read canOcclude, structure processors now bind the block properties (`BlockPropertiesRegistry::bind_can_occlude`, a fifth flag bit next to solid, replaceable, liquid and solid render). Vanilla data never names these types. ## Why Vanilla, and the game, refuse a processor list naming a type they do not know, and with it every pool naming the list. In a ported All the Mods 10, Repurposed's 5 Nether mineshaft start pools never load, and its overworld mineshafts and Nether monument need them too. The carry side (renaming the mod's types to these) is #920. Merge this one first. ## Measured (All the Mods 10's carried mods, seed 1234, chunks -64..63, with the carry PR) | | before | after | |---|---|---| | Pools that fail to decode (Nether) | 5 (Repurposed's mineshafts) | 0 | | Nether starts | 513 | 560 (+47 Repurposed mineshafts: Nether 22, crimson 11, soul 8, basalt 4, warped 2) | | Nether pieces | 5,364 | 72,467 | The mineshafts sit under the lava sea (y 2 to 34) and decorate with their spawners. ## Self-check - `cargo fmt --check`: clean - `cargo clippy -p horizon-world -p horizon-port-pack --all-targets -- -D warnings`: clean (workspace clippy runs on the integration of this agent's PRs) - `cargo test -p horizon-world --lib processor`, `--test rule_test_bounds`: pass. New: `repurposed_position_rules`, `matter_phase_matches_what_a_block_is_made_of`. - Vanilla structure-start oracle (seed 1234, chunks -24..23): 35 of 35 match - Parity harnesses closest to the change: basic_feature, block_properties, decorated_region, decoration, decoration_region, feature_catalog, feature_placement, feature_region, scattered_ore, structure_density, tree_feature, worldgen: 12 passed, 0 failed (31.4 min). The full `--changed` set (299 harnesses) runs once on the integration of this agent's game-side PRs; the result goes in a comment here. Nothing here needs Ludovic. Mod jars, decompiled code and carried data stay local. 🤖 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-02 16:00:03 +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#2912
No description provided.