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({
		"input": [
			{
				"tag": "forge:storage_blocks/steel"
			},
			{
				"tag": "forge:ingots/cyanite"
			},
			{
				"tag": "forge:storage_blocks/steel"
			},
			{
				"tag": "forge:ingots/deorum"
			},
			{
				"tag": "forge:ingots/deorum"
			},
			{
				"tag": "forge:storage_blocks/steel"
			},
			{
				"item": "rftoolsbase:machine_frame"
			},
			{
				"tag": "forge:storage_blocks/steel"
			}
		],
		"processingTime": 300,
		"output": {
			"item": "mekanism:steel_casing",
			"count": 1
		},
		"inputFluid": "{FluidName:\"industrialforegoing:ether_gas\",Amount:100}",
		"type": "industrialforegoing:dissolution_chamber"
	}).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'
		},
		{
		  tag: 'forge:ingots/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',
            output: { item: recipe.output },
            itemInput: { ingredient: { item: recipe.input } },
		}).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: 'extradisks:raw_withering_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: 'mekanism:hdpe_pellet',
		  infusionInput: 'mekanism:refined_obsidian',
		  infusionAmount: 40,
		  id: 'powah:crafting/dielectric_paste'
		},
	  ];
  
	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);
	});
})