// priority: 0

ServerEvents.recipes(event => {
  	//removals
	removeRecipeByID(event, [
		
	])
	
	//matter ball to singularity in recipes
	event.replaceInput({ id: /megacells/ }, AE2("matter_ball"), AE2("singularity"))

    //mega emc interface
	removeRecipeByOutput(event, [
		MGC("mega_emc_interface"),
	])
	event.recipes.extendedcrafting.shaped_table(MGC('mega_emc_interface'), [
		'CEBEC',
		'EGGGE',
		'BDAFB',
		'EGGGE',
		'CEBEC',
	], {
		A: AE2_PRE('emc_interface'),
		B: AE2('fluix_glass_cable'),
		C: CP('iron_2'),
		D: AE2('formation_core'),
		E: MGC('accumulation_processor'),
		F: AE2('annihilation_core'),
		G: PREXP('purple_matter'),
	})

	//mega energy cell
	removeRecipeByOutput(event, [
		MGC("mega_energy_cell"),
	])
	event.recipes.extendedcrafting.shaped_table(MGC('mega_energy_cell'), [
		'CEBEC',
		'EDDDE',
		'BDADB',
		'EDDDE',
		'CEBEC',
	], {
		A: P('dielectric_casing'),
		B: AE2('fluix_glass_cable'),
		C: CP('iron_1'),
		D: AE2('dense_energy_cell'),
		E: AE2('fluix_pearl'),
	})
	event.recipes.mekanism.nucleosynthesizing(AE2('dense_energy_cell'), `4x ${M("antimatter")}`, MGC('mega_energy_cell'), 40)
	
	//inscriber press from scrap
	removeRecipeByOutput(event, [
		MGC("accumulation_processor_press"),
	])
	event.stonecutting(MGC("accumulation_processor_press"), KJ("circuit_scrap"))
	
	//late game storage component recipes
	event.recipes.mekanism.nucleosynthesizing(AE2('cell_component_256k'), `5x ${M("antimatter")}`, MGC('cell_component_1m'), 50)
	
	const componentsLength = componentSizes[MGC()].length
	for (let i = 0; i < componentsLength; i++) {
		if (i !== componentsLength - 1)
			event.recipes.mekanism.nucleosynthesizing(MGC(`cell_component_${componentSizes[MGC()][i]}`), `${i + 6}x ${M("antimatter")}`, MGC(`cell_component_${componentSizes[MGC()][i + 1]}`), (i + 6) * 10)
	}
})
