local mod_name = minetest.get_current_modname()
local mod_path = minetest.get_modpath(mod_name)
local S = minetest.get_translator(mod_name)



-- STONE BASED
minetest.register_craftitem("aom_scrap:stone", {
    description = S("Stone scrap"),
    inventory_image = "aom_scrap_stone.png",
    groups = { scrap_component = 1, craftitem = 1, },
})

-- DIRT BASED
minetest.register_craftitem("aom_scrap:dirt", {
    description = S("Dirt scrap"),
    inventory_image = "aom_scrap_dirt.png",
    groups = { scrap_component = 1, craftitem = 1, },
})

-- WOOD BASED
minetest.register_craftitem("aom_scrap:oak", {
    description = S("Oak scrap"),
    inventory_image = "aom_scrap_oak.png",
    groups = { scrap_component = 1, craftitem = 1, },
})
minetest.register_craftitem("aom_scrap:ash", {
    description = S("Ash scrap"),
    inventory_image = "aom_scrap_ash.png",
    groups = { scrap_component = 1, craftitem = 1, },
})
minetest.register_craftitem("aom_scrap:spruce", {
    description = S("Spruce scrap"),
    inventory_image = "aom_scrap_spruce.png",
    groups = { scrap_component = 1, craftitem = 1, },
})

if aom_scrap.has_aom_tcraft then
    aom_tcraft.register_craft({
        output = "aom_stone:cobble",
        items = {
            ["aom_scrap:stone"] = 8,
        },
        hide_if_not_craftable = true,
    })
    aom_tcraft.register_craft({
        output = "aom_soil:dirt",
        items = {
            ["aom_scrap:dirt"] = 8,
        },
        hide_if_not_craftable = true,
    })
    for i, nodename in pairs({
        ["oak"] = "aom_wood:oak_planks", ["spruce"] = "aom_wood:spruce_planks", ["ash"] = "aom_wood:ash_planks",
    }) do
        aom_tcraft.register_craft({
            output = nodename,
            items = {
            ["aom_scrap:"..i] = 8,
            },
            hide_if_not_craftable = true,
        })
    end
end
