// priority: 1

// Enable recipe logging, off by default
settings.logAddedRecipes = true
settings.logRemovedRecipes = true
// Enable skipped recipe logging, on by default
settings.logSkippedRecipes = false
	
// Listen to server recipe event
events.listen("recipes", event => { 
	//Metallurgic infuser requires steel
	event.remove({output: "mekanism:metallurgic_infuser"})
	event.shaped("mekanism:metallurgic_infuser", [
		"ADA",
		"CBC",
		"ADA"
	], {
		A: "#forge:plates/steel",
		B: "mekanism:steel_casing",
		C: "minecraft:furnace",
		D: "#forge:ingots/osmium"
	})
	
	//Removing integral component/upgrade tier recipes for replacement
	event.remove({output: "mekanism:advanced_tier_installer"})
	event.remove({output: "mekanism:elite_tier_installer"})
	event.remove({output: "mekanism:ultimate_tier_installer"})
	
	event.remove({output: "thermal:upgrade_augment_1"})
	event.remove({output: "thermal:upgrade_augment_2"})
	event.remove({output: "thermal:upgrade_augment_3"})
	
	event.shaped("thermal:upgrade_augment_1", [
		"ADA",
		"CBC",
		"ADA"
	], {
		A: "thermal:invar_plate",
		B: "kubejs:mid_microcontroller",
		C: "thermal:bronze_gear",
		D: "#forge:glass"
	})
	event.shaped("thermal:upgrade_augment_2", [
		"ABA",
		"CEC",
		"ADA"
	], {
		A: "thermal:electrum_plate",
		B: "kubejs:high_microcontroller",
		C: "thermal:signalum_gear",
		D: "#forge:glass",
		E: "thermal:upgrade_augment_1"
	})
	event.shaped("thermal:upgrade_augment_3", [
		"ABA",
		"CEC",
		"ADA"
	], {
		A: "thermal:enderium_plate",
		B: "kubejs:extreme_microcontroller",
		C: "thermal:lumium_gear",
		D: ["thermal:obsidian_glass", "mekanism:structural_glass"],
		E: "thermal:upgrade_augment_2"
	})
	event.shaped("mekanism:advanced_tier_installer", [
		"ABA",
		"CEC",
		"ADA"
	], {
		A: "mekanism:alloy_infused",
		B: "kubejs:mid_microcontroller",
		C: "#forge:ingots/osmium",
		D: ["mekanism:advanced_control_circuit", "kubejs:mid_pcb_wired"],
		E: "#minecraft:planks"
	})
	event.shaped("mekanism:elite_tier_installer", [
		"ABA",
		"CEC",
		"ADA"
	], {
		A: "mekanism:alloy_reinforced",
		B: "kubejs:high_microcontroller",
		C: "#forge:ingots/osmium",
		D: ["mekanism:elite_control_circuit", "kubejs:advanced_pcb_wired"],
		E: "#minecraft:planks"
	})
	event.shaped("mekanism:ultimate_tier_installer", [
		"ABA",
		"CEC",
		"ADA"
	], {
		A: "mekanism:alloy_atomic",
		B: "kubejs:extreme_microcontroller",
		C: "#forge:ingots/refined_obsidian",
		D: ["mekanism:ultimate_control_circuit", "kubejs:extreme_pcb_wired"],
		E: "#minecraft:planks"
	})
	
	//Fission casing rework (adds HDPE)
	event.remove({output: "mekanismgenerators:fission_reactor_casing"})
	event.shaped("mekanismgenerators:fission_reactor_casing", [
		" A ",
		"BCB",
		" A "
	],	{
		A: "#forge:plates/lead",
		B: "mekanism:hdpe_sheet",
		C: "mekanism:steel_casing"
	})
	
	//Fission fuel assembly rework (adds signalum) 
	event.remove({output: "mekanismgenerators:control_rod_assembly"})
	event.shaped("mekanismgenerators:control_rod_assembly", [
		"ABA",
		"CAC",
		"DAD"
	],	{
		D: "#forge:plates/lead",
		A: "#forge:plates/steel",
		C: "#forge:plates/signalum",
		B: "mekanism:elite_control_circuit"
	})
	
	//Removes Infinity Backpack (crashes)
	event.remove({output: "industrialforegoing:infinity_backpack"})
	
	
	
	//Replaces makes some thermal machines cost steel
	event.replaceInput({output: "thermal:machine_frame"}, "#forge:ingots/iron", "#forge:plates/steel")
	event.replaceInput({mod: "industrialforegoing"}, "industrialforegoing:machine_frame_pity", "thermal:machine_frame")
	event.replaceInput({output: "mekanism:steel_casing"}, "#forge:glass", "industrialforegoing:plastic")
	event.replaceInput({output: "mekanism:basic_logistical_transporter"}, "mekanism:basic_control_circuit", "immersiveengineering:component_steel")
	
	event.replaceInput({output: "immersiveengineering:conveyor_basic"}, "minecraft:leather", ingredient.of(["minecraft:dried_kelp", "thermal:cured_rubber", "#forge:plastic"]))
	
	//dissolution chamber rework ot put in t3
	event.replaceInput({output: "industrialforegoing:dissolution_chamber"}, "#forge:gears/diamond", "#forge:gears/signalum")
	
	//mekanism steel casing in dissolution_chamber
	event.remove({output: "mekanism:steel_casing"})
	event.custom({
		"input": [
			{
				"tag": "forge:plates/steel"
			},
			{
				"tag": "forge:plates/signalum"
			},
			{
				"tag": "forge:plates/steel"
			},
			{
				"tag": "forge:glass"
			},
			{
				"tag": "forge:glass"
			},
			{
				"tag": "forge:plates/steel"
			},
			{
				"tag": "forge:plates/signalum"
			},
			{
				"tag": "forge:plates/steel"
			},
			
		],
		"inputFluid": "{FluidName:\"industrialforegoing:latex\",Amount:500}",
		"processingTime": 120,
		"output": {
			"item": "mekanism:steel_casing",
			"count": 4
		},
		"type": "industrialforegoing:dissolution_chamber"
	})
	//IF frame rework
	event.remove({output: "industrialforegoing:machine_frame_simple"})
	event.replaceInput("industrialforegoing:machine_frame_simple", "mekanism:steel_casing")
	event.replaceInput({output: "industrialforegoing:machine_frame_advanced"}, "#forge:ingots/gold", "#forge:plates/signalum")
	
	//Compact Crafting field projector
	event.remove({output: "compactcrafting:field_projector"})
	event.custom({
		"input": [
			{
				"item": "minecraft:redstone_torch"
			},
			{
				"item": "minecraft:ender_eye"
			},
			{
				"item": "minecraft:ender_eye"
			},
			{
				"tag": "forge:glass"
			},
			{
				"tag": "forge:glass"
			},
			{
				"tag": "forge:plates/lumium"
			},
			{
				"tag": "mekanismadditions:plastic_blocks"
			},
			{
				"tag": "forge:plates/lumium"
			},
			
		],
		"processingTime": 120,
		"output": {
			"item": "compactcrafting:field_projector",
			"count": 4
		},
		"type": "industrialforegoing:dissolution_chamber"
	})
})