[PR #2149] [MERGED] Farmers make bread and compost seeds at their composter #4051

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/2149
Author: @kacpherek
Created: 10/26/2026
Status: ✅ Merged
Merged: 10/26/2026
Merged by: @ludovic111

Base: main ← Head: fix/farmer-composter-bread


📝 Commits (2)

  • 48c0f39 Farmers make bread and compost seeds when they work at a composter
  • 7d8b6f3 Composter: keep addLayer's doc on composter_add_layer

📊 Changes

7 files changed (+208 additions, -14 deletions)

View changed files

📝 crates/horizon-client/src/game/composter.rs (+77 -0)
📝 crates/horizon-client/src/game/creatures.rs (+1 -0)
📝 crates/horizon-client/src/game/villagers.rs (+32 -0)
📝 crates/horizon-client/src/mobs.rs (+7 -0)
📝 crates/horizon-client/src/mobs/villager.rs (+18 -0)
📝 crates/horizon-client/src/mobs/villager_brain.rs (+15 -1)
📝 crates/horizon-world/src/level/interact.rs (+58 -13)

📄 Description

What and why

Farmers that work at a composter did nothing there except look at it and make the work sound. In vanilla a farmer also uses the composter: it bakes bread from its wheat and feeds its spare seeds into the composter. Horizon used the same plain work behaviour for every profession, so farmers never made bread (which they then share with other villagers) and composters never filled up from villager work.

Farmers now get the composter version of the work behaviour. When it starts, and the job site is a composter:

  • Bread: if the villager holds at most 36 bread, it turns wheat into bread, three wheat for one loaf, up to three loaves at a time. Bread that does not fit in the inventory drops next to the villager.
  • Composting: a full composter (level 8) is emptied first and its bone meal pops out. Then up to 20 wheat seeds or beetroot seeds go in, keeping 10 of each kind, until the composter reaches level 7. Each seed is used up, and its layers come from the item's compostable data as for a hopper or a player. The fill sound and particles (level event 1500) play once at the end.

This happens before the restock, as in WorkAtPoi.start. Other professions keep the plain behaviour.

Supporting changes: a WorkAtComposter mob event applies this to the villager's inventory and the block, Ext::remove_item is SimpleContainer.removeItemType, and the composter emptying in horizon-world is now a helper shared by the player right-click and the villager.

This is separate from #1998 and #1639, which are about workstations being lost, not what farmers do at a composter.

Vanilla reference

  • VillagerGoalPackages.getWorkPackage: farmers get WorkAtComposter, everyone else WorkAtPoi.
  • WorkAtComposter.useWorkstation: only when the job site block is a composter; makeBread first, then compostItems.
  • WorkAtComposter.makeBread: at most 36 bread, min(3, wheat / 3) loaves, wheat removed with removeItemType, leftovers dropped with spawnAtLocation(level, stack, 0.5F).
  • WorkAtComposter.compostItems: extractProduce at level 8, 20 items in total, 10 of each kind kept, stop at level 7, level event 1500 once.
  • ComposterBlock.insertItem and extractProduce.
  • WorkAtPoi.start: the workstation is used before restock.

Self-check

cargo check -p horizon-client passes.


🔄 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/2149 **Author:** [@kacpherek](https://github.com/kacpherek) **Created:** 10/26/2026 **Status:** ✅ Merged **Merged:** 10/26/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/farmer-composter-bread` --- ### 📝 Commits (2) - [`48c0f39`](https://github.com/horizon-rust/horizon/commit/48c0f39e9677ff52e6027362c4c468cf73360e1b) Farmers make bread and compost seeds when they work at a composter - [`7d8b6f3`](https://github.com/horizon-rust/horizon/commit/7d8b6f3b90d1dd7f44ea9e89b7929dc925cac6e0) Composter: keep addLayer's doc on composter_add_layer ### 📊 Changes **7 files changed** (+208 additions, -14 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/composter.rs` (+77 -0) 📝 `crates/horizon-client/src/game/creatures.rs` (+1 -0) 📝 `crates/horizon-client/src/game/villagers.rs` (+32 -0) 📝 `crates/horizon-client/src/mobs.rs` (+7 -0) 📝 `crates/horizon-client/src/mobs/villager.rs` (+18 -0) 📝 `crates/horizon-client/src/mobs/villager_brain.rs` (+15 -1) 📝 `crates/horizon-world/src/level/interact.rs` (+58 -13) </details> ### 📄 Description ## What and why Farmers that work at a composter did nothing there except look at it and make the work sound. In vanilla a farmer also uses the composter: it bakes bread from its wheat and feeds its spare seeds into the composter. Horizon used the same plain work behaviour for every profession, so farmers never made bread (which they then share with other villagers) and composters never filled up from villager work. Farmers now get the composter version of the work behaviour. When it starts, and the job site is a composter: - Bread: if the villager holds at most 36 bread, it turns wheat into bread, three wheat for one loaf, up to three loaves at a time. Bread that does not fit in the inventory drops next to the villager. - Composting: a full composter (level 8) is emptied first and its bone meal pops out. Then up to 20 wheat seeds or beetroot seeds go in, keeping 10 of each kind, until the composter reaches level 7. Each seed is used up, and its layers come from the item's `compostable` data as for a hopper or a player. The fill sound and particles (level event 1500) play once at the end. This happens before the restock, as in `WorkAtPoi.start`. Other professions keep the plain behaviour. Supporting changes: a `WorkAtComposter` mob event applies this to the villager's inventory and the block, `Ext::remove_item` is `SimpleContainer.removeItemType`, and the composter emptying in `horizon-world` is now a helper shared by the player right-click and the villager. This is separate from #1998 and #1639, which are about workstations being lost, not what farmers do at a composter. ## Vanilla reference - `VillagerGoalPackages.getWorkPackage`: farmers get `WorkAtComposter`, everyone else `WorkAtPoi`. - `WorkAtComposter.useWorkstation`: only when the job site block is a composter; `makeBread` first, then `compostItems`. - `WorkAtComposter.makeBread`: at most 36 bread, `min(3, wheat / 3)` loaves, wheat removed with `removeItemType`, leftovers dropped with `spawnAtLocation(level, stack, 0.5F)`. - `WorkAtComposter.compostItems`: `extractProduce` at level 8, 20 items in total, 10 of each kind kept, stop at level 7, level event 1500 once. - `ComposterBlock.insertItem` and `extractProduce`. - `WorkAtPoi.start`: the workstation is used before `restock`. ## Self-check `cargo check -p horizon-client` passes. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:14:19 +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#4051
No description provided.