// priority: 0

settings.logAddedRecipes = true
settings.logRemovedRecipes = true
settings.logSkippedRecipes = false
settings.logErroringRecipes = true

console.info(`Recipes Added!`)

onEvent(`recipes`, event => {
	
	metals.forEach(material => {
		products.forEach(product => event.replaceInput(`#forge:${product}s/${material}`, `#forge:${product}s/${material}`))
		products.forEach(product => event.replaceOutput(`#forge:${product}s/${material}`, `emendatusenigmatica:${material}_${product}`))
		
		if(material != "steel"){
			event.shapeless(`emendatusenigmatica:${material}_block`, [`9x #forge:ingots/${material}`])
		}
		
		
		event.recipes.createSplashing([
			`10x emendatusenigmatica:${material}_nugget`, 
			Item.of(`5x emendatusenigmatica:${material}_nugget`).withChance(0.5)
		], `#create:crushed_ores/${material}`)
	})
	
	//event.replaceInput({output: `#forge:gears`}, `minecraft:iron_nugget`, `air`)
	
	event.replaceOutput(`#forge:ingots/osmium`, `mekanism:ingot_osmium`)
	
	event.replaceOutput(`#forge:wires/copper`, `createaddition:copper_wire`)
	/*
	event.recipes.createSplashing([
		`10x minecraft:iron_nugget`, 
		Item.of(`5x minecraft:iron_nugget`).withChance(0.5)
	], `create:crushed_iron_ore`)
	*/
	
	//iron stuffs
	event.blasting(`minecraft:iron_ingot`, `create:crushed_iron_ore`)
	event.replaceOutput({}, `#forge:dusts/iron`, `emendatusenigmatica:iron_dust`)
	event.replaceOutput({}, `#forge:rods/iron`, `emendatusenigmatica:iron_rod`)
	//event.replaceOutput({}, `#forge:gears/iron`, `emendatusenigmatica:iron_gear`)
	
	//wire coils
	event.replaceInput(`#samtext:coils/copper`, `#samtext:coils/copper`)
	
	event.shaped(`minecraft:chest`, [
		`PPP`,
		`P P`,
		`PPP`
	], {
		P: `#minecraft:planks`
	})	
})