mirror of
https://github.com/minetest/minetest_game.git
synced 2025-06-29 21:30:26 +02:00
Add reverse recipes for hoes
- Adds material for crafting (keeps def.recipe compatibility) - Fix two typos in api documentation
This commit is contained in:
@ -83,10 +83,30 @@ farming.register_hoe = function(name, def)
|
||||
end
|
||||
})
|
||||
-- Register its recipe
|
||||
minetest.register_craft({
|
||||
output = name:gsub(":", "", 1),
|
||||
recipe = def.recipe
|
||||
})
|
||||
if def.material == nil then
|
||||
minetest.register_craft({
|
||||
output = name:sub(2),
|
||||
recipe = def.recipe
|
||||
})
|
||||
else
|
||||
minetest.register_craft({
|
||||
output = name:sub(2),
|
||||
recipe = {
|
||||
{def.material, def.material, ""},
|
||||
{"", "group:stick", ""},
|
||||
{"", "group:stick", ""}
|
||||
}
|
||||
})
|
||||
-- Reverse Recipe
|
||||
minetest.register_craft({
|
||||
output = name:sub(2),
|
||||
recipe = {
|
||||
{"", def.material, def.material},
|
||||
{"", "group:stick", ""},
|
||||
{"", "group:stick", ""}
|
||||
}
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
-- Seed placement
|
||||
|
Reference in New Issue
Block a user