1
0
mirror of https://codeberg.org/tenplus1/farming.git synced 2025-12-27 16:25:20 +01:00

fix api.txt hoe recipe, add check for register_hoe recipe (thx the4codeblocks)

This commit is contained in:
tenplus1
2025-12-27 08:05:11 +00:00
parent 9cb83d03b5
commit 0f07c2975c
2 changed files with 11 additions and 16 deletions

View File

@@ -36,19 +36,14 @@ farming.register_hoe = function(name, def)
})
-- Register its recipe
if def.recipe then
core.register_craft({ output = name:sub(2), recipe = def.recipe })
local recipe = def.recipe or (def.material and {
{def.material, def.material},
{"", "group:stick"},
{"", "group:stick"}
})
elseif def.material then
core.register_craft({
output = name:sub(2),
recipe = {
{def.material, def.material, ""},
{"", "group:stick", ""},
{"", "group:stick", ""}
}
})
if recipe then
core.register_craft({ output = name:sub(2), recipe = recipe })
end
end