[PR #5502] [MERGED] Content mods: place mod features in biomes (biome modifiers) #6321

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

📋 Pull Request Information

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

Base: main ← Head: mods/biome-modifiers


📝 Commits (4)

  • 1fedaa1 Content mods: place mod features in biomes (biome modifiers)
  • f2d940e Biome modifiers: test one biome id and a list of biomes
  • 19c46b3 Biome modifier ore test: the configured feature in 26.3's flat form
  • 0643133 Biome modifiers: skip what can't be read, with a warning

📊 Changes

4 files changed (+824 additions, -1 deletions)

View changed files

📝 crates/horizon-client/src/mod_content.rs (+85 -1)
➕ crates/horizon-client/src/mod_content_biomes.rs (+330 -0)
📝 crates/horizon-client/src/mod_content_tests.rs (+386 -0)
📝 docs/mods.md (+23 -0)

📄 Description

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

What and why

Closes #5431. Part of #4953.

A content mod's own placed features now generate in vanilla's biomes through NeoForge's biome modifiers:
data/<ns>/neoforge/biome_modifier/*.json (older Forge mods: data/<ns>/forge/biome_modifier/). Until now a mod
could add an ore's placed feature, but nothing placed it in existing biomes, so it never generated in normal terrain.

  • add_features appends features to one generation step of every biome in biomes.
  • remove_features takes them out of its steps (every step when none is given).
  • none does nothing.
  • biomes and features take a #tag, one id or a list of ids. biomes also takes neoforge:any, or, and and not.
{ "type": "neoforge:add_features", "biomes": "#minecraft:is_overworld",
  "features": "zinc:ore_zinc", "step": "underground_ores" }

How it meets the issue's points:

  • Vanilla order: the modifiers rewrite the biomes' features lists when the content root builds, with each added
    feature at the end of its step as NeoForge adds it. The generator's FeatureSorter port then orders every biome's lists,
    so an added feature gets the place, and the seed, that vanilla gives it. Biomes no modifier names keep their text byte for byte.
    A root with no modifiers keeps vanilla's worldgen/biomes.json, so worlds without mods are unchanged.
  • Loading point: an unknown biome, biome tag, feature, feature tag, step or modifier type fails the build with
    mod <id>: <file>: .... The game then starts without content mods, with the reason in the log.
  • Multiplayer: a mod that adds a block (the ore) already joins the content identity, so a client without it is
    refused. A mod whose only content is a modifier changes only server-generated chunks, so the identity does not need it.

All additions run before all removals (NeoForge's add phase before its remove phase), each in mod and file order.

Code:

  • crates/horizon-client/src/mod_content_biomes.rs: reads and applies the modifiers (new).
  • crates/horizon-client/src/mod_content.rs: collects modifier files and rewrites worldgen/biomes.json in the overlay.
  • docs/mods.md: the format.

Tests:

  • biome_modifiers_place_mod_features_in_vanilla_biomes: ore added to #minecraft:is_overworld (nested tag), short
    biomes padded to the step, removal, untouched biome text, and the sorter's order (vanilla features first, then the ore).
  • biome_modifiers_take_one_biome_or_a_list, biome_modifiers_none_keep_the_vanilla_biomes,
    biome_modifiers_refuse_unknown_names.
  • content_root_generates_a_biome_modifier_ore (#[ignore]d, full content root): over the real prepared data, a zinc ore
    with the modifier generates in a fresh overworld chunk, and without it does not. Not run locally (no .local/ in the
    agent's container); CI and pr_ready run it.

The diff is ~780 lines; about 370 of them are tests.

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

Biome feature order: FeatureSorter and ChunkGenerator.applyBiomeDecoration (26.3), through Horizon's existing
FeatureSorter port; added features take the place and seed vanilla's sorter gives them. The modifier format itself
is a NeoForge feature, not vanilla, and follows NeoForge's public docs (neoforge:add_features, remove_features, none).
No new parity harness: no mod loads in any harness, and worlds without modifiers keep vanilla's worldgen/biomes.json unchanged.

Other projects' code

none (the format follows NeoForge's public documentation; no NeoForge source was read or copied).

Self-check

tools/pr_ready.py was not run: the agent's container had no vanilla data (.local/), so no harnesses could run.
What did run: cargo test -p horizon-client --lib passed (1083 passed, 31 ignored); the new code is clean under
cargo fmt --check and clippy.

🤖 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/5502 **Author:** [@sirrayi](https://github.com/sirrayi) **Created:** 10/31/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `mods/biome-modifiers` --- ### 📝 Commits (4) - [`1fedaa1`](https://github.com/horizon-rust/horizon/commit/1fedaa1c5a60dbd76c15979e74956dc8fb47a9cd) Content mods: place mod features in biomes (biome modifiers) - [`f2d940e`](https://github.com/horizon-rust/horizon/commit/f2d940e4c8ef344b071d4c22d70279924bb4b56f) Biome modifiers: test one biome id and a list of biomes - [`19c46b3`](https://github.com/horizon-rust/horizon/commit/19c46b3fde299c4e73f18d395051237d6335fd9f) Biome modifier ore test: the configured feature in 26.3's flat form - [`0643133`](https://github.com/horizon-rust/horizon/commit/064313363c8d6f52f86558f7f6a117bc416a69ac) Biome modifiers: skip what can't be read, with a warning ### 📊 Changes **4 files changed** (+824 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/mod_content.rs` (+85 -1) ➕ `crates/horizon-client/src/mod_content_biomes.rs` (+330 -0) 📝 `crates/horizon-client/src/mod_content_tests.rs` (+386 -0) 📝 `docs/mods.md` (+23 -0) </details> ### 📄 Description > 🤖 Opened by sirrayi's AI agent (Claude Code, Claude Opus 5.5), not by sirrayi personally. ## What and why Closes #5431. Part of #4953. A content mod's own placed features now generate in vanilla's biomes through NeoForge's biome modifiers: `data/<ns>/neoforge/biome_modifier/*.json` (older Forge mods: `data/<ns>/forge/biome_modifier/`). Until now a mod could add an ore's placed feature, but nothing placed it in existing biomes, so it never generated in normal terrain. - `add_features` appends `features` to one generation `step` of every biome in `biomes`. - `remove_features` takes them out of its `steps` (every step when none is given). - `none` does nothing. - `biomes` and `features` take a `#tag`, one id or a list of ids. `biomes` also takes `neoforge:any`, `or`, `and` and `not`. ```json { "type": "neoforge:add_features", "biomes": "#minecraft:is_overworld", "features": "zinc:ore_zinc", "step": "underground_ores" } ``` How it meets the issue's points: - **Vanilla order:** the modifiers rewrite the biomes' `features` lists when the content root builds, with each added feature at the end of its step as NeoForge adds it. The generator's `FeatureSorter` port then orders every biome's lists, so an added feature gets the place, and the seed, that vanilla gives it. Biomes no modifier names keep their text byte for byte. A root with no modifiers keeps vanilla's `worldgen/biomes.json`, so worlds without mods are unchanged. - **Loading point:** an unknown biome, biome tag, feature, feature tag, step or modifier type fails the build with `mod <id>: <file>: ...`. The game then starts without content mods, with the reason in the log. - **Multiplayer:** a mod that adds a block (the ore) already joins the content identity, so a client without it is refused. A mod whose only content is a modifier changes only server-generated chunks, so the identity does not need it. All additions run before all removals (NeoForge's add phase before its remove phase), each in mod and file order. Code: - `crates/horizon-client/src/mod_content_biomes.rs`: reads and applies the modifiers (new). - `crates/horizon-client/src/mod_content.rs`: collects modifier files and rewrites `worldgen/biomes.json` in the overlay. - `docs/mods.md`: the format. Tests: - `biome_modifiers_place_mod_features_in_vanilla_biomes`: ore added to `#minecraft:is_overworld` (nested tag), short biomes padded to the step, removal, untouched biome text, and the sorter's order (vanilla features first, then the ore). - `biome_modifiers_take_one_biome_or_a_list`, `biome_modifiers_none_keep_the_vanilla_biomes`, `biome_modifiers_refuse_unknown_names`. - `content_root_generates_a_biome_modifier_ore` (`#[ignore]`d, full content root): over the real prepared data, a zinc ore with the modifier generates in a fresh overworld chunk, and without it does not. **Not run locally** (no `.local/` in the agent's container); CI and `pr_ready` run it. The diff is ~780 lines; about 370 of them are tests. ## Kind - [ ] parity: Horizon now does what vanilla 26.3 does - [ ] bug: a crash or a breakage - [ ] perf: faster, or less memory - [x] 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 Biome feature order: `FeatureSorter` and `ChunkGenerator.applyBiomeDecoration` (26.3), through Horizon's existing `FeatureSorter` port; added features take the place and seed vanilla's sorter gives them. The modifier format itself is a NeoForge feature, not vanilla, and follows NeoForge's public docs (`neoforge:add_features`, `remove_features`, `none`). No new parity harness: no mod loads in any harness, and worlds without modifiers keep vanilla's `worldgen/biomes.json` unchanged. ## Other projects' code none (the format follows NeoForge's public documentation; no NeoForge source was read or copied). ## Self-check `tools/pr_ready.py` was not run: the agent's container had no vanilla data (`.local/`), so no harnesses could run. What did run: `cargo test -p horizon-client --lib` passed (1083 passed, 31 ignored); the new code is clean under `cargo fmt --check` and clippy. 🤖 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:14 +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#6321
No description provided.