[PR #4076] [MERGED] The Void superflat preset gets its stone start platform #5403

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/4076
Author: @d3grando
Created: 10/29/2026
Status: ✅ Merged
Merged: 10/30/2026
Merged by: @levzzz5154

Base: main ← Head: fix-2912-void


📝 Commits (2)

  • 8c1f50f The Void superflat preset gets its stone start platform
  • 8fb961c Merge main; place the void start platform at the generator's own min Y

📊 Changes

2 files changed (+210 additions, -3 deletions)

View changed files

📝 crates/horizon-client-render/src/biome.rs (+16 -0)
📝 crates/horizon-client/src/flatgen.rs (+194 -3)

📄 Description

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

What and why

Part of #2912 (the Void preset item; the other presets' features, lakes and structures stay open).

A new world with the The Void superflat preset had no stone platform, so the player fell out of the world as soon as they spawned. Vanilla decorates a flat world through FlatLevelGeneratorSettings.adjustGenerationSettings. When features is on and the world isn't all air (voidGen), or its biome is the_void, it copies the biome's placed features (leaving out the two structure steps, and the LAKES step when lakes adds the lava lakes). The Void preset is the_void + features: true + one air layer, so it gets the_void's only feature, void_start_platform. That feature is a 33×33 stone square at the minimum Y + 3 (y −61) around 8, 8, with cobblestone at the centre, in the chunks within one of chunk 0, 0. FlatTerrain::proto placed only the layers.

The fix:

  • Biomes (horizon-client-render) keeps each biome's features by step (BiomeGenerationSettings.features).
  • FlatTerrain::from_settings works out the adjusted feature list (decoration_features, following adjustGenerationSettings and updateLayers's voidGen). When minecraft:void_start_platform is in that list, proto places it with the already-ported BasicFeature::VoidStartPlatform at the chunk's section origin, as ChunkGenerator.applyBiomeDecoration does. Placing it in proto gives the same blocks as the FEATURES step because the feature writes only inside its own chunk and draws no random numbers.
  • Every other adjusted feature, the lakes and the structures are still not placed. The from_settings doc says so. They need the full decoration pipeline on flat chunks, which is the larger rest of #2912.

Open PRs nearby: #3486 and #3492 also edit flatgen.rs (#3486 gives FlatTerrain a LevelShape, nearby lines of the imports, struct and proto). The overlap is in text only; whichever lands second needs a small rebase (with #3486, the platform's origin Y would read self.shape.min_y).

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

  • FlatLevelGeneratorSettings.adjustGenerationSettings: the (!voidGen || biome.is(THE_VOID)) && decoration gate, plus the UNDERGROUND_STRUCTURES / SURFACE_STRUCTURES / LAKES (with addLakes) step skips.
  • FlatLevelGeneratorSettings.updateLayers: voidGen is true when every layer is Blocks.AIR.
  • FlatLevelSource gets its generation settings from Util.memoize(settings::adjustGenerationSettings). ChunkGenerator.applyBiomeDecoration places them at the section origin (minimum Y).
  • VoidStartPlatformFeature.place: checked with javap. The Rust port is BasicFeature::VoidStartPlatform, unchanged here and covered by tools/test_basic_feature_parity.py.
  • Data: worldgen/flat_level_generator_preset/the_void.json, worldgen/biome/the_void.json (its features list is void_start_platform at TOP_LAYER_MODIFICATION) and worldgen/placed_feature/void_start_platform.json (biome filter only).
  • New tests:
    • flatgen::tests::the_void_preset_places_the_start_platform checks the platform blocks and edges, and that there is no platform without features.
    • flatgen::tests::adjusted_generation_settings_keep_the_biome_features_outside_structures checks the step filtering and the voidGen / the_void gate.

Self-check

tools/pr_ready.py doesn't run on Windows (it needs SIGHUP), so I ran the steps by hand:

  • cargo fmt --all -- --check: clean.
  • cargo clippy -p horizon-client-render --all-targets -- -D warnings: clean.
  • cargo clippy -p horizon-client --all-targets -- -D warnings: clean.
  • cargo test -p horizon-client --lib flatgen: 3 passed.
  • cargo test -p horizon-client-render --lib biome: 2 passed.
  • Before the fix (main's flatgen.rs and biome.rs with only the new platform test added), cargo test -p horizon-client --lib flatgen fails:
    test flatgen::tests::the_void_preset_places_the_start_platform ... FAILED
    assertion `left == right` failed: [8, -61, 8]
      left: "minecraft:air"
     right: "minecraft:cobblestone"
    
  • python tools/test_basic_feature_parity.py: client: 1,820,614 basic-feature output lines match Rust, server: 1,820,614 ... match Rust, passed.
  • In game, single player with the integrated server on its thread: Singleplayer → World Type: Superflat → Customize → Presets → The Void → Create New World.
    • Before (v0.2.97 build; flatgen.rs hasn't changed since): block 8 -61 8 is air. The player falls and dies ("fell out of the world").
    • After (this branch's fast build): block 8 -61 8 is cobblestone, and 0/−8/24 at y −61 are stone (-9 -61 8 is air). The player spawns on the platform at y −60 with on_ground: true.

Screenshots

before: a new Void superflat world, the player falls out of the world at once

after: the stone platform under the spawn, seen from above

  • Before: the player falls and dies at once with "fell out of the world" on a new The Void world.
  • After: on a new The Void world the player stands on the 33×33 stone platform. Seen from above in spectator mode, it is a stone square floating in the void.

🤖 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/4076 **Author:** [@d3grando](https://github.com/d3grando) **Created:** 10/29/2026 **Status:** ✅ Merged **Merged:** 10/30/2026 **Merged by:** [@levzzz5154](https://github.com/levzzz5154) **Base:** `main` ← **Head:** `fix-2912-void` --- ### 📝 Commits (2) - [`8c1f50f`](https://github.com/horizon-rust/horizon/commit/8c1f50f616436d32b523f82c69fdfd72562bba18) The Void superflat preset gets its stone start platform - [`8fb961c`](https://github.com/horizon-rust/horizon/commit/8fb961c146872b349e44e754a6bf68fe24f7d929) Merge main; place the void start platform at the generator's own min Y ### 📊 Changes **2 files changed** (+210 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/biome.rs` (+16 -0) 📝 `crates/horizon-client/src/flatgen.rs` (+194 -3) </details> ### 📄 Description > 🤖 Opened by d3grando's AI agent (Claude Code, Claude Opus 5.5), not by d3grando personally. ## What and why Part of #2912 (the Void preset item; the other presets' features, lakes and structures stay open). A new world with the **The Void** superflat preset had no stone platform, so the player fell out of the world as soon as they spawned. Vanilla decorates a flat world through `FlatLevelGeneratorSettings.adjustGenerationSettings`. When `features` is on and the world isn't all air (`voidGen`), or its biome is `the_void`, it copies the biome's placed features (leaving out the two structure steps, and the LAKES step when `lakes` adds the lava lakes). The Void preset is `the_void` + `features: true` + one air layer, so it gets `the_void`'s only feature, `void_start_platform`. That feature is a 33×33 stone square at the minimum Y + 3 (y −61) around 8, 8, with cobblestone at the centre, in the chunks within one of chunk 0, 0. `FlatTerrain::proto` placed only the layers. The fix: - `Biomes` (horizon-client-render) keeps each biome's `features` by step (`BiomeGenerationSettings.features`). - `FlatTerrain::from_settings` works out the adjusted feature list (`decoration_features`, following `adjustGenerationSettings` and `updateLayers`'s `voidGen`). When `minecraft:void_start_platform` is in that list, `proto` places it with the already-ported `BasicFeature::VoidStartPlatform` at the chunk's section origin, as `ChunkGenerator.applyBiomeDecoration` does. Placing it in `proto` gives the same blocks as the FEATURES step because the feature writes only inside its own chunk and draws no random numbers. - Every other adjusted feature, the lakes and the structures are still not placed. The `from_settings` doc says so. They need the full decoration pipeline on flat chunks, which is the larger rest of #2912. **Open PRs nearby:** #3486 and #3492 also edit `flatgen.rs` (#3486 gives `FlatTerrain` a `LevelShape`, nearby lines of the imports, struct and `proto`). The overlap is in text only; whichever lands second needs a small rebase (with #3486, the platform's origin Y would read `self.shape.min_y`). ## 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 - `FlatLevelGeneratorSettings.adjustGenerationSettings`: the `(!voidGen || biome.is(THE_VOID)) && decoration` gate, plus the UNDERGROUND_STRUCTURES / SURFACE_STRUCTURES / LAKES (with `addLakes`) step skips. - `FlatLevelGeneratorSettings.updateLayers`: `voidGen` is true when every layer is `Blocks.AIR`. - `FlatLevelSource` gets its generation settings from `Util.memoize(settings::adjustGenerationSettings)`. `ChunkGenerator.applyBiomeDecoration` places them at the section origin (minimum Y). - `VoidStartPlatformFeature.place`: checked with javap. The Rust port is `BasicFeature::VoidStartPlatform`, unchanged here and covered by `tools/test_basic_feature_parity.py`. - Data: `worldgen/flat_level_generator_preset/the_void.json`, `worldgen/biome/the_void.json` (its features list is `void_start_platform` at TOP_LAYER_MODIFICATION) and `worldgen/placed_feature/void_start_platform.json` (biome filter only). - New tests: - `flatgen::tests::the_void_preset_places_the_start_platform` checks the platform blocks and edges, and that there is no platform without `features`. - `flatgen::tests::adjusted_generation_settings_keep_the_biome_features_outside_structures` checks the step filtering and the `voidGen` / the_void gate. ## Self-check `tools/pr_ready.py` doesn't run on Windows (it needs SIGHUP), so I ran the steps by hand: - `cargo fmt --all -- --check`: clean. - `cargo clippy -p horizon-client-render --all-targets -- -D warnings`: clean. - `cargo clippy -p horizon-client --all-targets -- -D warnings`: clean. - `cargo test -p horizon-client --lib flatgen`: 3 passed. - `cargo test -p horizon-client-render --lib biome`: 2 passed. - Before the fix (main's `flatgen.rs` and `biome.rs` with only the new platform test added), `cargo test -p horizon-client --lib flatgen` fails: ``` test flatgen::tests::the_void_preset_places_the_start_platform ... FAILED assertion `left == right` failed: [8, -61, 8] left: "minecraft:air" right: "minecraft:cobblestone" ``` - `python tools/test_basic_feature_parity.py`: `client: 1,820,614 basic-feature output lines match Rust`, `server: 1,820,614 ... match Rust`, passed. - In game, single player with the integrated server on its thread: Singleplayer → World Type: Superflat → Customize → Presets → The Void → Create New World. - Before (v0.2.97 build; `flatgen.rs` hasn't changed since): `block 8 -61 8` is air. The player falls and dies ("fell out of the world"). - After (this branch's `fast` build): `block 8 -61 8` is cobblestone, and 0/−8/24 at y −61 are stone (`-9 -61 8` is air). The player spawns on the platform at y −60 with `on_ground: true`. ## Screenshots ![before: a new Void superflat world, the player falls out of the world at once](https://raw.githubusercontent.com/d3grando/horizon/pr-assets/2912-void-1.png) ![after: the stone platform under the spawn, seen from above](https://raw.githubusercontent.com/d3grando/horizon/pr-assets/2912-void-2.png) - Before: the player falls and dies at once with "fell out of the world" on a new The Void world. - After: on a new The Void world the player stands on the 33×33 stone platform. Seen from above in spectator mode, it is a stone square floating in the void. 🤖 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:12:21 +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#5403
No description provided.