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

function aom_wood.register_roof(sname, name, tiles)
	local node_type = string.lower(name)
	local node_name = "aom_wood:" .. node_type .. "_roof"
	core.register_node(node_name, {
		-- TL: @1 is type of wood ("Oak")
		description = S("@1 Roof Tiles", sname),
		groups = {
			full_solid = 1, oddly_breakable_by_hand = 1, choppy = 1, solid = 1, suffocates = 2,
			wood = 1, material_wood_planks = 1, flammable = 1, },
		tiles = tiles,
		sounds = aom_sounds.default_wood(),
	})
	core.register_craft({
		output = node_name,
		recipe = {
			{"aom_wood:" .. node_type .. "_planks"},
		},
	})
	core.register_craft({
		output = "aom_wood:" .. node_type .. "_planks",
		recipe = {
			{node_name},
		},
	})
end

aom_wood.register_roof(S("Oak"), "Oak", {{name='aom_wood_roof_oak.png', align_style="world", scale=4}})
aom_wood.register_roof(S("Ash"), "Ash", {{name='aom_wood_roof_ash.png', align_style="world", scale=4}})
aom_wood.register_roof(S("Spruce"), "Spruce", {{name='aom_wood_roof_spruce.png', align_style="world", scale=4}})
aom_wood.register_roof(S("Hem"), "Hem", {{name='aom_wood_roof_hem.png', align_style="world", scale=4}})

aom_util.register_all_shapes("aom_wood:oak_roof")
aom_util.register_all_shapes("aom_wood:ash_roof")
aom_util.register_all_shapes("aom_wood:spruce_roof")
aom_util.register_all_shapes("aom_wood:hem_roof")
