-- Wood
minetest.register_craft({
	output = 'hades_trees:wood 4',
	recipe = {
		{'hades_trees:tree'},
	}
})
minetest.register_craft({
	output = 'hades_trees:wood 4',
	recipe = {
		{'hades_trees:banana_tree'},
	}
})
minetest.register_craft({
	output = 'hades_trees:wood 4',
	recipe = {
		{'hades_trees:pear_tree'},
	}
})
minetest.register_craft({
	output = 'hades_trees:cream_wood 4',
	recipe = {
		{'hades_trees:olive_tree'},
	}
})
minetest.register_craft({
	output = 'hades_trees:pale_wood 4',
	recipe = {
		{'hades_trees:pale_tree'},
	}
})
minetest.register_craft({
	output = 'hades_trees:cream_wood 4',
	recipe = {
		{'hades_trees:birch_tree'},
	}
})
minetest.register_craft({
	output = 'hades_trees:jungle_wood 4',
	recipe = {
		{'hades_trees:jungle_tree'},
	}
})
minetest.register_craft({
	output = 'hades_trees:jungle_wood 4',
	recipe = {
		{'hades_trees:cocoa_tree'},
	}
})
minetest.register_craft({
	output = 'hades_trees:lush_wood 4',
	recipe = {
		{'hades_trees:orange_tree'},
	}
})
minetest.register_craft({
	output = 'hades_trees:lush_wood 4',
	recipe = {
		{'hades_trees:coconut_tree'},
	}
})

minetest.register_craft({
	type = "shapeless",
	output = 'hades_trees:colwood_uncolored',
	recipe = {'group:colwood', 'hades_trees:canvas_leaves'},
})
minetest.register_craft({
	output = 'hades_trees:colwood_uncolored 4',
	recipe = {
		{'hades_trees:canvas_tree'},
	}
})

minetest.register_craft({
	output = 'hades_trees:colwood_black',
	recipe = {
		{'group:colwood', 'hades_dye:black'},
	}
})
minetest.register_craft({
	output = 'hades_trees:colwood_blue',
	recipe = {
		{'group:colwood', 'hades_dye:blue'},
	}
})
minetest.register_craft({
	output = 'hades_trees:colwood_brown',
	recipe = {
		{'group:colwood', 'hades_dye:brown'},
	}
})
minetest.register_craft({
	output = 'hades_trees:colwood_cyan',
	recipe = {
		{'group:colwood', 'hades_dye:cyan'},
	}
})
minetest.register_craft({
	output = 'hades_trees:colwood_dark_green',
	recipe = {
		{'group:colwood', 'hades_dye:dark_green'},
	}
})
minetest.register_craft({
	output = 'hades_trees:colwood_dark_grey',
	recipe = {
		{'group:colwood', 'hades_dye:dark_grey'},
	}
})
minetest.register_craft({
	output = 'hades_trees:colwood_green',
	recipe = {
		{'group:colwood', 'hades_dye:green'},
	}
})
minetest.register_craft({
	output = 'hades_trees:colwood_grey',
	recipe = {
		{'group:colwood', 'hades_dye:grey'},
	}
})
minetest.register_craft({
	output = 'hades_trees:colwood_magenta',
	recipe = {
		{'group:colwood', 'hades_dye:magenta'},
	}
})
minetest.register_craft({
	output = 'hades_trees:colwood_orange',
	recipe = {
		{'group:colwood', 'hades_dye:orange'},
	}
})
minetest.register_craft({
	output = 'hades_trees:colwood_pink',
	recipe = {
		{'group:colwood', 'hades_dye:pink'},
	}
})
minetest.register_craft({
	output = 'hades_trees:colwood_red',
	recipe = {
		{'group:colwood', 'hades_dye:red'},
	}
})
minetest.register_craft({
	output = 'hades_trees:colwood_violet',
	recipe = {
		{'group:colwood', 'hades_dye:violet'},
	}
})
minetest.register_craft({
	output = 'hades_trees:colwood_white',
	recipe = {
		{'group:colwood', 'hades_dye:white'},
	}
})
minetest.register_craft({
	output = 'hades_trees:colwood_yellow',
	recipe = {
		{'group:colwood', 'hades_dye:yellow'},
	}
})

-- Bark

minetest.register_craft({
	output = "hades_trees:bark 3",
	recipe = {
		{ "hades_trees:tree", "hades_trees:tree" },
		{ "hades_trees:tree", "hades_trees:tree" },
	}
})
minetest.register_craft({
	output = "hades_trees:birch_bark 3",
	recipe = {
		{ "hades_trees:birch_tree", "hades_trees:birch_tree" },
		{ "hades_trees:birch_tree", "hades_trees:birch_tree" },
	}
})
minetest.register_craft({
	output = "hades_trees:jungle_bark 3",
	recipe = {
		{ "hades_trees:jungle_tree", "hades_trees:jungle_tree" },
		{ "hades_trees:jungle_tree", "hades_trees:jungle_tree" },
	}
})
minetest.register_craft({
	output = "hades_trees:pale_bark 3",
	recipe = {
		{ "hades_trees:pale_tree", "hades_trees:pale_tree" },
		{ "hades_trees:pale_tree", "hades_trees:pale_tree" },
	}
})
minetest.register_craft({
	output = "hades_trees:jungle_bark 3",
	recipe = {
		{ "hades_trees:jungle_tree", "hades_trees:jungle_tree" },
		{ "hades_trees:jungle_tree", "hades_trees:jungle_tree" },
	}
})

-- Seed crafting from fruit
minetest.register_craft({
	output = 'hades_trees:seed',
	recipe = {{'hades_trees:apple'}},
})
minetest.register_craft({
	output = 'hades_trees:pear_seed',
	recipe = {{'hades_trees:pear'}},
})
minetest.register_craft({
	output = 'hades_trees:orange_seed',
	recipe = {{'hades_trees:orange'}},
})
minetest.register_craft({
	output = 'hades_trees:banana_seed',
	recipe = {{'hades_trees:banana'}},
})
minetest.register_craft({
	output = 'hades_trees:olive_seed',
	recipe = {{'hades_trees:olive'}},
})
minetest.register_craft({
	output = 'hades_trees:coconut_seed',
	recipe = {{ "hades_trees:coconut" }},
})
minetest.register_craft({
	output = "hades_trees:cocoa_beans",
	recipe = {{"hades_trees:cocoa_pod"}},
})
minetest.register_craft({
	output = "hades_trees:birch_seed",
	recipe = {{"hades_trees:birch_catkin"}},
})
minetest.register_craft({
	output = "hades_trees:pale_seed",
	recipe = {{"hades_trees:bland_fruit"}},
})
minetest.register_craft({
	output = "hades_trees:canvas_seed",
	recipe = {{"hades_trees:canvas_fruit"}},
})
minetest.register_craft({
	output = "hades_trees:jungle_seed",
	recipe = {{"hades_trees:kaki"}},
})

-- Sapling crafting from plant matter and other resources
-- (roughly represents genetic research)
minetest.register_craft({
	output = 'hades_trees:seed',
	recipe = {
		{'hades_core:cactus'},
		{'hades_core:dirt'},
	}
})

minetest.register_craft({
	output = 'hades_trees:pale_seed',
	recipe = {
		{'', 'hades_trees:sapling', ''},
		{'', 'hades_trees:sapling', ''},
		{'hades_core:ash', 'hades_core:dirt', 'hades_core:ash'},
	}
})

minetest.register_craft({
	output = 'hades_trees:jungle_seed',
	recipe = {
		{'hades_trees:sapling'},
		{'hades_grass:junglegrass_2'},
		{'hades_core:dirt'},
	}
})

minetest.register_craft({
	output = 'hades_trees:olive_seed',
	recipe = {
		{'hades_trees:sapling'},
		{'hades_grass:grass_1'},
		{'hades_core:dirt'},
	}
})

minetest.register_craft({
	output = 'hades_trees:birch_seed',
	recipe = {
		{'hades_trees:sapling'},
		{'hades_trees:pale_sapling'},
		{'hades_core:dirt'},
	}
})

minetest.register_craft({
	output = 'hades_trees:orange_seed',
	recipe = {
		{'hades_trees:sapling'},
		{'hades_trees:jungle_sapling'},
		{'hades_core:dirt'},
	}
})

minetest.register_craft({
	output = 'hades_trees:banana_seed',
	recipe = {
		{'hades_trees:jungle_sapling'},
		{'hades_grass:junglegrass_2'},
		{'hades_core:dirt'},
	}
})

minetest.register_craft({
	output = 'hades_trees:cocoa_beans',
	recipe = {
		{'hades_trees:olive_sapling'},
		{'hades_trees:banana_sapling'},
		{'hades_core:dirt'},
	}
})

minetest.register_craft({
	output = 'hades_trees:canvas_seed',
	recipe = {
		{'hades_flowers:white'},
		{'hades_trees:pale_sapling'},
		{'hades_core:dirt'},
	}
})

minetest.register_craft({
	output = 'hades_trees:pear_seed',
	recipe = {
		{'hades_trees:sapling'},
		{'hades_trees:sapling'},
		{'hades_core:dirt'},
	}
})

minetest.register_craft({
	output = 'hades_trees:coconut_seed',
	recipe = {
		{'hades_trees:banana_sapling'},
		{'hades_trees:pear_sapling'},
		{'hades_core:dirt'},
	}
})

-- Other crafting

minetest.register_craft({
	type = "cooking",
	cooktime = 10,
	output = "hades_trees:charred_tree",
	recipe = "group:tree,flammable",
})
minetest.register_craft({
	type = "cooking",
	cooktime = 7,
	output = "hades_core:coal_lump",
	recipe = "hades_trees:charred_tree",
})

minetest.register_craft({
	type = "cooking",
	cooktime = 10,
	output = "hades_trees:charred_wood",
	recipe = "group:wood,flammable",
})
minetest.register_craft({
	type = "cooking",
	cooktime = 10,
	output = "hades_trees:charred_bark",
	recipe = "group:bark,flammable",
})

minetest.register_craft({
	output = 'hades_trees:coconut_milk',
	recipe = {{ "hades_trees:coconut_seed" }},
})

minetest.register_craft({
	output = 'hades_core:paper',
	recipe = {
		{'hades_trees:canvas_leaves', 'hades_trees:canvas_leaves', 'hades_trees:canvas_leaves'},
		{'hades_trees:canvas_leaves', 'hades_trees:canvas_leaves', 'hades_trees:canvas_leaves'},
		{'hades_trees:canvas_leaves', 'hades_trees:canvas_leaves', 'hades_trees:canvas_leaves'},
	}
})

minetest.register_craft({
	output = 'hades_core:paper',
	recipe = {
		{'hades_trees:birch_bark'},
		{'hades_trees:birch_bark'},
		{'hades_trees:birch_bark'},
	}
})

minetest.register_craft({
	output = "hades_core:stick",
	recipe = {
		{ "hades_trees:burned_branches" },
		{ "hades_trees:burned_branches" },
	},
})
minetest.register_craft({
	output = "hades_core:stick",
	recipe = {{ "hades_trees:charred_wood" }},
})


-- Fuel
minetest.register_craft({
	type = "fuel",
	recipe = "group:tree,flammable",
	burntime = 20,
})
minetest.register_craft({
	type = "fuel",
	recipe = "group:bark,flammable",
	burntime = 20,
})
minetest.register_craft({
	type = "fuel",
	recipe = "group:wood,flammable",
	burntime = 7,
})
-- Charred woodstuff burns slightly longer than normal wood
minetest.register_craft({
	type = "fuel",
	burntime = 24,
	recipe = "hades_trees:charred_tree",
})
minetest.register_craft({
	type = "fuel",
	burntime = 24,
	recipe = "hades_trees:charred_bark",
})
minetest.register_craft({
	type = "fuel",
	burntime = 8,
	recipe = "hades_trees:charred_wood",
})

minetest.register_craft({
	type = "fuel",
	recipe = "group:leaves",
	burntime = 2,
})

minetest.register_craft({
	type = "fuel",
	recipe = "group:sapling",
	burntime = 10,
})

minetest.register_craft({
	type = "fuel",
	recipe = "hades_trees:cocoa_pod",
	burntime = 3,
})
minetest.register_craft({
	type = "fuel",
	recipe = "hades_trees:coconut",
	burntime = 6,
})
minetest.register_craft({
	type = "fuel",
	recipe = "hades_trees:coconut_seed",
	burntime = 6,
})
