[PR #6842] [MERGED] Port map: the flat and debug generators are ported, not missing #7133

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

📋 Pull Request Information

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

Base: main ← Head: fix/ledger-levelgen-flat-debug


📝 Commits (1)

  • 80cc16e port map: the flat and debug generators are ported, not missing

📊 Changes

1 file changed (+5 additions, -5 deletions)

View changed files

📝 tools/port_map/levelgen-1.tsv (+5 -5)

📄 Description

FlatLevelSource is a chunk generator of its own. buildTerrain stacks the layers; getBaseHeight and getBaseColumn answer from those layers, where a layer that is not opaque to MOTION_BLOCKING is null (skipped as a height, air as a column); and createState builds the structure state from structure_overrides with ChunkGeneratorStructureState.createForFlat, so the classic Superflat preset's villages and strongholds generate on the flat ground. DebugLevelSource is the other small generator: one of every block state in a square grid at y 70 above a barrier floor at y 60. WorldDimensions.specialWorldProperty reports FLAT or DEBUG from the overworld's generator type.

tools/port_map/levelgen-1.tsv still called all of that missing:

  • DebugLevelSource — "debug_all_block_states preset falls back to a normal world (dedicated.rs warns)". The tree has crates/horizon-client/src/debugworld.rs: DebugTerrain is the grid (HEIGHT 70, BARRIER_HEIGHT 60, state_for is getBlockStateFor, grid is GRID_WIDTH/GRID_HEIGHT), picked for the overworld in game/world_loading.rs, and save.rs reads the preset back as minecraft:debug_all_block_states.
  • FlatLevelSource.createState — "flat worlds get no structure state: the default Superflat villages and strongholds never generate". flatgen::FlatTerrain::structure_settings reads the layers, the fixed biome and structure_overrides, and VanillaTerrain::for_flat runs those sets on the flat ground (OverworldGenerator::flat, the stronghold rings searched with seed 0, none when structure_overrides is empty).
  • FlatLevelSource.getBaseHeight and getBaseColumn — "no flat base-height query; nothing needs it while flat has no structures". The flat arm of generator::Pipeline::noise_column answers both from the layers, and Pipeline::base_height, base_column and noise_blocks are the three queries built on it.
  • WorldDimensions.specialWorldProperty — "flat flag only; there is no debug world". save::WorldGen::read reads the preset back through WorldPreset::of_generator: Flat for minecraft:flat, Debug for minecraft:debug, else Normal.

No row of the file is missing after these five: every vanilla method levelgen-1.tsv names is a port, an inline fold, or a skip with a reason.

Proven:

  • python3 tools/port_ledger.py map-check tools/port_map/levelgen-1.tsv → 104 rows, no problems. (the first run of the edit caught the class row's verdict; DebugLevelSource is a home row, as DebugStickItem is)
  • cargo test -q -p horizon-client-lib --lib debugworld → 1 passed; 0 failed (the grid holds a state every other block)
  • cargo test -q -p horizon-client-lib --lib flatgen → 4 passed; 0 failed (the generator settings, and the structure sets a flat world may generate)
  • cargo test -q -p horizon-client-lib --lib -- --ignored --exact mod_content::tests::a_superflat_world_runs_its_structure_sets_on_flat_ground → 1 passed; 0 failed in 6.56 s: a plains village and a stronghold are found on the flat ground and a mineshaft is not, and the layers read bedrock, two dirt and grass from the level's minimum Y
  • no Rust file changed (one TSV), so there is no clippy or rustfmt surface

Not proven:

  • I did not open a Superflat or a Debug world in the game: the in-game check (a village standing on the flat ground, the block-state grid under a barrier floor) is still owed.
  • The other 99 rows of the file were not re-derived method by method; the verdicts I did not change were checked only for dangling paths, which map-check reports clean.

🔄 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/6842 **Author:** [@MSedgeMC](https://github.com/MSedgeMC) **Created:** 11/2/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/ledger-levelgen-flat-debug` --- ### 📝 Commits (1) - [`80cc16e`](https://github.com/horizon-rust/horizon/commit/80cc16e4122ebb0dfc201f118ceadeeeca7410a9) port map: the flat and debug generators are ported, not missing ### 📊 Changes **1 file changed** (+5 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `tools/port_map/levelgen-1.tsv` (+5 -5) </details> ### 📄 Description `FlatLevelSource` is a chunk generator of its own. `buildTerrain` stacks the layers; `getBaseHeight` and `getBaseColumn` answer from those layers, where a layer that is not opaque to `MOTION_BLOCKING` is `null` (skipped as a height, air as a column); and `createState` builds the structure state from `structure_overrides` with `ChunkGeneratorStructureState.createForFlat`, so the classic Superflat preset's villages and strongholds generate on the flat ground. `DebugLevelSource` is the other small generator: one of every block state in a square grid at y 70 above a barrier floor at y 60. `WorldDimensions.specialWorldProperty` reports FLAT or DEBUG from the overworld's generator type. `tools/port_map/levelgen-1.tsv` still called all of that missing: - `DebugLevelSource` — "debug_all_block_states preset falls back to a normal world (dedicated.rs warns)". The tree has `crates/horizon-client/src/debugworld.rs`: `DebugTerrain` is the grid (`HEIGHT` 70, `BARRIER_HEIGHT` 60, `state_for` is `getBlockStateFor`, `grid` is `GRID_WIDTH`/`GRID_HEIGHT`), picked for the overworld in `game/world_loading.rs`, and `save.rs` reads the preset back as `minecraft:debug_all_block_states`. - `FlatLevelSource.createState` — "flat worlds get no structure state: the default Superflat villages and strongholds never generate". `flatgen::FlatTerrain::structure_settings` reads the layers, the fixed biome and `structure_overrides`, and `VanillaTerrain::for_flat` runs those sets on the flat ground (`OverworldGenerator::flat`, the stronghold rings searched with seed 0, none when `structure_overrides` is empty). - `FlatLevelSource.getBaseHeight` and `getBaseColumn` — "no flat base-height query; nothing needs it while flat has no structures". The flat arm of `generator::Pipeline::noise_column` answers both from the layers, and `Pipeline::base_height`, `base_column` and `noise_blocks` are the three queries built on it. - `WorldDimensions.specialWorldProperty` — "flat flag only; there is no debug world". `save::WorldGen::read` reads the preset back through `WorldPreset::of_generator`: Flat for `minecraft:flat`, Debug for `minecraft:debug`, else Normal. No row of the file is `missing` after these five: every vanilla method `levelgen-1.tsv` names is a port, an inline fold, or a skip with a reason. **Proven:** - `python3 tools/port_ledger.py map-check tools/port_map/levelgen-1.tsv` → `104 rows, no problems.` (the first run of the edit caught the class row's verdict; `DebugLevelSource` is a `home` row, as `DebugStickItem` is) - `cargo test -q -p horizon-client-lib --lib debugworld` → `1 passed; 0 failed` (the grid holds a state every other block) - `cargo test -q -p horizon-client-lib --lib flatgen` → `4 passed; 0 failed` (the generator settings, and the structure sets a flat world may generate) - `cargo test -q -p horizon-client-lib --lib -- --ignored --exact mod_content::tests::a_superflat_world_runs_its_structure_sets_on_flat_ground` → `1 passed; 0 failed` in 6.56 s: a plains village and a stronghold are found on the flat ground and a mineshaft is not, and the layers read bedrock, two dirt and grass from the level's minimum Y - no Rust file changed (one TSV), so there is no clippy or rustfmt surface **Not proven:** - I did not open a Superflat or a Debug world in the game: the in-game check (a village standing on the flat ground, the block-state grid under a barrier floor) is still owed. - The other 99 rows of the file were not re-derived method by method; the verdicts I did not change were checked only for dangling paths, which `map-check` reports clean. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:34:25 +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#7133
No description provided.