// priority: 0

onEvent('recipes', event => {
    //removal
    removeRecipeByID(event, [
        MG('generator/heat'),
        M('metallurgic_infuser'),
		M("processing/uranium/reprocessing/from_plutonium"),
		M("processing/uranium/reprocessing/to_fuel"),
		// M("electric_bow"),
		M(`upgrade/stone_generator`),
		M(`hdpe_rod`),
		M("bin/basic"),
		M("bin/advanced"),
		M("bin/elite"),
		M("bin/ultimate"),
		MG("reactor/frame"),
		M(`qio_drive_array`),
		M("solar_neutron_activator"),
		M('isotopic_centrifuge'),
		M('sps_casing'),
		M("laser"),
		M("structural_glass"),
    ])

    //teleportation core
    event.replaceInput({ id: M("teleportation_core") }, MC("diamond"), AE2("singularity"))
    event.replaceInput({ id: M("teleportation_core") }, M("alloy_atomic"), MC("diamond"))

    //heat generator
	event.shaped(MG("heat_generator"), [
		'ITI',
		'OFO',
		'III'
	], {
		I: MC("iron_ingot"),
		T: CR("fluid_tank"),
		O: F("#ingots/osmium"),
		F: IF("machine_frame_supreme")
	})

    //metallurgic infuser
    event.shaped(M("metallurgic_infuser"), [
		'IBI',
		'OFO',
		'IBI'
	], {
		I: MC("iron_ingot"),
		B: MC("blast_furnace"),
		O: F("#ingots/osmium"),
		F: IF("machine_frame_supreme")
	})

	//structural glass
	event.shaped(M("structural_glass"), [
		' B ',
		'BSB',
		' B '
	], {
		B: TC("necrotic_bone"),
		S: F("#glass")
	})
	// event.replaceInput({ id: M("structural_glass") }, M("ingot_steel"), TC("necrotic_bone"))

	//steel casing
	event.replaceInput({ id: M("steel_casing") }, F("#glass"), CM("nether_star_fragment"))
	event.replaceInput({ id: M("steel_casing") }, M("ingot_osmium"), IF("machine_frame_supreme"))

	//irradiated pellet
	event.recipes.mekanismCombining(M("reprocessed_fissile_fragment"), M("pellet_polonium"), M("pellet_plutonium"))
	event.recipes.mekanismCombining(M("reprocessed_fissile_fragment"), M("pellet_plutonium"), M("pellet_polonium"))

	//stone generator upgrade
	event.shaped(M('upgrade_stone_generator'), [
		' G ',
		'ASA',
		' G '
	], {
		G: F("#glass"),
		A: M("alloy_infused"),
		S: CG("tier_3")
	})

    //basic pipes & cables
    event.replaceInput({ id: M("transmitter/logistical_transporter/basic") }, M("basic_control_circuit"), PZ("item_pipe"))
    event.replaceInput({ id: M("transmitter/mechanical_pipe/basic") }, MC("bucket"), PZ("fluid_pipe"))
    event.replaceInput({ id: M("transmitter/universal_cable/basic") }, MC("redstone"), PZ("energy_pipe"))

	//hdpe
	event.recipes.mekanismInjecting(M("hdpe_rod"), Item.of(M("hdpe_pellet"), 3), {gas: M("sodium"), amount: 1})

	//gravitational modulating unit
	event.replaceInput({ id: M("module_gravitational_modulating_unit") }, MC("nether_star"), MU("angel_ring"))

	//bins
	event.shaped(M("basic_bin"), [
		'CBC',
		'RTR',
		'CCC',
	], {
		C: CP("cobblestone_2"),
		B: M("basic_control_circuit"),
		R: F("#ingots/red_alloy"),
		T: TR("item_trash_can")
	})

	event.shaped(M("advanced_bin"), [
		'CBC',
		'ATA',
		'CCC',
	], {
		C: CP("cobblestone_3"),
		B: M("advanced_control_circuit"),
		A: M("alloy_infused"),
		T: M("basic_bin")
	})

	event.shaped(M("elite_bin"), [
		'CBC',
		'ATA',
		'CCC',
	], {
		C: CP("cobblestone_4"),
		B: M("elite_control_circuit"),
		A: M("alloy_reinforced"),
		T: M("advanced_bin")
	})

	event.shaped(M("ultimate_bin"), [
		'CBC',
		'ATA',
		'CCC',
	], {
		C: CP("cobblestone_5"),
		B: M("ultimate_control_circuit"),
		A: M("alloy_atomic"),
		T: M("elite_bin")
	})

	//salt
	event.shapeless(Item.of(M('salt'), 4), M('block_salt'))

	//fusion frame
	event.shaped(Item.of(MG('fusion_reactor_frame'), 4), [
		'APA',
		'PCP',
		'APA'
	], {
		A: M("alloy_atomic"),
		P: M("reprocessed_fissile_fragment"),
		C: M("steel_casing")
	})

	//solar neutron activator
	event.recipes.extendedcrafting.shaped_table(M('solar_neutron_activator'), [
		'  AAAAA  ',
		'   BCB   ',
		'   BBB   ',
		'    B    ',
		'  KDDDK  ',
		'  DEFED  ',
		'  DGHGD  ',
		'  DIJID  ',
		'  KDDDK  ',
	  ], {
		A: MG('solar_generator'),
		B: M('hdpe_stick'),
		C: DU('ender_hopper'),
		D: F('#storage_blocks/lead'),
		E: M('alloy_reinforced'),
		F: KJ('computation_matrix'),
		G: M('elite_control_circuit'),
		H: M('steel_casing'),
		I: F('#storage_blocks/refined_obsidian'),
		J: Item.of('extendedcrafting:singularity', {Id:"extendedcrafting:cyan_matter"}),
		K: F('#storage_blocks/unstable'),
	  }).id(KJ(`${M()}/extended_crafting/solar_neutron_activator`))

	//solar neutron activator
	event.recipes.extendedcrafting.shaped_table(M('isotopic_centrifuge'), [
		'  AAAAA  ',
		'  AFBFA  ',
		'  AFBFA  ',
		'  AFBFA  ',
		'  AFBFA  ',
		'  AFBFA  ',
		'  CCCCC  ',
		'  CDEDC  ',
		' CCCCCCC ',
	], {
		A: F('#storage_blocks/lead'),
		B: F('#storage_blocks/unstable'),
		C: M('steel_casing'),
		D: F('#storage_blocks/refined_obsidian'),
		E: Item.of('extendedcrafting:singularity', {Id:"extendedcrafting:cyan_matter"}),
		F: M('hdpe_stick'),
	}).id(KJ(`${M()}/extended_crafting/isotopic_centrifuge`))

	//SPS casing
	event.shaped(M('sps_casing'), [
		'ABA',
		'BCB',
		'ABA'
	], {
		A: M("hdpe_stick"),
		B: M("reprocessed_fissile_fragment"),
		C: AV("pileof_neutrons")
	})

	//nucleosynthesizer
	event.replaceInput({ id: M("antiprotonic_nucleosynthesizer") }, M("ultimate_control_circuit"), AV("neutronium_ingot"))

	//laser
	event.shaped(M('laser'), [
		'AB ',
		'ACD',
		'AB '
	], {
		A: M("alloy_reinforced"),
		B: M("energy_tablet"),
		C: M("steel_casing"),
		D: CRAD("tesla_coil"),
	})
})