
local mesecons_materials = minetest.get_modpath("mesecons_materials")
local has_mcl = minetest.get_modpath("mcl_core")
local has_mcl_dye = minetest.get_modpath("mcl_dye")
local has_moreores = minetest.get_modpath("moreores")

technic.materials = {
	stone = has_mcl and "mcl_core:stone" or "default:stone",
	cobble = has_mcl and "mcl_core:cobble" or "default:cobble",
	mossycobble = has_mcl and "mcl_core:mossycobble" or "default:mossycobble",
	gold_ingot = has_mcl and "mcl_core:gold_ingot" or "default:gold_ingot",
	gold_lump = has_mcl and "mcl_raw_ores:raw_gold" or "default:gold_lump",
	steel_ingot = has_mcl and "mcl_core:iron_ingot" or "default:steel_ingot",
	iron_lump = has_mcl and "mcl_raw_ores:raw_iron" or "default:iron_lump",
	diamond = has_mcl and "mcl_core:diamond" or "default:diamond",
	dirt = has_mcl and "mcl_core:dirt" or "default:dirt",
	tin_ingot = has_mcl and "mcl_core:iron_ingot" or "default:tin_ingot",
	tin_lump = has_mcl and "mcl_raw_ores:raw_iron" or "default:tin_lump",
	bronze_ingot = has_mcl and "mcl_copper:copper_ingot" or "default:bronze_ingot",
	copper_ingot = has_mcl and "mcl_copper:copper_ingot" or "default:copper_ingot",
	copper_lump = has_mcl and "mcl_copper:raw_copper" or "default:copper_lump",
	mese = has_mcl and "mesecons_torch:redstoneblock" or "default:mese",
	mese_crystal = has_mcl and "mesecons:redstone" or "default:mese_crystal",
	dye_green = has_mcl_dye and "mcl_dye:green" or "dye:green",
	dye_red = has_mcl_dye and "mcl_dye:red" or "dye:red",
	dye_blue = has_mcl_dye and "mcl_dye:blue" or "dye:blue",
	dye_orange = has_mcl and "mcl_dye:orange" or "dye:orange",
	dye_grey = has_mcl and "mcl_dye:grey" or "dye:grey",
	insulation = mesecons_materials and "mesecons_materials:fiber" or "technic:rubber",
	obsidian = has_mcl and "mcl_core:obsidian" or "default:obsidian",
	obsidian_glass = has_mcl and "mcl_core:glass" or "default:obsidian_glass",
	brick = has_mcl and "mcl_core:brick" or "default:brick",
	paper = has_mcl and "mcl_core:paper" or "default:paper",
	furnace = has_mcl and "mcl_furnaces:furnace" or "default:furnace",
	chest = has_mcl and "mcl_chests:chest" or "default:chest",
	sand = has_mcl and "mcl_core:sand" or "default:sand",
	ice = has_mcl and "mcl_core:ice" or "default:ice",
	clay = has_mcl and "mcl_core:clay" or "default:clay",
	clay_lump = has_mcl and "mcl_core:clay_lump" or "default:clay_lump",
	stick = has_mcl and "mcl_core:stick" or "default:stick",
	dry_shrub = has_mcl and "mcl_core:deadbush" or "default:dry_shrub",
	wheat = has_mcl and "mcl_farming:wheat_item" or "farming:wheat",
	seed_wheat = has_mcl and "mcl_farming:wheat_seeds" or "farming:seed_wheat",
	snowblock = has_mcl and "mcl_core:snowblock" or "default:snowblock",
	sandstone = has_mcl and "mcl_core:sandstone" or "default:sandstone",
	desert_stone = has_mcl and "mcl_core:redsandstone" or "default:desert_stone",
	desert_sand = has_mcl and "mcl_core:redsand" or "default:desert_sand",
	desert_sandstone = has_mcl and "mcl_core:redsandstone" or "default:desert_sandstone",
	silver_sand = has_mcl and "mcl_core:sand" or "default:silver_sand",
	silver_sandstone = has_mcl and "mcl_core:sandstone" or "default:silver_sandstone",
	glass = has_mcl and "mcl_core:glass" or "default:glass",
	coal_lump = has_mcl and "mcl_core:coal_lump" or "default:coal_lump",
	bucket_empty = has_mcl and "mcl_buckets:bucket_empty" or "bucket:bucket_empty",
	bucket_water = has_mcl and "mcl_buckets:bucket_water" or "bucket:bucket_water",
	bucket_river_water = has_mcl and "mcl_buckets:bucket_river_water" or "bucket:bucket_river_water",
	bucket_lava = has_mcl and "mcl_buckets:bucket_lava" or "bucket:bucket_lava",
	dirt_with_snow = has_mcl and "mcl_core:snowblock" or "default:dirt_with_snow",
	gravel = has_mcl and "mcl_core:gravel" or "default:gravel",
	tree = has_mcl and "mcl_core:tree" or "default:tree",
	wood = has_mcl and "mcl_core:wood" or "default:wood",
	acacia_tree = has_mcl and "mcl_core:acaciatree" or "default:acacia_tree",
	acacia_wood = has_mcl and "mcl_core:acaciawood" or "default:acacia_wood",
	water_source = has_mcl and "mcl_core:water_source" or "default:water_source",
	water_flowing = has_mcl and "mcl_core:water_flowing" or "default:water_flowing",
	river_water_source = has_mcl and "mclx_core:river_water_source" or "default:river_water_source",
	river_water_flowing = has_mcl and "mclx_core:river_water_flowing" or "default:river_water_flowing",
	lava_source = has_mcl and "mcl_core:lava_source" or "default:lava_source",
	lava_flowing = has_mcl and "mcl_core:lava_flowing" or "default:lava_flowing",
	mithril_ingot = has_moreores and "moreores:mithril_ingot" or has_mcl and "mcl_core:lapis" or "default:steel_ingot",
	silver_ingot = has_moreores and "moreores:silver_ingot" or has_mcl and "mcl_core:gold_ingot" or "default:gold_ingot",
	pick_silver = has_moreores and "moreores:pick_silver" or has_mcl and "mcl_tools:pick_gold" or "default:gold_pickaxe",
	mithril_block = has_moreores and "moreores:mithril_block" or has_mcl and "mcl_core:lapisblock" or "default:goldblock",
}

if has_mcl and has_moreores then
	technic.materials.tin_ingot = "moreores:tin_ingot"
	technic.materials.tin_lump = "moreores:tin_lump"
end
