// priority: 0

// Visit the wiki for more info - https://kubejs.com/

console.info('Hello, World! (Loaded server scripts)')

ServerEvents.recipes(event => {
	/* event.remove({ output: 'create_connected:item_silo'})
	event.remove({ output: 'create:item_vault'}) */
	event.remove({ output: 'createendertransmission:item_transmitter'})
	event.remove({ output: 'createendertransmission:fluid_transmitter'})
	event.remove({ output: 'createendertransmission:chunk_loader'})
	
	//create new age reactors
	event.remove({ output: 'create_new_age:reactor_casing'})
    event.remove({ output: 'create_new_age:reactor_rod'})
    event.remove({ output: 'create_new_age:reactor_glass'})
    event.remove({ output: 'create_new_age:reactor_fuel_acceptor'})
    event.remove({ output: 'create_new_age:reactor_heat_vent'})

	//ProjectE 
	event.remove({ output: 'projecte:philosophers_stone'})
	event.remove({ output: 'projecte:collector_mk1'})
	event.remove({ output: 'projecte:collector_mk2'})
	event.remove({ output: 'projecte:collector_mk3'})
	event.remove({ output: 'projecte:relay_mk1'})
	event.remove({ output: 'projecte:relay_mk2'})
	event.remove({ output: 'projecte:relay_mk3'})
	event.remove({ output: 'projecte:watch_of_flowing_time'})

	event.remove({ output: 'createappliedkinetics:energy_provider'})

	
	event.remove({ output: 'projecte:condenser_mk1'})
	event.shaped(
		Item.of('projecte:condenser_mk1', 1), 
		[
			'ABA',
			'BCB',
			'ABA'
		],
		{
			A: 'createnuclear:reactor_frame',
			B: 'minecraft:netherite_block', 
			C: 'projecte:philosophers_stone'
		}
	)

	event.shaped(
		Item.of('projecte:philosophers_stone', 1), 
		[
			'ABA',
			'BCB',
			'ABA'
		],
		{
			A: 'createnuclear:reactor_controller',
			B: 'createnuclear:enriched_soul_soil', 
			C: 'minecraft:dragon_egg'
		}
	)
	
	event.remove({ output: 'avaritia:swordofthe_cosmos'})
	event.remove({ output: 'avaritia:planet_eater'})
	event.remove({ output: 'avaritia:natures_ruin'})
	event.remove({ output: 'avaritia:hoeofthe_green_earth'})
	event.remove({ output: 'avaritia:world_breaker'})
	event.remove({ output: 'avaritia:infinity_armor_helmet'})
	event.remove({ output: 'avaritia:infinity_armor_chestplate'})
	event.remove({ output: 'avaritia:infinity_armor_leggings'})
	event.remove({ output: 'avaritia:infinity_armor_boots'})
	event.remove({ output: 'avaritia:skullfire_sword'}) 
	event.remove({ output: 'avaritia:longbowofthe_heavens'})
	event.remove({ output: 'avaritia:compressed_crafting_table'})
	event.remove({ output: 'avaritia:double_compressed_crafting_table'})
	event.remove({ output: 'avaritia:ultimate_stew'})
	event.remove({ output: 'avaritia:cosmic_meatballs'})
	event.remove({ output: 'avaritia:extreme_crafting_table'})

	event.remove({ output: 'avaritia:neutron_collector'})
	event.recipes.create.mechanical_crafting('avaritia:neutron_collector', [
		'BBAAAAABB',
		'B AAAAA B',
		'B  DDD  B',
		'Z DDDDD Z',
		'B DDZDD B',
		'Z DDDDD Z',
		'B  DDD  B',
		'B       B',
		'BBBZBZBBB'
	], {
		A: 'minecraft:quartz_block',
		B: 'minecraft:iron_block',
		D: 'minecraft:redstone_block',
		Z: 'avaritia:crystal_matrix_ingot'
	})

	event.remove({ output: 'avaritia:endest_pearl'})
	event.recipes.create.mechanical_crafting('avaritia:endest_pearl', [
		'   DDD   ',
		' DDBBBDD ',
		' DBBBBBD ',
		'DBBBEBBBD',
		'DBBEAEBBD',
		'DBBBEBBBD',
		' DBBBBBD ',
		' DDBBBDD ',
		'   DDD   '
	], {
		A: 'minecraft:nether_star',
		B: 'minecraft:ender_pearl',
		D: 'minecraft:end_stone',
		E: 'avaritia:neutronium_ingot'
	})

	event.remove({ output: 'avaritia:compressor'})
	event.recipes.create.mechanical_crafting('avaritia:compressor', [
		'CCCDDDCCC',
		'D B   B D',
		'C B   B C',
		'D B   B D',
		'EBB A BBE',
		'D B   B D',
		'C B   B C',
		'D B   B D',
		'CCCDCDCCC'
	], {
		A: 'avaritia:neutronium_block',
		B: 'avaritia:neutronium_ingot',
		D: 'minecraft:hopper',
		C: 'minecraft:iron_block',
		D: 'avaritia:crystal_matrix_ingot',
		E: 'minecraft:redstone_block'
	})

	event.remove({ output: 'avaritia:infinity_ingot'})
	event.recipes.create.mechanical_crafting('avaritia:infinity_ingot', [
		'AAAAAAAAA',
		'ACBBCBBCA',
		'ABCCBCCBA',
		'ACBBCBBCA',
		'AAAAAAAAA'
	], {
		A: 'avaritia:neutronium_ingot',
		B: 'avaritia:infinity_catalyst',
		C: 'avaritia:crystal_matrix_ingot'
	})

	event.remove({ output: 'avaritia:infinity_catalyst'})
	event.recipes.create.mechanical_crafting('avaritia:infinity_catalyst', [
		'A       G',
		' B     H ',
		'  C   D  ',
		'   ESF   ',
		'    Q    ',
		'   JIL   ',
		'  K   M  ',
		' N     O ',
		'P       R'
	], {
		A: 'avaritia:diamond_lattice',
		B: 'avaritia:crystal_matrix_ingot',
		C: 'avaritia:neutron_pile',
		D: 'avaritia:neutron_nugget',
		E: 'projecte:dark_matter_block',
		F: 'projecte:red_matter_block',
		G: 'avaritia:endest_pearl',
		H: 'avaritia:record_fragment',
		I: 'avaritia:iron_singularity',
		J: 'avaritia:gold_singularity',
		K: 'avaritia:lapis_singularity',
		L: 'avaritia:redstone_singularity',
		M: 'avaritia:quartz_singularity',
		N: 'avaritia:diamond_singularity',
		O: 'avaritia:emerald_singularity',
		P: 'avaritia:copper_singularity',
		Q: 'avaritia:amethyst_singularity',
		R: 'avaritia:netherite_singularity',
		S: 'avaritia:neutronium_ingot'
	})

	event.remove({ output: 'projecte:transmutation_table'})
	event.recipes.create.mechanical_crafting('projecte:transmutation_table', [
		'BCCMMMCCB',
		'CCDEGEDCC',
		'CDIFKFIDC',
		'MELHJHLEM',
		'MGKJAJKGM',
		'MELHJHLEM',
		'CDIFKFIDC',
		'CCDEGEDCC',
		'BCCMMMCCB'
	], {
		A: 'projecte:philosophers_stone',
		B: 'projecte:red_matter_block',
		C: 'createenderlink:ender_vault',
		D: 'projecte:dark_matter_block',
		E: 'avaritia:infinity_ingot',
		F: 'avaritia:crystal_matrix_block',
		G: 'avaritia:endest_pearl',
		H: 'avaritia:infinity_catalyst',
		I: 'avaritia:neutronium_ingot',
		J: 'avaritia:infinity_block',
		K: 'avaritia:amethyst_singularity',
		L: 'create:precision_mechanism',
		M: 'avaritia:neutronium_block'
	})

	/* // Remove Immersive Engineering hammer crafting recipes for plates
	const plateMaterials = [
		'iron', 'gold', 'copper', 'aluminum', 'silver', 'lead', 'nickel', 
		'uranium', 'osmium', 'tin', 'zinc', 'bronze', 'brass', 'constantan', 
		'electrum', 'steel', 'invar'
	]
	plateMaterials.forEach(material => {
		event.remove({ id: `immersiveengineering:crafting/plate_${material}_hammering` })
	})

	// Remove Immersive Engineering wire cutter recipes
	const wireMaterials = [
		'iron', 'gold', 'copper', 'aluminum', 'silver', 'lead', 'nickel', 
		'uranium', 'osmium', 'tin', 'zinc', 'bronze', 'brass', 'constantan', 
		'electrum', 'steel', 'invar'
	]
	wireMaterials.forEach(material => {
		event.remove({ id: `immersiveengineering:crafting/wire_${material}_cutting` })
	})
	// Remove recipes that use IE wire cutters as an ingredient/tool (only for steel, electrum, lead, copper, aluminum wires)
	const specificWireMaterials = ['steel', 'electrum', 'lead', 'copper', 'aluminum']
	specificWireMaterials.forEach(material => {
		// Remove recipes that use wire cutters and output these specific wires
		event.remove({ 
			mod: 'immersiveengineering',
			type: 'minecraft:crafting_shaped',
			input: '#immersiveengineering:tools/wirecutters',
			output: `immersiveengineering:wire_${material}`
		})
		event.remove({ 
			mod: 'immersiveengineering',
			type: 'minecraft:crafting_shapeless',
			input: '#immersiveengineering:tools/wirecutters',
			output: `immersiveengineering:wire_${material}`
		})
	}) */
	
	// Remove all Immersive Engineering recipes that use hammer as an ingredient
	event.remove({ 
		mod: 'immersiveengineering',
		input: '#immersiveengineering:tools/hammer'
	})
	event.remove({ 
		mod: 'immersiveengineering',
		input: 'immersiveengineering:hammer'
	})
	// Remove all Immersive Engineering recipes that use wire cutters as an ingredient
	event.remove({ 
		mod: 'immersiveengineering',
		input: '#immersiveengineering:tools/wirecutters'
	})
	event.remove({ 
		mod: 'immersiveengineering',
		input: 'immersiveengineering:wirecutter'
	})

	// Remove Create Diesel Generators hammer and cutting recipes
	const cdgMaterials = [
		'iron', 'gold', 'copper', 'aluminum', 'silver', 'lead', 'nickel', 
		'uranium', 'osmium', 'tin', 'zinc', 'bronze', 'brass', 'constantan', 
		'electrum', 'steel', 'invar'
	]
	cdgMaterials.forEach(material => {
		event.remove({ id: `createdieselgenerators:crafting/plate_${material}_hammering` })
		event.remove({ id: `createdieselgenerators:crafting/wire_${material}_cutting` })
	})
	
	// Remove all Create Diesel Generators hammering recipes (ingots to plates/sheets)
	event.remove({ 
		mod: 'createdieselgenerators', 
		type: 'createdieselgenerators:hammering'
	})

	// Remove all Create Diesel Generators recipes that output wires
	event.remove({ mod: 'createdieselgenerators', output: /createdieselgenerators:.*_wire/ })
	event.remove({ mod: 'createdieselgenerators', output: '#forge:wires' })
	// Remove all Create Diesel Generators recipes that output rods
	event.remove({ mod: 'createdieselgenerators', output: /createdieselgenerators:.*_rod/ })
	event.remove({ mod: 'createdieselgenerators', output: '#forge:rods' })
	// Remove Create Diesel Generators recipes that use Immersive Engineering iron rods
	event.remove({ mod: 'createdieselgenerators', input: 'immersiveengineering:stick_iron' })
	// Remove the recipe for Create Diesel Generators wire cutters
	event.remove({ output: 'createdieselgenerators:wire_cutters' })
	// Remove the recipe for Create Diesel Generators hammer
	event.remove({ output: 'createdieselgenerators:hammer' })
	// Remove all recipes that use Create Diesel Generators hammer as an ingredient
	event.remove({ input: 'createdieselgenerators:hammer' })

	//MIXING RECIPES
	//Tuff mixing recipe
	event.recipes.create.mixing('minecraft:tuff', ['minecraft:cobblestone', 'minecraft:andesite', Fluid.lava(50)])
	//Dripstone mixing recipe
	event.recipes.create.mixing('minecraft:dripstone_block', ['minecraft:cobblestone', 'minecraft:granite', Fluid.lava(100)])
	//Lapis mixing recipe
	event.recipes.create.mixing('minecraft:lapis_lazuli', ['minecraft:quartz', 'minecraft:blue_dye'])
	//Netherack mixing recipe
	//event.recipes.create.mixing('minecraft:netherrack', ['minecraft:stone', 'minecraft:nether_wart']).heated()
	//Rooted dirt mixing recipe
	event.recipes.create.mixing('minecraft:rooted_dirt', ['minecraft:dirt', 'minecraft:hanging_roots'])

	//HAUNTING RECIPES
	//phantom membrane
	//event.recipes.create.haunting('minecraft:feather', 'minecraft:phantom_membrane')

	//CRUSHING RECIPES 
  	//event.recipes.create.crushing([Item.of('create:zinc_nugget').withChance(0.125)], 'minecraft:tuff').processingTime(350)

	//Milling recipes
	//event.recipes.create.milling([Item.of('minecraft:clay_ball').withChance(0.5), Item.of('create:copper_nugget').withChance(0.125)], 'minecraft:dripstone_block')

})

