@@ -72,15 +72,46 @@ value = c.cost * fragments_per_ingot; } end end local install = function(part,amt) - sorcery.data.metallookup[part] = { id = name, data = metal, value = amt } + sorcery.data.metallookup[part] = { id = name, data = metal, value = amt } end install(ingot, fragments_per_ingot) install(block, fragments_per_ingot*9) install(fragment, 1) install(powder, 1) install(disc, 8/3) + if metal.wire then + if metal.wire == true then + metal.parts.wire = 'sorcery:wire_' .. name + minetest.register_craftitem(metal.parts.wire, { + inventory_image = string.format('basic_materials_empty_spool.png^sorcery_%s_wire.png', name); + description = string.format('Spool of %s wire',name); + groups = {metal = 1, wire = 1}; + }) + minetest.register_craft { + type = 'shapeless'; + output = metal.parts.wire .. ' 2'; + recipe = { + metal.parts.ingot; + 'basic_materials:empty_spool'; + 'basic_materials:empty_spool'; + } + } + else + metal.parts.wire = metal.wire + end + minetest.register_craft { + type = 'shapeless'; + output = metal.parts.wire; + recipe = { + metal.parts.fragment; + metal.parts.fragment; + 'basic_materials:empty_spool'; + } + } + install(metal.parts.wire, 2) + end if not metal.no_craftables then install(screw, 0.5) minetest.register_craftitem(screw, {