1
0
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:
MT-Modder
2015-02-13 19:21:36 -05:00
committed by BlockMen
parent ea7b04a712
commit 3e912f7b85
4 changed files with 36 additions and 38 deletions

View File

@ -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