-- template is a recipe-like table but indices are used instead of actual item names:
-- 0 means nothing, everything else is treated as an index in the materials table
localfunctionmake_recipe(template,materials)
localrecipe={}
forj,trowinipairs(template)do
localrrow={}
fori,tcellinipairs(trow)do
iftcell==0then
rrow[i]=""
else
rrow[i]=materials[tcell]
end
end
recipe[j]=rrow
end
returnrecipe
end
forkey,armorinpairs(stats)do
forpartkey,partinpairs(parts)do
localpartname="technic_armor:"..partkey.."_"..key
minetest.register_tool(partname,{
-- Translators: @1 stands for material and @2 for part of the armor, so that you could use a conjunction if in your language part name comes first then material (e.g. in french 'Silver Boots' is translated in 'Bottes en argent' by using '@2 en @1' as translated string)