Add reverse recipes for hoes
- Adds material for crafting (keeps def.recipe compatibility) - Fix two typos in api documentation
This commit is contained in:
parent
ea7b04a712
commit
3e912f7b85
4 changed files with 36 additions and 38 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue