[PR #5509] [MERGED] A superflat world runs its structure sets on its flat ground #6326

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/5509
Author: @xFedeT
Created: 10/31/2026
Status: ✅ Merged
Merged: 11/1/2026
Merged by: @ludovic111

Base: main ← Head: feat/superflat-structures


📝 Commits (7)

  • b903c95 A superflat world runs its structure sets on its flat ground
  • 9e583e5 Merge remote-tracking branch 'origin/main' into feat/superflat-structures
  • 619c8d0 Merge remote-tracking branch 'origin/main' into feat/superflat-structures
  • 79315a5 Superflat: stronghold ring seed 0, flat sea level and height, null layers, no creature packs
  • 23a3432 Superflat: fixed-biome ring search, lenient overrides and biome, fallbacks, no far decoration
  • 22a2632 Merge remote-tracking branch 'origin/main' into feat/superflat-structures
  • 26d6105 Superflat: strongholds and mineshafts use the generator's minimum Y

📊 Changes

11 files changed (+750 additions, -13 deletions)

View changed files

📝 crates/horizon-client/src/flatgen.rs (+109 -0)
📝 crates/horizon-client/src/game/natural_spawning.rs (+4 -0)
📝 crates/horizon-client/src/game/world_loading.rs (+52 -1)
📝 crates/horizon-client/src/mod_content_tests.rs (+183 -0)
📝 crates/horizon-client/src/vanillagen.rs (+48 -2)
📝 crates/horizon-client/src/vanillagen/lod.rs (+6 -0)
📝 crates/horizon-world/src/worldgen/generator.rs (+241 -3)
📝 crates/horizon-world/src/worldgen/generator_decoration.rs (+34 -0)
📝 crates/horizon-world/src/worldgen/generator_structures.rs (+46 -5)
📝 crates/horizon-world/src/worldgen/structure/start.rs (+7 -2)
📝 crates/horizon-world/src/worldgen/structure/stronghold.rs (+20 -0)

📄 Description

🤖 Opened by xFedeT's AI agent (Claude Code, Claude Sonnet 5.5), not by xFedeT personally.

Part of #3517: the FlatLevelSource.createState row. A superflat world generated no structures at all: flatgen.rs skips the structure steps, so the default Superflat's structure_overrides (strongholds and villages) did nothing.

Vanilla

  • FlatLevelSource.createState builds the structure state with ChunkGeneratorStructureState.createForFlat: the structure sets structure_overrides names (every set when the key is absent, none when it is []), a FixedBiomeSource of the settings' biome, the flat origin.
  • getBaseHeight and getBaseColumn come from the layers: the first layer from the top that is null (adjustGenerationSettings replaces a layer that is not opaque to MOTION_BLOCKING by null, to fill it later) or opaque to the heightmap gives the height, and the air above counts as free.
  • buildTerrain fills the layers and nothing else. adjustGenerationSettings drops the structure steps and the lakes step from the biome's features and, without features, all of them.

What changes

  • OverworldGenerator::flat(data, seed, FlatSettings, structures) (horizon-world): the generator pipeline of the overworld with a fixed biome and a flat layers field. The noise column the structure queries read is the layers (so base_height, base_column and the column blocks follow vanilla's definitions, including the null layers), the terrain stage writes them instead of running noise, surface and carvers, the far-terrain sample is the top layer, and the structure sets are restricted to the overrides (StructureState::restrict_to). The decoration keeps its steps (structures place in them) with no placed features, as a flat world without features.
  • VanillaTerrain::for_flat and FlatTerrain::structure_settings: a flat overworld whose settings let a structure set generate, and whose biome is not the void (its platform is a feature the flat generator places), uses it when generate_structures is on; /locate, structure maps and references work as on a normal world. The other flat worlds keep FlatTerrain.

What it does not do

The flat world's own placed features (features: true) and lakes are still not placed: that is a gap of its own in flatgen.rs and is not touched here.

Verification

  • a_superflat_world_runs_its_structure_sets_on_flat_ground (content root): a plains village and a stronghold are found by locate, a mineshaft (not in the overrides) is not, and the layers stand where they should (bedrock, two dirt, grass, air above). a_flat_world_names_the_structure_sets_that_may_generate (settings parsing).
  • Parity chunk_generation, decoration_region, structure_density, structure_layout, structure_start_nbt and worldgen pass (the normal pipeline's code is only branched on flat).
  • A real run on the server thread (a classic Superflat world, creative, spectator camera above the village /locate structure minecraft:village_plains found): a full plains village with its paths, houses, well, farm and villagers on the flat grass.

a village on superflat

  • pr_ready --quick: rustfmt, clippy, Python tests and the content root tests pass. The only failures are the 13 lan_bot tests, which fail the same way on a clean origin/main here. The diff is 616 lines, mostly tests and comments; the generator and the client side do not ship apart.

🤖 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/5509 **Author:** [@xFedeT](https://github.com/xFedeT) **Created:** 10/31/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/superflat-structures` --- ### 📝 Commits (7) - [`b903c95`](https://github.com/horizon-rust/horizon/commit/b903c951420529bdf3e58f56883baa56637f95a3) A superflat world runs its structure sets on its flat ground - [`9e583e5`](https://github.com/horizon-rust/horizon/commit/9e583e564439e9076327e94dcb023e259ec51a03) Merge remote-tracking branch 'origin/main' into feat/superflat-structures - [`619c8d0`](https://github.com/horizon-rust/horizon/commit/619c8d000bd9f3487967903361c3ac3d047cc8b4) Merge remote-tracking branch 'origin/main' into feat/superflat-structures - [`79315a5`](https://github.com/horizon-rust/horizon/commit/79315a5de306a332046e0055ce67353a36b02e0b) Superflat: stronghold ring seed 0, flat sea level and height, null layers, no creature packs - [`23a3432`](https://github.com/horizon-rust/horizon/commit/23a34328c7a0b55244314e0a5204554e7bf3eb2f) Superflat: fixed-biome ring search, lenient overrides and biome, fallbacks, no far decoration - [`22a2632`](https://github.com/horizon-rust/horizon/commit/22a2632d61f5e01ddd71202e45199ed53e6f2e0a) Merge remote-tracking branch 'origin/main' into feat/superflat-structures - [`26d6105`](https://github.com/horizon-rust/horizon/commit/26d61054f7392b9e22ca512b9d150b3de7787a0b) Superflat: strongholds and mineshafts use the generator's minimum Y ### 📊 Changes **11 files changed** (+750 additions, -13 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/flatgen.rs` (+109 -0) 📝 `crates/horizon-client/src/game/natural_spawning.rs` (+4 -0) 📝 `crates/horizon-client/src/game/world_loading.rs` (+52 -1) 📝 `crates/horizon-client/src/mod_content_tests.rs` (+183 -0) 📝 `crates/horizon-client/src/vanillagen.rs` (+48 -2) 📝 `crates/horizon-client/src/vanillagen/lod.rs` (+6 -0) 📝 `crates/horizon-world/src/worldgen/generator.rs` (+241 -3) 📝 `crates/horizon-world/src/worldgen/generator_decoration.rs` (+34 -0) 📝 `crates/horizon-world/src/worldgen/generator_structures.rs` (+46 -5) 📝 `crates/horizon-world/src/worldgen/structure/start.rs` (+7 -2) 📝 `crates/horizon-world/src/worldgen/structure/stronghold.rs` (+20 -0) </details> ### 📄 Description > 🤖 Opened by xFedeT's AI agent (Claude Code, Claude Sonnet 5.5), not by xFedeT personally. Part of #3517: the `FlatLevelSource.createState` row. A superflat world generated no structures at all: `flatgen.rs` skips the structure steps, so the default Superflat's `structure_overrides` (strongholds and villages) did nothing. ## Vanilla - `FlatLevelSource.createState` builds the structure state with `ChunkGeneratorStructureState.createForFlat`: the structure sets `structure_overrides` names (every set when the key is absent, none when it is `[]`), a `FixedBiomeSource` of the settings' biome, the flat origin. - `getBaseHeight` and `getBaseColumn` come from the layers: the first layer from the top that is `null` (`adjustGenerationSettings` replaces a layer that is not opaque to `MOTION_BLOCKING` by `null`, to fill it later) or opaque to the heightmap gives the height, and the air above counts as free. - `buildTerrain` fills the layers and nothing else. `adjustGenerationSettings` drops the structure steps and the lakes step from the biome's features and, without `features`, all of them. ## What changes - `OverworldGenerator::flat(data, seed, FlatSettings, structures)` (`horizon-world`): the generator pipeline of the overworld with a fixed biome and a `flat` layers field. The noise column the structure queries read is the layers (so `base_height`, `base_column` and the column blocks follow vanilla's definitions, including the `null` layers), the terrain stage writes them instead of running noise, surface and carvers, the far-terrain sample is the top layer, and the structure sets are restricted to the overrides (`StructureState::restrict_to`). The decoration keeps its steps (structures place in them) with no placed features, as a flat world without `features`. - `VanillaTerrain::for_flat` and `FlatTerrain::structure_settings`: a flat overworld whose settings let a structure set generate, and whose biome is not the void (its platform is a feature the flat generator places), uses it when `generate_structures` is on; `/locate`, structure maps and references work as on a normal world. The other flat worlds keep `FlatTerrain`. ## What it does not do The flat world's own placed features (`features: true`) and lakes are still not placed: that is a gap of its own in `flatgen.rs` and is not touched here. ## Verification - `a_superflat_world_runs_its_structure_sets_on_flat_ground` (content root): a plains village and a stronghold are found by `locate`, a mineshaft (not in the overrides) is not, and the layers stand where they should (bedrock, two dirt, grass, air above). `a_flat_world_names_the_structure_sets_that_may_generate` (settings parsing). - Parity `chunk_generation`, `decoration_region`, `structure_density`, `structure_layout`, `structure_start_nbt` and `worldgen` pass (the normal pipeline's code is only branched on `flat`). - A real run on the server thread (a classic Superflat world, creative, spectator camera above the village `/locate structure minecraft:village_plains` found): a full plains village with its paths, houses, well, farm and villagers on the flat grass. ![a village on superflat](https://raw.githubusercontent.com/xFedeT/horizon/pr-screenshots/3517/superflat-village.png) - `pr_ready --quick`: rustfmt, clippy, Python tests and the content root tests pass. The only failures are the 13 `lan_bot` tests, which fail the same way on a clean `origin/main` here. The diff is 616 lines, mostly tests and comments; the generator and the client side do not ship apart. 🤖 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 06:18:17 +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#6326
No description provided.