ServerEvents.recipes(event => {
    event.remove({id: 'mekanism:steel_casing'})
    event.remove({id: 'mekanism:metallurgic_infuser'})
    event.remove({id: 'mekanism:metallurgic_infuser'})
    event.remove({id: 'mekanism:infusion_conversion/redstone/from_block'})
    event.remove({id: 'mekanism:infusion_conversion/redstone/from_dust'})
    event.remove({id: 'mekanism:infusion_conversion/diamond/from_dust'})
    event.remove({id: 'mekanism:infusion_conversion/carbon/from_charcoal_block'})
    event.remove({id: 'mekanism:infusion_conversion/carbon/from_coal'})
    event.remove({id: 'mekanism:infusion_conversion/carbon/from_charcoal'})
    event.remove({id: 'mekanism:infusion_conversion/carbon/from_coal_block'})
    event.remove({id: 'mekanism:enriching/enriched/redstone'})
    event.remove({id: 'mekanism:enriching/enriched/carbon'})
    event.remove({id: 'mekanism:enriching/enriched/diamond'})
    event.remove({id: 'mekanism:factory/basic/smelting'})
    event.remove({id: 'mekanism:factory/basic/enriching'})
    event.remove({id: 'mekanism:factory/basic/crushing'})
    event.remove({id: 'mekanism:factory/basic/compressing'})
    event.remove({id: 'mekanism:factory/basic/combining'})
    event.remove({id: 'mekanism:factory/basic/purifying'})
    event.remove({id: 'mekanism:factory/basic/injecting'})
    event.remove({id: 'mekanism:factory/basic/infusing'})
    event.remove({id: 'mekanism:factory/basic/sawing'})
    event.remove({id: 'mekanism:factory/advanced/smelting'})
    event.remove({id: 'mekanism:factory/advanced/enriching'})
    event.remove({id: 'mekanism:factory/advanced/crushing'})
    event.remove({id: 'mekanism:factory/advanced/compressing'})
    event.remove({id: 'mekanism:factory/advanced/combining'})
    event.remove({id: 'mekanism:factory/advanced/purifying'})
    event.remove({id: 'mekanism:factory/advanced/injecting'})
    event.remove({id: 'mekanism:factory/advanced/infusing'})
    event.remove({id: 'mekanism:factory/advanced/sawing'})
    event.remove({id: 'mekanism:factory/elite/smelting'})
    event.remove({id: 'mekanism:factory/elite/enriching'})
    event.remove({id: 'mekanism:factory/elite/crushing'})
    event.remove({id: 'mekanism:factory/elite/compressing'})
    event.remove({id: 'mekanism:factory/elite/combining'})
    event.remove({id: 'mekanism:factory/elite/purifying'})
    event.remove({id: 'mekanism:factory/elite/injecting'})
    event.remove({id: 'mekanism:factory/elite/infusing'})
    event.remove({id: 'mekanism:factory/elite/sawing'})
    event.remove({id: 'mekanism:factory/ultimate/smelting'})
    event.remove({id: 'mekanism:factory/ultimate/enriching'})
    event.remove({id: 'mekanism:factory/ultimate/crushing'})
    event.remove({id: 'mekanism:factory/ultimate/compressing'})
    event.remove({id: 'mekanism:factory/ultimate/combining'})
    event.remove({id: 'mekanism:factory/ultimate/purifying'})
    event.remove({id: 'mekanism:factory/ultimate/injecting'})
    event.remove({id: 'mekanism:factory/ultimate/infusing'})
    event.remove({id: 'mekanism:factory/ultimate/sawing'})
    event.remove({id: 'mekanism:tier_installer/basic'})
    event.remove({id: 'mekanism:tier_installer/advanced'})
    event.remove({id: 'mekanism:tier_installer/elite'})
    event.remove({id: 'mekanism:tier_installer/ultimate'})
    event.remove({id: 'mekanism:control_circuit/advanced'})
    event.remove({id: 'mekanism:control_circuit/elite'})
    event.remove({id: 'mekanism:control_circuit/ultimate'})
    event.remove({id: 'mekanism:enrichment_chamber'})
    event.remove({id: 'mekanismgenerators:reactor/glass'})
})

ServerEvents.recipes(event => {
    //Steel Casing
    event.custom({
			"type": "elementalcraft:pureinfusion",
			"element_amount": 60000,
			"ingredients": [
			  {
			"item": "rftoolsbase:machine_frame"
			  },
			  {
			"tag": "forge:storage_blocks/steel"
			  },
			  {
			"item": "iceandfire:dragonsteel_fire_block"
			  },
			  {
			"item": "iceandfire:dragonsteel_ice_block"
			  },
			  {
			"item": "iceandfire:dragonsteel_lightning_block"
			  }
			],
			"output": {
			  "item": "mekanism:steel_casing"
			}
		  }).id('mekanism:steel_casing')

	//Metallurgic Infuser
	event.shaped('mekanism:metallurgic_infuser',
	['121','343','121'], {
	  1: '#forge:ingots/blutonium', 
	  2: '#forge:furnaces/netherite',
	  3: '#forge:storage_blocks/redstone_ingot',
	  4: 'mekanism:steel_casing'
	}).id('mekanism:metallurgic_infuser')

	//Basic Tier Installer
	event.shaped('mekanism:basic_tier_installer',
	['121','343','121'], {
	  1: '#forge:alloys/advanced', 
	  2: '#forge:circuits/basic',
	  3: '#forge:storage_blocks/redstone_ingot',
	  4: 'mekanism:steel_casing'
	}).id('mekanism:basic_tier_installer')

	//Advanced Tier Installer
	event.shaped('mekanism:advanced_tier_installer',
	['121','343','121'], {
	  1: '#forge:alloys/advanced', 
	  2: '#forge:circuits/advanced',
	  3: '#forge:storage_blocks/redstone_ingot',
	  4: 'mekanism:basic_tier_installer'
	}).id('mekanism:advanced_tier_installer')

	//Elite Tier Installer
	event.shaped('mekanism:elite_tier_installer',
	['121','343','121'], {
	  1: '#forge:alloys/elite', 
	  2: '#forge:circuits/elite',
	  3: '#forge:storage_blocks/redstone_ingot',
	  4: 'mekanism:advanced_tier_installer'
	}).id('mekanism:elite_tier_installer')

	//Ultimate Tier Installer
	event.shaped('mekanism:ultimate_tier_installer',
	['121','343','121'], {
	  1: '#forge:alloys/ultimate', 
	  2: '#forge:circuits/ultimate',
	  3: '#forge:storage_blocks/redstone_ingot',
	  4: 'mekanism:elite_tier_installer'
	}).id('mekanism:ultimate_tier_installer')

	//Enrichment Chamber
	event.shaped('mekanism:enrichment_chamber',
	['121','343','121'], {
	  1: '#forge:alloys/advanced', 
	  2: '#forge:circuits/advanced',
	  3: 'allthecompressed:osmium_block_1x',
	  4: 'mekanism:metallurgic_infuser'
	}).id('mekanism:enrichment_chamber')

	//Reactor Glass
	event.shaped('mekanismgenerators:reactor_glass',
	[' 1 ','121',' 1 '], {
	  1: 'thermal:obsidian_glass', 
	  2: 'mekanismgenerators:fission_reactor_casing'
	}).id('mekanismgenerators:reactor_glass')
})

//Custom Infusion Conversion Recipes
ServerEvents.recipes(event => {
    const recipes = [
		{
		  input: { ingredient: { item: 'botania:mana_diamond' } },
		  output: { amount: 10, infuse_type: 'mekanism:diamond' },
		  id: 'mekanism:infusion_conversion/diamond/from_gem'
		},
		{
		  input: { ingredient: { tag: 'forge:ingots/hop_graphite' } },
		  output: { amount: 10, infuse_type: 'mekanism:carbon' },
		  id: 'mekanism:infusion_conversion/carbon/from_gem'
		},
		{
		  input: { ingredient: { item: 'evilcraft:dark_power_gem' } },
		  output: { amount: 10, infuse_type: 'mekanism:redstone' },
		  id: 'mekanism:infusion_conversion/redstone/from_gem'
		},
		{
		  input: { ingredient: { item: 'evilcraft:dark_power_gem_block' } },
		  output: { amount: 90, infuse_type: 'mekanism:redstone' },
		  id: 'mekanism:infusion_conversion/redstone/from_gem_block'
		},
	  ]
  
	  recipes.forEach((recipe) => {
		  event.custom({
			  type: 'mekanism:infusion_conversion',
			  input: recipe.input,
			  output: recipe.output
		  }).id(recipe.id);
	  });
})

//Custom Enrichment Chamber Recipes
ServerEvents.recipes(event => {
    const recipes = [
		{
		  input: 'botania:mana_diamond',
		  output: 'mekanism:enriched_diamond',
		  id: 'mekanism:enriching/enriched/diamond'
		},
		{
		  input: 'immersiveengineering:ingot_hop_graphite',
		  output: 'mekanism:enriched_carbon',
		  id: 'mekanism:enriching/enriched/carbon'
		},
		{
		  input: 'evilcraft:dark_power_gem',
		  output: 'mekanism:enriched_redstone',
		  id: 'mekanism:enriching/enriched/redstone'
		},
	  ]

	  recipes.forEach((recipe) => {
        event.custom({
			type: 'mekanism:enriching',
            input: { ingredient: { item: recipe.input } },
            output: { item: recipe.output },
		}).id(recipe.id);
	  });
})

ServerEvents.recipes(event => {

	const recipes = [
		//Infused Alloy
		{
		  output: 'mekanism:alloy_infused',
		  input: 'immersiveengineering:ingot_hop_graphite',
		  infusionInput: 'mekanism:redstone',
		  infusionAmount: 20,
		  id: 'mekanism:metallurgic_infusing/alloy/infused'
		},
		//Reinforced alloy
		{
		  output: 'mekanism:alloy_reinforced',
		  input: 'mekanism:alloy_infused',
		  infusionInput: 'mekanism:diamond',
		  infusionAmount: 40,
		  id: 'mekanism:metallurgic_infusing/alloy/reinforced'
		},  
		//Atomic alloy
		{
		  output: 'mekanism:alloy_atomic',
		  input: 'mekanism:alloy_reinforced',
		  infusionInput: 'mekanism:refined_obsidian',
		  infusionAmount: 80,
		  id: 'mekanism:metallurgic_infusing/alloy/atomic'
		},  
		//Basic Control Circuit
		{
		  output: 'mekanism:basic_control_circuit',
		  input: 'ae2:engineering_processor',
		  infusionInput: 'mekanism:redstone',
		  infusionAmount: 20,
		  id: 'mekanism:control_circuit/basic'
		},  
		//Advanced Control Circuit
		{
		  output: 'mekanism:advanced_control_circuit',
		  input: 'mekanism:basic_control_circuit',
		  infusionInput: 'mekanism:redstone',
		  infusionAmount: 40,
		  id: 'mekanism:metallurgic_infuser/control_circuit/advanced'
		},  
		//Elite Control Circuit
		{
		  output: 'mekanism:elite_control_circuit',
		  input: 'mekanism:advanced_control_circuit',
		  infusionInput: 'mekanism:diamond',
		  infusionAmount: 40,
		  id: 'mekanism:metallurgic_infuser/control_circuit/elite'
		},  
		//Ultimate Control Circuit
		{
		  output: 'mekanism:ultimate_control_circuit',
		  input: 'mekanism:elite_control_circuit',
		  infusionInput: 'mekanism:refined_obsidian',
		  infusionAmount: 80,
		  id: 'mekanism:metallurgic_infuser/control_circuit/ultimate'
		},  
		//Dielectric Paste
		{
		  output: 'powah:dielectric_paste',
		  input: 'draconicevolution:small_chaos_frag',
		  infusionInput: 'mekanism:refined_obsidian',
		  infusionAmount: 40,
		  id: 'powah:crafting/dielectric_paste'
		},
		//Draconium Ingot
		{
		  output: 'draconicevolution:draconium_ingot',
		  input: 'draconicevolution:draconium_dust',
		  infusionInput: 'mekanism_extras:shining',
		  infusionAmount: 10,
		  id: 'draconicevolution:infusing/draconium_ingot'
		},
		//Steel Casing
		{
		  output: 'mekanism:steel_casing',
		  input: 'rftoolsbase:machine_frame',
		  infusionInput: 'mekanism_extras:radiance',
		  infusionAmount: 80,
		  id: 'mekanism:metallurgic_infuser/steel_casing'
		},
	  ];
  
	recipes.forEach((recipe) => {
        recipe.type = 'mekanism:metallurgic_infusing';
        event.custom({
			type: 'mekanism:metallurgic_infusing',
            output: { item: recipe.output },
            itemInput: { ingredient: { item: recipe.input } },
            chemicalInput: { infuse_type: recipe.infusionInput, amount: recipe.infusionAmount },
		}).id(recipe.id);
	});
})