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_pmb_tcraft then
    pmb_tcraft.register_craft({
        output = "pmb_stone:cobble",
        items = {
            ["aom_scrap:stone"] = 8,
        }
    })
    pmb_tcraft.register_craft({
        output = "pmb_soil:dirt",
        items = {
            ["aom_scrap:dirt"] = 8,
        }
    })
    for i, nodename in pairs({
        ["oak"] = "pmb_wood:oak_planks", ["ash"] = "pmb_wood:spruce_planks", ["spruce"] = "pmb_wood:ash_planks",
    }) do
        pmb_tcraft.register_craft({
            output = nodename,
            items = {
                ["aom_scrap:"..i] = 8,
            }
        })
    end
end
