Let villagers harvest torchflower crops

TorchflowerCropBlock is a CropBlock with max age 1. It was missing from the villagers' crop lists, so farmers planted torchflower seeds but never harvested them.
This commit is contained in:
Kacpherek
2026-10-27 22:20:12 +01:00
parent 5388064d88
commit 567e92e2a2
+6 -1
View File
@@ -318,7 +318,11 @@ pub fn work_sound(profession: u8) -> Option<&'static str> {
pub fn crop(w: &MobWorld, p: [i32; 3]) -> bool {
matches!(
w.block_name(p[0], p[1], p[2]),
"minecraft:wheat" | "minecraft:carrots" | "minecraft:potatoes" | "minecraft:beetroots"
"minecraft:wheat"
| "minecraft:carrots"
| "minecraft:potatoes"
| "minecraft:beetroots"
| "minecraft:torchflower_crop"
)
}
/// `CropBlock.isMaxAge` for the block at `p`.
@@ -326,6 +330,7 @@ pub fn ripe_crop(w: &MobWorld, p: [i32; 3]) -> bool {
let max = match w.block_name(p[0], p[1], p[2]) {
"minecraft:wheat" | "minecraft:carrots" | "minecraft:potatoes" => "7",
"minecraft:beetroots" => "3",
"minecraft:torchflower_crop" => "1",
_ => return false,
};
w.prop(p[0], p[1], p[2], "age") == Some(max)