[PR #6617] [MERGED] The recipe book shows a filter's swapped recipe unswapped #6986

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

📋 Pull Request Information

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

Base: main ← Head: hooks-book-filters


📝 Commits (1)

  • 6219424 The recipe book shows a filter's swapped recipe unswapped

📊 Changes

3 files changed (+66 additions, -22 deletions)

View changed files

📝 crates/horizon-client/src/lan/advancements.rs (+51 -0)
📝 crates/horizon-client/src/lan/data.rs (+1 -2)
📝 crates/horizon-client/src/lan/recipes.rs (+14 -20)

📄 Description

🤖 Opened by Qwerner88880's AI agent (ZCode, GLM-5.3), not by Qwerner88880 personally.

Fixes #6595. Found while fixing #6368 (#6482).

What and why

update_recipes applied the data's recipe filters (#5910) to its own copy, and RecipeIndex to its index, so a removed recipe never reached the book — but book_entries wrote from the network copy, which the filters never touched: a replace_input or replace_output showed unswapped in the book's displays, while the property sets and the stonecutter carried the swapped recipe.

network_recipes now runs the filters once, over its files, before the ingredient normalization — a swapped name resolves, and every copy agrees on the swapped recipe. update_recipes parses the already filtered copy without running them again, so one swap cannot feed a later one twice.

The test carries its filter in a world pack's recipe_filter overlay, the route the game reads: RecipeFilters::load scans the namespaces of horizon-mod-content.json and the overlay, not a vanilla root's data/minecraft/recipe_filter/.

Proven

  • The test fails without the fix (the book entry carries minecraft:raw_copper, protocol id 0, not the swapped minecraft:redstone, id 3) and passes with it.
  • tools/pr_ready.py locally: rustfmt, clippy, 1332 tests in horizon-client-lib (the live two-guest lan_bot suite among them), doc tests — all green.

Not proven

  • a live LAN run with a world pack carrying the filter: the SyncData::load(overlay) path is covered by the test, no game window was opened.
  • a live /reload: both reload sites read through the same functions.
  • replace_output separately: it goes through the same replace path, only replace_input is tested.

Note for the reviewer

tools/pr_ready.py's Python suite has one failure on this Windows machine that is not from this PR: test_world_input_capture.test_capture_lifecycle panics (exit 101) on clean origin/main here too — the diff touches only lan/recipes.rs, lan/data.rs and lan/advancements.rs. CI on Linux will show whether it fails there.

Self-check

Check Result
Scope ✅ 3 files, +66 −22
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ❌ 1 error, pre-existing on clean main on this machine (see the note above)
rustfmt / clippy ✅ / ✅
tests: horizon-client-lib ✅ 1332 passed

🤖 Generated with ZCode AI agent (GLM-5.3)


🔄 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/6617 **Author:** [@Qwerner88880](https://github.com/Qwerner88880) **Created:** 11/2/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `hooks-book-filters` --- ### 📝 Commits (1) - [`6219424`](https://github.com/horizon-rust/horizon/commit/6219424298f5f9956c08e53f73e6853f53701ee0) The recipe book shows a filter's swapped recipe unswapped ### 📊 Changes **3 files changed** (+66 additions, -22 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/lan/advancements.rs` (+51 -0) 📝 `crates/horizon-client/src/lan/data.rs` (+1 -2) 📝 `crates/horizon-client/src/lan/recipes.rs` (+14 -20) </details> ### 📄 Description > 🤖 Opened by Qwerner88880's AI agent (ZCode, GLM-5.3), not by Qwerner88880 personally. Fixes #6595. Found while fixing #6368 (#6482). ## What and why `update_recipes` applied the data's recipe filters (#5910) to its own copy, and `RecipeIndex` to its index, so a removed recipe never reached the book — but `book_entries` wrote from the network copy, which the filters never touched: a `replace_input` or `replace_output` showed unswapped in the book's displays, while the property sets and the stonecutter carried the swapped recipe. `network_recipes` now runs the filters once, over its files, before the ingredient normalization — a swapped name resolves, and every copy agrees on the swapped recipe. `update_recipes` parses the already filtered copy without running them again, so one swap cannot feed a later one twice. The test carries its filter in a world pack's `recipe_filter` overlay, the route the game reads: `RecipeFilters::load` scans the namespaces of `horizon-mod-content.json` and the overlay, not a vanilla root's `data/minecraft/recipe_filter/`. ## Proven - The test fails without the fix (the book entry carries `minecraft:raw_copper`, protocol id 0, not the swapped `minecraft:redstone`, id 3) and passes with it. - `tools/pr_ready.py` locally: rustfmt, clippy, 1332 tests in `horizon-client-lib` (the live two-guest `lan_bot` suite among them), doc tests — all green. ## Not proven - a live LAN run with a world pack carrying the filter: the `SyncData::load(overlay)` path is covered by the test, no game window was opened. - a live `/reload`: both reload sites read through the same functions. - `replace_output` separately: it goes through the same `replace` path, only `replace_input` is tested. ## Note for the reviewer `tools/pr_ready.py`'s Python suite has one failure **on this Windows machine that is not from this PR**: `test_world_input_capture.test_capture_lifecycle` panics (exit 101) on clean `origin/main` here too — the diff touches only `lan/recipes.rs`, `lan/data.rs` and `lan/advancements.rs`. CI on Linux will show whether it fails there. ## Self-check | Check | Result | | --- | --- | | Scope | ✅ 3 files, +66 −22 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ❌ 1 error, pre-existing on clean `main` on this machine (see the note above) | | rustfmt / clippy | ✅ / ✅ | | tests: horizon-client-lib | ✅ 1332 passed | 🤖 Generated with ZCode AI agent (GLM-5.3) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:30:52 +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#6986
No description provided.