[PR #2741] [MERGED] refactor: biome's spawn-list parsers live in biome.rs #4579

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

📋 Pull Request Information

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

Base: main ← Head: refactor/cut-biome-spawn-parsers


📝 Commits (1)

  • 0f565f4 refactor: biome's spawn-list parsers live in biome.rs

📊 Changes

5 files changed (+63 additions, -58 deletions)

View changed files

📝 crates/horizon-client/src/biome.rs (+59 -3)
📝 crates/horizon-client/src/mobs/spawn_selection.rs (+1 -55)
📝 tools/test_natural_spawn_parity.py (+1 -0)
📝 tools/test_spawner_parity.py (+1 -0)
📝 tools/test_trial_spawner_parity.py (+1 -0)

📄 Description

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

Step A of the plan to break the cycle in horizon-client's lib (crate split, ci-speed). 80 of the lib's modules (181k lines) form one dependency cycle, so none of them can move to a crate of its own. This PR removes one edge of that cycle. It moves code only: no behaviour change.

What

  • parse_entries, parse_costs and SpawnCost (parsing the biome's natural_mob_spawns JSON) move from mobs/spawn_selection.rs to biome.rs, next to SpawnEntry, which they already build.
  • spawn_selection re-exports all three, so every caller keeps its path. This removes biome -> mobs (3 references).
  • The natural_spawn, spawner and trial_spawner harnesses add biome.rs to the sources they record.

Self-check

pr_ready (tools/pr_ready.py --quick on ludovics-mac-mini, against origin/main at 167c3d14b, 6 min 24 s)

Check Result
Scope ✅ 5 files, +63 −58
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 331 passed (41 s)
rustfmt ✅ (5 s)
clippy ✅ (1 min 10 s)
tests: horizon-client ✅ 1315 passed (3 min 1 s)
doc tests ✅ 0 passed (1 min 12 s)
content root tests ➖ content root untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ 72 affected, to run in CI (--quick): arrow, auto_jump, block_entity_anim, block_entity_render, block_entity_tickers, block_particles, block_removal, breaking_model, cauldron, command_exec, composter, crafter and 60 more
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

🤖 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/2741 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/27/2026 **Status:** ✅ Merged **Merged:** 10/28/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `refactor/cut-biome-spawn-parsers` --- ### 📝 Commits (1) - [`0f565f4`](https://github.com/horizon-rust/horizon/commit/0f565f4e4c63c5105f8a94cc2e37fbd4423d5999) refactor: biome's spawn-list parsers live in biome.rs ### 📊 Changes **5 files changed** (+63 additions, -58 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/biome.rs` (+59 -3) 📝 `crates/horizon-client/src/mobs/spawn_selection.rs` (+1 -55) 📝 `tools/test_natural_spawn_parity.py` (+1 -0) 📝 `tools/test_spawner_parity.py` (+1 -0) 📝 `tools/test_trial_spawner_parity.py` (+1 -0) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Step A of the plan to break the cycle in horizon-client's lib (crate split, ci-speed). 80 of the lib's modules (181k lines) form one dependency cycle, so none of them can move to a crate of its own. This PR removes one edge of that cycle. It moves code only: no behaviour change. ## What - `parse_entries`, `parse_costs` and `SpawnCost` (parsing the biome's `natural_mob_spawns` JSON) move from `mobs/spawn_selection.rs` to `biome.rs`, next to `SpawnEntry`, which they already build. - `spawn_selection` re-exports all three, so every caller keeps its path. This removes `biome -> mobs` (3 references). - The natural_spawn, spawner and trial_spawner harnesses add biome.rs to the sources they record. ## Self-check **pr_ready** (`tools/pr_ready.py --quick` on ludovics-mac-mini, against origin/main at 167c3d14b, 6 min 24 s) | Check | Result | | --- | --- | | Scope | ✅ 5 files, +63 −58 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 331 passed (41 s) | | rustfmt | ✅ (5 s) | | clippy | ✅ (1 min 10 s) | | tests: horizon-client | ✅ 1315 passed (3 min 1 s) | | doc tests | ✅ 0 passed (1 min 12 s) | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ 72 affected, to run in CI (--quick): arrow, auto_jump, block_entity_anim, block_entity_render, block_entity_tickers, block_particles, block_removal, breaking_model, cauldron, command_exec, composter, crafter and 60 more | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | 🤖 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 04:18:12 +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#4579
No description provided.