Bow crafting recipe: check for a name override

See #116
This commit is contained in:
mgl512 2017-08-01 11:15:56 +02:00
parent 82c9932ed9
commit 5542c62405
1 changed files with 7 additions and 1 deletions

View File

@ -381,8 +381,14 @@ function throwing.register_bow(name, def)
minetest.register_tool(name, def)
if def.itemcraft then
-- Check for an override name
-- because an ``output = ":name"'' can't exist in a recipe
local outpout_name = name
if name:sub(1,1) == ":" then
output_name = name:sub(2)
end
minetest.register_craft({
output = name,
output = output_name,
recipe = {
{"farming:cotton", def.itemcraft, ""},
{"farming:cotton", "", def.itemcraft},