[PR #6618] [MERGED] fix(mobs): let farmers tend registered mod crops #6989

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

📋 Pull Request Information

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

Base: main ← Head: fix/5533-farming-fresh-sol-e66af682


📝 Commits (1)

  • 873ccc1 fix(mobs): let farmers tend registered mod crops

📊 Changes

7 files changed (+460 additions, -46 deletions)

View changed files

📝 crates/horizon-client/src/mobs/villager.rs (+18 -15)
📝 crates/horizon-client/src/mobs/villager_brain.rs (+28 -23)
➕ crates/horizon-client/src/mobs/villager_farming_tests.rs (+322 -0)
📝 crates/horizon-client/src/mobs/world.rs (+19 -8)
📝 docs/native-mods.md (+10 -0)
➕ mods/horizon/src/test/java/dev/horizonlab/parity/VanillaVillagerFarmingOracle.java (+31 -0)
➕ tools/test_villager_farming_parity.py (+32 -0)

📄 Description

🤖 Opened by navinor's AI agent (OpenCode, GPT-6.1 Sol), not by navinor personally.

What and why

Fixes #5533.

Farmers ignored a mod's farmland, crops and seeds because farming checked vanilla names. Use the class chains, item tags and block-item mappings already retained by content/native registration. Mod farmland is also recognized by the secondary job-site sensor. Keep the existing farming schedule, cooldown, harvest-before-later-replant timing and one-seed inventory consumption.

No dependencies or new native API hooks. A mod crop's generated block item must belong to minecraft:villager_plantable_seeds; its template supplies maturity and default placement state.

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

Read the complete vanilla 26.3 HarvestFarmland behavior, SecondaryPoiSensor.doTick, CropBlock.isMaxAge/getMaxAge, BeetrootBlock.getMaxAge, TorchflowerCropBlock.getMaxAge, CarrotBlock, PotatoBlock, and Villager.hasFarmSeeds. Farmland/CropBlock templates keep their exported class chains; only tagged block items are planted.

tools/test_villager_farming_parity.py runs a new Java oracle against the checksum-verified 26.3 jar: 61 block states (all vanilla crop classes, pitcher, cocoa, farmland, stone) compared with Horizon's actual farming predicates. It also runs real content-mod farming regressions. Observed behavioral TDD: 3 failed against unchanged upstream farming, then 3 passed after the fix; oracle run: 4 passed, 0 failed, 0 ignored.

Other projects' code

None. This is a fresh, independent GPT-6.1 Sol agent session derived only from vanilla Minecraft 26.3 and upstream Horizon at f8bfa06b90e78e410b05900e15ed5070386e09a0. No prior-attempt notes, patches, branches, test scenes or reports were consulted. No NeoForge, Fabric or other non-vanilla project's implementation was read, copied or adapted. The issue was read directly from its original GitHub body, without comments or linked prior patches. Fresh review and QA agents use the same provenance boundary.

Self-check

Fresh GPT-6.1 Sol xhigh static review completed. Its CI finding was fixed: resource-backed regressions are explicitly ignored in default clean-checkout tests and included by the paired harness. Follow-up review found no remaining concrete issues. Runtime QA uses a separate clean-context Sol xhigh agent; results below are from new runs only.

pr_ready (tools/pr_ready.py --quick --base f8bfa06b90e78e410b05900e15ed5070386e09a0 on Aaron, against f8bfa06b90 at f8bfa06b9, 8 min 23 s)

Check Result
Scope ✅ 7 files, +460 −46
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 595 passed (2 min 13 s)
rustfmt ✅ (14 s)
clippy ✅ (8 s)
tests: horizon-client-lib ✅ 1319 passed (5 min 36 s)
doc tests ✅ 0 passed (8 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 ➖ not run (--quick): CI's parity job picks the affected harnesses
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

The first readiness run had one Python fixture failure because TEMP was inside the Git checkout. The unchanged upstream test/code reproduce that failure inside Git and pass outside it. The full rerun above uses private scratch outside Git, still beneath the horizon directory. No source fix, exclusion or waiver was used. The Python suite reports 595 run with 12 existing skips; the paired farming harness explicitly ran all four resource-backed tests (0 ignored).

Fresh independent runtime QA: 30/30 cases passed (15 integrated-server-thread, 15 dedicated), no in-frame run. Both clients rendered actual offscreen Vulkan frames. The matrix covers all four ordinary crop families and harvest/replant, growing wheat/beetroot, torchflower age 1, untagged and non-block seeds, mob_griefing false with positive controls, non-farmers, crossovers between vanilla/mod seeds and soil, and inventory scan order. Crop cycles assert the harvest leaves air and seed count 2; a later authoritative tick plants the declared default state and leaves count 1. Negative cases hold for 600 authoritative ticks. Each game/server had fresh isolated data/config homes.

54 original renderer PNGs were captured; every hash/dimension was verified. No image was generated, edited, composed or reused. Air is proved by server predicates, not by pixels (frozen break particles remain visible). A nonfatal dedicated startup diagnostic (No key layers in MapLike[{}]) is retained; no startup, runtime or acceptance case failed. Arbitrary native-hook overrides, sound playback, natural growth and save/reload are not claimed tested.

port_ledger.py check --base f8bfa06b90e78e410b05900e15ed5070386e09a0 ran. It still reports inferred/pre-existing dimension/callee and BLOCK_PLACE-event gaps outside this issue; no unrelated behavior was changed.

Screenshots

integrated: mature → harvested → replanted

integrated/wheat-mature.png

integrated/wheat-harvest-air.png

integrated/wheat-replanted.png

dedicated: mature → harvested → replanted

dedicated/wheat-mature.png

dedicated/wheat-harvest-air.png

dedicated/wheat-replanted.png

All 54 fresh proof captures (the six above included)

integrated/beet-harvest-air.png

integrated/beet-mature.png

integrated/beet-planted.png

integrated/beet-replanted.png

integrated/carrot-harvest-air.png

integrated/carrot-mature.png

integrated/carrot-planted.png

integrated/carrot-replanted.png

integrated/griefing-false-empty.png

integrated/griefing-false-mature.png

integrated/growing-beet.png

integrated/growing-wheat.png

integrated/mod-crop-on-vanilla-soil.png

integrated/non-farmer.png

integrated/potato-harvest-air.png

integrated/potato-mature.png

integrated/potato-planted.png

integrated/potato-replanted.png

integrated/skip-nonblock-then-block.png

integrated/tagged-non-block-item.png

integrated/torchflower-highest-property-not-mature.png

integrated/untagged-block-item.png

integrated/vanilla-seed-on-mod-soil.png

integrated/wheat-planted.png

dedicated/beet-harvest-air.png

dedicated/beet-mature.png

dedicated/beet-planted.png

dedicated/beet-replanted.png

dedicated/carrot-harvest-air.png

dedicated/carrot-mature.png

dedicated/carrot-planted.png

dedicated/carrot-replanted.png

dedicated/griefing-false-empty.png

dedicated/griefing-false-mature.png

dedicated/growing-beet.png

dedicated/growing-wheat.png

dedicated/mod-crop-on-vanilla-soil.png

dedicated/non-farmer.png

dedicated/potato-harvest-air.png

dedicated/potato-mature.png

dedicated/potato-planted.png

dedicated/potato-replanted.png

dedicated/skip-nonblock-then-block.png

dedicated/tagged-non-block-item.png

dedicated/torchflower-highest-property-not-mature.png

dedicated/untagged-block-item.png

dedicated/vanilla-seed-on-mod-soil.png

dedicated/wheat-planted.png

🤖 Generated with OpenCode, GPT-6.1 Sol. Independent review/QA: GPT-6.1 Sol (xhigh).


🔄 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/6618 **Author:** [@navinor](https://github.com/navinor) **Created:** 11/2/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/5533-farming-fresh-sol-e66af682` --- ### 📝 Commits (1) - [`873ccc1`](https://github.com/horizon-rust/horizon/commit/873ccc1ecf5cffc6427d83e013bd255d4b47c4ea) fix(mobs): let farmers tend registered mod crops ### 📊 Changes **7 files changed** (+460 additions, -46 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/mobs/villager.rs` (+18 -15) 📝 `crates/horizon-client/src/mobs/villager_brain.rs` (+28 -23) ➕ `crates/horizon-client/src/mobs/villager_farming_tests.rs` (+322 -0) 📝 `crates/horizon-client/src/mobs/world.rs` (+19 -8) 📝 `docs/native-mods.md` (+10 -0) ➕ `mods/horizon/src/test/java/dev/horizonlab/parity/VanillaVillagerFarmingOracle.java` (+31 -0) ➕ `tools/test_villager_farming_parity.py` (+32 -0) </details> ### 📄 Description > 🤖 Opened by navinor's AI agent (OpenCode, GPT-6.1 Sol), not by navinor personally. ## What and why Fixes #5533. Farmers ignored a mod's farmland, crops and seeds because farming checked vanilla names. Use the class chains, item tags and block-item mappings already retained by content/native registration. Mod farmland is also recognized by the secondary job-site sensor. Keep the existing farming schedule, cooldown, harvest-before-later-replant timing and one-seed inventory consumption. No dependencies or new native API hooks. A mod crop's generated block item must belong to `minecraft:villager_plantable_seeds`; its template supplies maturity and default placement state. ## 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 Read the complete vanilla 26.3 `HarvestFarmland` behavior, `SecondaryPoiSensor.doTick`, `CropBlock.isMaxAge`/`getMaxAge`, `BeetrootBlock.getMaxAge`, `TorchflowerCropBlock.getMaxAge`, `CarrotBlock`, `PotatoBlock`, and `Villager.hasFarmSeeds`. Farmland/CropBlock templates keep their exported class chains; only tagged block items are planted. `tools/test_villager_farming_parity.py` runs a new Java oracle against the checksum-verified 26.3 jar: 61 block states (all vanilla crop classes, pitcher, cocoa, farmland, stone) compared with Horizon's actual farming predicates. It also runs real content-mod farming regressions. Observed behavioral TDD: 3 failed against unchanged upstream farming, then 3 passed after the fix; oracle run: 4 passed, 0 failed, 0 ignored. ## Other projects' code None. This is a fresh, independent GPT-6.1 Sol agent session derived only from vanilla Minecraft 26.3 and upstream Horizon at `f8bfa06b90e78e410b05900e15ed5070386e09a0`. No prior-attempt notes, patches, branches, test scenes or reports were consulted. No NeoForge, Fabric or other non-vanilla project's implementation was read, copied or adapted. The issue was read directly from its original GitHub body, without comments or linked prior patches. Fresh review and QA agents use the same provenance boundary. ## Self-check Fresh GPT-6.1 Sol xhigh static review completed. Its CI finding was fixed: resource-backed regressions are explicitly ignored in default clean-checkout tests and included by the paired harness. Follow-up review found no remaining concrete issues. Runtime QA uses a separate clean-context Sol xhigh agent; results below are from new runs only. **pr_ready** (`tools/pr_ready.py --quick --base f8bfa06b90e78e410b05900e15ed5070386e09a0` on Aaron, against f8bfa06b90e78e410b05900e15ed5070386e09a0 at f8bfa06b9, 8 min 23 s) | Check | Result | | --- | --- | | Scope | ✅ 7 files, +460 −46 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 595 passed (2 min 13 s) | | rustfmt | ✅ (14 s) | | clippy | ✅ (8 s) | | tests: horizon-client-lib | ✅ 1319 passed (5 min 36 s) | | doc tests | ✅ 0 passed (8 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 | ➖ not run (--quick): CI's parity job picks the affected harnesses | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | The first readiness run had one Python fixture failure because TEMP was inside the Git checkout. The unchanged upstream test/code reproduce that failure inside Git and pass outside it. The full rerun above uses private scratch outside Git, still beneath the horizon directory. No source fix, exclusion or waiver was used. The Python suite reports 595 run with 12 existing skips; the paired farming harness explicitly ran all four resource-backed tests (0 ignored). Fresh independent runtime QA: 30/30 cases passed (15 integrated-server-thread, 15 dedicated), no in-frame run. Both clients rendered actual offscreen Vulkan frames. The matrix covers all four ordinary crop families and harvest/replant, growing wheat/beetroot, torchflower age 1, untagged and non-block seeds, mob_griefing false with positive controls, non-farmers, crossovers between vanilla/mod seeds and soil, and inventory scan order. Crop cycles assert the harvest leaves air and seed count 2; a later authoritative tick plants the declared default state and leaves count 1. Negative cases hold for 600 authoritative ticks. Each game/server had fresh isolated data/config homes. 54 original renderer PNGs were captured; every hash/dimension was verified. No image was generated, edited, composed or reused. Air is proved by server predicates, not by pixels (frozen break particles remain visible). A nonfatal dedicated startup diagnostic (`No key layers in MapLike[{}]`) is retained; no startup, runtime or acceptance case failed. Arbitrary native-hook overrides, sound playback, natural growth and save/reload are not claimed tested. `port_ledger.py check --base f8bfa06b90e78e410b05900e15ed5070386e09a0` ran. It still reports inferred/pre-existing dimension/callee and BLOCK_PLACE-event gaps outside this issue; no unrelated behavior was changed. ## Screenshots ### integrated: mature → harvested → replanted ![integrated/wheat-mature.png](https://github.com/user-attachments/assets/4fee76b0-81ec-45bc-aee3-7fa8563e6ff2) ![integrated/wheat-harvest-air.png](https://github.com/user-attachments/assets/3d0a3a30-b162-49cb-9bfc-ea0b12f9ebd9) ![integrated/wheat-replanted.png](https://github.com/user-attachments/assets/4fad8ddf-b422-4220-9018-fb282b77455e) ### dedicated: mature → harvested → replanted ![dedicated/wheat-mature.png](https://github.com/user-attachments/assets/14a7ccc8-4564-473d-9e70-2c1ffe383032) ![dedicated/wheat-harvest-air.png](https://github.com/user-attachments/assets/7c93cfe6-9cac-4a86-872d-4a7beebce542) ![dedicated/wheat-replanted.png](https://github.com/user-attachments/assets/df4df4d1-bcc6-45e7-9d0a-374150c1791d) <details> <summary>All 54 fresh proof captures (the six above included)</summary> ![integrated/beet-harvest-air.png](https://github.com/user-attachments/assets/e4bb4d91-8e39-4806-ac6b-5e391e7bd114) ![integrated/beet-mature.png](https://github.com/user-attachments/assets/e7832d53-de4e-4cfa-80c9-411182f5ccd3) ![integrated/beet-planted.png](https://github.com/user-attachments/assets/94a442be-b167-46cb-9b08-e2797af243be) ![integrated/beet-replanted.png](https://github.com/user-attachments/assets/2213da1d-51bc-4ae6-b285-dfef90013e0e) ![integrated/carrot-harvest-air.png](https://github.com/user-attachments/assets/b16388f5-5397-4397-a2cf-39b5ea54f0b6) ![integrated/carrot-mature.png](https://github.com/user-attachments/assets/cb0c71ea-4c60-4a94-b4f0-5a38fa65dad5) ![integrated/carrot-planted.png](https://github.com/user-attachments/assets/209825cf-de0f-4076-a247-016ed1cb4657) ![integrated/carrot-replanted.png](https://github.com/user-attachments/assets/2decdc6c-0508-465e-bd90-4d58c7b5ba1f) ![integrated/griefing-false-empty.png](https://github.com/user-attachments/assets/7a769a7e-f6ab-4a7e-bf79-047cf4c8fb88) ![integrated/griefing-false-mature.png](https://github.com/user-attachments/assets/7d2952fd-1278-4346-9a47-b96c08ef33ad) ![integrated/growing-beet.png](https://github.com/user-attachments/assets/a84cb7b1-a3ef-4684-975c-98d53d84a491) ![integrated/growing-wheat.png](https://github.com/user-attachments/assets/a56e977c-96e9-4d15-b16d-e9630047576c) ![integrated/mod-crop-on-vanilla-soil.png](https://github.com/user-attachments/assets/5b26b6d7-89d4-45cd-9243-8605219904d2) ![integrated/non-farmer.png](https://github.com/user-attachments/assets/37c0565f-0cdc-4872-8c78-81d071287a65) ![integrated/potato-harvest-air.png](https://github.com/user-attachments/assets/9d5d0b5f-572f-4ab0-b02d-4301196fa447) ![integrated/potato-mature.png](https://github.com/user-attachments/assets/e34ed5fd-042d-43b9-bb95-3976fcc2284a) ![integrated/potato-planted.png](https://github.com/user-attachments/assets/b28dfee8-83df-40de-a3ae-849a12be5c5f) ![integrated/potato-replanted.png](https://github.com/user-attachments/assets/79e6067b-699e-41e1-9954-f78d1171969f) ![integrated/skip-nonblock-then-block.png](https://github.com/user-attachments/assets/e87e4a7b-2b15-4c28-abca-7fd1170303af) ![integrated/tagged-non-block-item.png](https://github.com/user-attachments/assets/716cc828-f4ab-49a0-b3f8-657dd758f215) ![integrated/torchflower-highest-property-not-mature.png](https://github.com/user-attachments/assets/2cd918a9-1b64-4bc1-bd83-507cb0ad8752) ![integrated/untagged-block-item.png](https://github.com/user-attachments/assets/39b69633-121c-4e44-af89-8802ada70d69) ![integrated/vanilla-seed-on-mod-soil.png](https://github.com/user-attachments/assets/536af361-6552-4b00-85f6-541c72b466a7) ![integrated/wheat-planted.png](https://github.com/user-attachments/assets/2c8731ac-1190-4f9c-8487-1bcb73b31392) ![dedicated/beet-harvest-air.png](https://github.com/user-attachments/assets/4a31dd90-7cc9-4204-9c36-d4ac2deba00b) ![dedicated/beet-mature.png](https://github.com/user-attachments/assets/62e32a45-b0f2-41ab-a7d9-0c7412980f15) ![dedicated/beet-planted.png](https://github.com/user-attachments/assets/19a9292c-b219-4216-b39a-670e8247d67f) ![dedicated/beet-replanted.png](https://github.com/user-attachments/assets/2050040a-b9e0-497b-a3ab-adf972bf0095) ![dedicated/carrot-harvest-air.png](https://github.com/user-attachments/assets/63ca94ac-39cb-4df2-ba4a-c6dea72b8309) ![dedicated/carrot-mature.png](https://github.com/user-attachments/assets/67f5b53d-c08a-44a4-8af8-b135bc50354f) ![dedicated/carrot-planted.png](https://github.com/user-attachments/assets/b715ee68-17e7-4bed-9ed4-b9379b5b68d7) ![dedicated/carrot-replanted.png](https://github.com/user-attachments/assets/916a02d2-37e8-4a38-8443-2e0479ded651) ![dedicated/griefing-false-empty.png](https://github.com/user-attachments/assets/f9f71a00-0cfd-448e-84f0-45e594056b58) ![dedicated/griefing-false-mature.png](https://github.com/user-attachments/assets/604ec379-9f90-4d25-b424-3a3e1da5bcec) ![dedicated/growing-beet.png](https://github.com/user-attachments/assets/e9d367f3-dbd1-4083-8fdc-2f5ab243ff4c) ![dedicated/growing-wheat.png](https://github.com/user-attachments/assets/13d5b3c7-c7f9-404f-99ac-05c93b6c3022) ![dedicated/mod-crop-on-vanilla-soil.png](https://github.com/user-attachments/assets/51d55ce2-1b2e-40f0-bdd7-9969d695b8b2) ![dedicated/non-farmer.png](https://github.com/user-attachments/assets/c32e3457-9bc7-4db5-9181-25a27d5d3ae8) ![dedicated/potato-harvest-air.png](https://github.com/user-attachments/assets/bb902808-2c61-4e8a-b826-a660a3cfec36) ![dedicated/potato-mature.png](https://github.com/user-attachments/assets/cd93d5a4-6d26-406b-857b-d166e8499c57) ![dedicated/potato-planted.png](https://github.com/user-attachments/assets/dc28139a-37d4-4c73-bd84-cefe2dc6df3c) ![dedicated/potato-replanted.png](https://github.com/user-attachments/assets/593ba262-c00e-4a1d-8599-5a86d68b7509) ![dedicated/skip-nonblock-then-block.png](https://github.com/user-attachments/assets/1943fb34-e4b4-4573-a55b-a844c0df7a48) ![dedicated/tagged-non-block-item.png](https://github.com/user-attachments/assets/216c6ffa-bfd8-43b2-9415-ec770a374bae) ![dedicated/torchflower-highest-property-not-mature.png](https://github.com/user-attachments/assets/0445da60-9dea-495f-99e7-f5b12479fd80) ![dedicated/untagged-block-item.png](https://github.com/user-attachments/assets/a5e432ca-5502-4c9f-9668-301a765423fd) ![dedicated/vanilla-seed-on-mod-soil.png](https://github.com/user-attachments/assets/6ae44979-b9f4-4d63-b94e-d1c3c5f54096) ![dedicated/wheat-planted.png](https://github.com/user-attachments/assets/5f3d897f-c026-41f9-b56a-7d322a1d7c1e) </details> 🤖 Generated with [OpenCode](https://opencode.ai), GPT-6.1 Sol. Independent review/QA: GPT-6.1 Sol (xhigh). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:31:01 +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#6989
No description provided.