ServerEvents.recipes(event => {
	event.remove({
		output: 'computercraft:monitor_advanced'
	});
	event.remove({
		output: 'computercraft:computer_advanced'
	});
	event.remove({
		output: 'ccterminals:terminal_advanced'
	});
	event.recipes.createMechanicalCrafting('computercraft:computer_advanced', [
		' ALA ',
		'ARGBA',
		'ANCPA',
		'IZSZI',
		' III '
	], {
		S: 'ccoptical:optical_entity_sensor',
		G: '#c:dusts/glowstone',
		A: '#c:plates/brass',
		I: '#c:plates/iron',
		R: '#c:dyes/red',
		G: '#c:dyes/green',
		B: '#c:dyes/blue',
		N: 'powergrid:bjt_npn',
		P: 'powergrid:bjt_pnp',
		C: 'computercraft:computer_normal',
		Z: 'powergrid:electrical_gizmo',
		L: '#c:glass_panes'
	});
	event.shaped('computercraft:monitor_advanced', [
		'ALA',
		'RGB',
		'ICI'
	], {
		R: '#c:dyes/red',
		G: '#c:dyes/green',
		B: '#c:dyes/blue',
		A: '#c:plates/brass',
		L: '#c:dusts/glowstone',
		C: 'computercraft:monitor_normal',
		I: '#c:plates/iron'
	});
	event.shaped('ccterminals:terminal_advanced', [
		'AMA',
		'WTW',
		'ICI'
	], {
		T: 'simulated:linked_typewriter',
		W: '#c:wires/copper',
		A: '#c:plates/brass',
		M: 'computercraft:monitor_advanced',
		C: 'powergrid:integrated_circuit',
		I: '#c:plates/iron'
	});
	
	
	event.remove({
		output: 'computercraft:monitor_normal'
	});
	event.remove({
		output: 'computercraft:computer_normal'
	});
	event.remove({
		output: 'ccterminals:terminal_normal'
	});
	event.recipes.createMechanicalCrafting('computercraft:computer_normal', [
		' ALA ',
		'ANCPA',
		'IZTZI',
		' III '
	], {
		A: '#c:plates/brass',
		I: '#c:plates/iron',
		N: 'powergrid:bjt_npn',
		P: 'powergrid:bjt_pnp',
		C: 'powergrid:crt',
		Z: 'powergrid:electrical_gizmo',
		L: '#c:glass_panes',
		T: 'simulated:linked_typewriter'
	});
	event.shaped('computercraft:monitor_normal', [
		'ALA',
		'WCW',
		'III'
	], { 
		A: '#c:plates/brass',
		L: '#c:glass_panes',
		W: '#c:wires/copper',
		C: 'powergrid:crt',
		I: '#c:plates/iron'
	});
	event.shaped('ccterminals:terminal_normal', [
		'AMA',
		'WTW',
		'ICI'
	], {
		T: 'simulated:linked_typewriter',
		W: '#c:wires/copper',
		A: '#c:plates/brass',
		M: 'computercraft:monitor_normal',
		C: 'powergrid:integrated_circuit',
		I: '#c:plates/iron'
	});
	
	
	
	event.remove({
		output: 'ccoptical:radar_entity_sensor'
	});
	event.shaped('ccoptical:radar_entity_sensor', [
		'TTT',
		'GEG',
		'ICI'
	], {
		T: 'create:transmitter',
		G: '#c:plates/gold',
		E: 'minecraft:ender_eye',
		C: 'powergrid:integrated_circuit',
		I: '#c:plates/iron'
	});
	event.remove({
		output: 'ccoptical:optical_entity_sensor'
	});
	event.shaped('ccoptical:optical_entity_sensor', [
		'PSP',
		'GEG',
		'ICI'
	], {
		P: '#c:glass_panes',
		S: 'ccoptical:directional_optical_entity_sensor',
		G: '#c:plates/gold',
		E: 'minecraft:ender_eye',
		C: 'powergrid:integrated_circuit',
		I: '#c:plates/iron'
	});
	event.remove({
		output: 'ccoptical:directional_optical_entity_sensor'
	});
	event.shaped('ccoptical:directional_optical_entity_sensor', [
		'SSS',
		'IWI',
		'ICI'
	], {
		S: 'simulated:optical_sensor',
		W: '#c:wires/copper',
		C: 'powergrid:integrated_circuit',
		I: '#c:plates/iron'
	});
	
	
	
	event.remove({
		output: 'computercraft:wireless_modem_advanced'
	});
	event.shaped('computercraft:wireless_modem_advanced', [
		'RER',
		'TGT',
		'ICI'
	], {
		R: 'create_aquatic_ambitions:prismarine_alloy_rod',
		E: 'minecraft:end_crystal',
		G: 'powergrid:electrical_gizmo',
		T: 'create:transmitter',
		C: 'computercraft:wired_modem',
		I: '#c:plates/iron'
	});
	event.remove({
		output: 'computercraft:wireless_modem_normal'
	});
	event.shaped('computercraft:wireless_modem_normal', [
		'R R',
		'TGT',
		'ICI'
	], {
		R: 'minecraft:lightning_rod',
		G: 'powergrid:integrated_circuit',
		T: 'create:transmitter',
		C: 'computercraft:wired_modem',
		I: '#c:plates/iron'
	});
	event.remove({
		output: 'computercraft:redstone_relay'
	});
	event.shaped('computercraft:redstone_relay', [
		'IRI',
		'RWR',
		'ICI'
	], {
		R: 'powergrid:redstone_converter',
		C: 'computercraft:wired_modem',
		I: '#c:plates/iron',
		W: '#c:wires/copper'
	});
	event.remove({
		output: 'computercraft:printer'
	});
	event.shaped('computercraft:printer', [
		'IOI',
		'RMR',
		'ICI'
	], {
		R: 'rubberworks:rubber_sheet',
		C: 'powergrid:integrated_circuit',
		I: '#c:plates/iron',
		M: 'powergrid:electric_motor',
		O: 'simulated:laser_pointer'
	});
	event.remove({
		output: 'computercraft:disk_drive'
	});
	event.shaped('computercraft:disk_drive', [
		'IJI',
		'SML',
		'ICI'
	], {
		S: 'simulated:laser_sensor',
		C: 'powergrid:integrated_circuit',
		I: '#c:plates/iron',
		M: 'powergrid:electric_motor',
		L: 'simulated:laser_pointer',
		J: 'minecraft:jukebox'
	});
	event.remove({
		output: 'computercraft:speaker'
	});
	event.shaped('computercraft:speaker', [
		'IJI',
		'WCW',
		'IEI'
	], {
		I: '#c:plates/iron',
		W: 'powergrid:insulated_copper_wire',
		J: 'minecraft:note_block',
		E: 'create:electron_tube',
		C: 'powergrid:copper_coil'
	});
	event.remove({
		output: 'computercraft:wired_modem'
	});
	event.shaped('computercraft:wired_modem', [
		'I I',
		'IGI',
		'NWP'
	], {
		I: '#c:plates/iron',
		G: '#c:plates/gold',
		N: 'powergrid:bjt_npn',
		P: 'powergrid:bjt_pnp',
		W: 'computercraft:cable'
	});
	event.remove({
		output: 'computercraft:cable'
	});
	event.shaped('computercraft:cable', [
		'RWR',
		'WIW',
		'RWR'
	], {
		I: '#c:plates/iron',
		R: 'rubberworks:rubber_sheet',
		W: '#c:wires/copper'
	});
	
	
	
	event.remove({
		output: 'computercraft:disk'
	});
	event.shaped('computercraft:disk', [
		'P',
		'Q',
		'L'
	], {
		P: 'minecraft:paper',
		Q: 'create:rose_quartz',
		L: '#c:glass_panes'
	});
	event.remove({
		id: 'computercraft:turtle_normal'
	});
	event.shaped('computercraft:turtle_normal', [
		'ICI',
		'PMH',
		'IVI'
	], {
		I: '#c:plates/iron',
		C: 'computercraft:computer_normal',
		P: 'create:precision_mechanism',
		M: 'simulated:red_portable_engine',
		H: 'create:brass_hand',
		V: 'create:item_vault'
	});
	event.remove({
		id: 'computercraft:turtle_advanced'
	});
	event.remove({
		id: 'computercraft:turtle_advanced_upgrade'
	});
	event.shaped('computercraft:turtle_advanced', [
		'ICI',
		'PMH',
		'IVI'
	], {
		I: '#c:plates/iron',
		C: 'computercraft:computer_advanced',
		P: 'create:precision_mechanism',
		M: 'simulated:red_portable_engine',
		H: 'create:brass_hand',
		V: 'create:item_vault'
	});
	event.remove({
		id: 'computercraft:pocket_computer_normal'
	});
	event.shaped('computercraft:pocket_computer_normal', [
		'ICI',
		'IBI',
		'GGG'
	], {
		I: '#c:plates/iron',
		C: 'computercraft:computer_normal',
		G: '#c:plates/gold',
		B: 'powergrid:portable_battery'
	});
	event.remove({
		id: 'computercraft:pocket_computer_advanced'
	});
	event.remove({
		id: 'computercraft:pocket_computer_advanced_upgrade'
	});
	event.shaped('computercraft:pocket_computer_advanced', [
		'ICI',
		'IBI',
		'GGG'
	], {
		I: '#c:plates/iron',
		C: 'computercraft:computer_advanced',
		G: '#c:plates/gold',
		B: 'powergrid:portable_battery'
	});
	
	
	
	
	event.remove({
		output: 'harddisks:sparrow_platter'
	});
	event.shaped('harddisks:sparrow_platter', [
		'MMM',
		'GRG'
	], {
		M: 'powergrid:magnet',
		G: '#c:plates/gold',
		R: 'minecraft:redstone'
	});
	event.remove({
		output: 'harddisks:magpie_platter'
	});
	event.shaped('harddisks:magpie_platter', [
		'MMM',
		'GRG',
		'MMM'
	], {
		M: 'powergrid:magnet',
		G: '#c:plates/gold',
		R: 'minecraft:redstone'
	});
	event.remove({
		output: 'harddisks:sparrow_drive'
	});
	event.shaped('harddisks:sparrow_drive', [
		'IMC',
		'IEN',
		'IZI'
	], {
		M: 'powergrid:magnet',
		E: 'powergrid:electric_motor',
		Z: 'powergrid:integrated_circuit',
		I: '#c:plates/iron',
		C: 'powergrid:copper_coil',
		N: 'powergrid:bjt_npn'
	});
	event.remove({
		output: 'harddisks:magpie_drive'
	});
	event.shaped('harddisks:magpie_drive', [
		'CMC',
		'NEN',
		'IZI'
	], {
		M: 'powergrid:magnet',
		E: 'powergrid:electric_motor',
		Z: 'powergrid:integrated_circuit',
		I: '#c:plates/iron',
		C: 'powergrid:copper_coil',
		N: 'powergrid:bjt_npn'
	});
	
	
	
	
	event.remove({
		output: 'hudglassescc:hud_glasses'
	});
	event.shaped('hudglassescc:hud_glasses', [
		'MRM',
		'WEW',
		'RBR'
	], {
		M: 'computercraft:monitor_advanced',
		R: 'rubberworks:rubber_sheet',
		W: 'powergrid:copper_cord',
		E: 'computercraft:wireless_modem_advanced',
		B: 'powergrid:portable_battery'
	});
	event.remove({
		output: 'hudglassescc:hud_modem'
	});
	event.shaped('hudglassescc:hud_modem', [
		'WEW',
		'RMR'
	], {
		M: 'computercraft:wired_modem',
		R: 'rubberworks:rubber_sheet',
		W: 'powergrid:copper_cord',
		E: 'computercraft:wireless_modem_advanced',
	});
	
	
	

	event.shapeless("computercraft:computer_advanced", [
		"computercraft:computer_normal",
		"computercraft:computer_advanced"
	]).modifyResult("copyComponentMapCCN");
	event.shapeless("computercraft:turtle_advanced", [
		"computercraft:turtle_normal",
		"computercraft:turtle_advanced"
	]).modifyResult("copyComponentMapCCN");
	event.shapeless("computercraft:pocket_computer_advanced", [
		"computercraft:pocket_computer_normal",
		"computercraft:pocket_computer_advanced"
	]).modifyResult("copyComponentMapCCN");
	
});

ServerEvents.modifyRecipeResult('copyComponentMap', event => {
	let computer = event.grid.find('computercraft:computer_normal')
		?? event.grid.find('computercraft:turtle_normal')
		?? event.grid.find('computercraft:pocket_computer_normal');
    let result = event.item;
  	result.set(computer.componentMap);
    event.success(result);
});

