// priority: 0

onEvent('recipes', event => {
	event.shaped(KJ('saw_blade'), [
		'NPN',
		'PLP',
		'NPN'
	], {
		N: F('#nuggets/iron'),
		P: F('#plates/iron'),
		L: F('#ingots/cobalt')
	})

	event.shaped(Item.of(KJ('black_psiblock'), 6), [
		'AAA',
		'BBB',
		'AAA'
	], {
		A: MC('black_concrete'),
		B: PRE('mobius_fuel')
	})

	event.shaped(Item.of(KJ('white_psiblock'), 6), [
		'AAA',
		'BBB',
		'AAA'
	], {
		A: MC('white_concrete'),
		B: PRE('aeternalis_fuel')
	})



	const wafers = [
		{
            output: Item.of(AE2('1k_cell_component'), 9),
            inputs: KJ('1k_component_wafer')
        },
        {
            output: Item.of(AE2('4k_cell_component'), 9),
            inputs: KJ('4k_component_wafer')
        },
        {
            output: Item.of(AE2('16k_cell_component'), 9),
            inputs: KJ('16k_component_wafer')
        },
        {
            output: Item.of(AE2('64k_cell_component'), 9),
            inputs: KJ('64k_component_wafer')
        },
        {
            output: Item.of(AE2E('256k_cell_component'), 9),
            inputs: KJ('256k_component_wafer')
        },
        {
            output: Item.of(AE2E('1m_cell_component'), 9),
            inputs: KJ('1m_component_wafer')
        },
        {
            output: Item.of(AE2E('4m_cell_component'), 9),
            inputs: KJ('4m_component_wafer')
        },
        {
            output: Item.of(AE2E('16m_cell_component'), 9),
            inputs: KJ('16m_component_wafer')
        },
		{
            output: Item.of(AE2('logic_processor'), 9),
            inputs: KJ('logic_processor_wafer')
        },
        {
            output: Item.of(AE2('engineering_processor'), 9),
            inputs: KJ('engineering_processor_wafer')
        },
        {
            output: Item.of(AE2('calculation_processor'), 9),
            inputs: KJ('calculation_processor_wafer')
        },
	]
	wafers.forEach((wafer) => {
        event.shapeless(wafer.inputs, wafer.output)
        event.shapeless(wafer.output, wafer.inputs);
    });



    //witherpoof blocks
    event.shaped(KJ("witherproof_block"), [
		' B ',
		'BSB',
		' B '
	], {
		B: TC("necrotic_bone"),
		S: MC("obsidian")
	})

    event.shaped(KJ("witherproof_bricks"), [
		'BB ',
		'BB '
	], {
		B: KJ("witherproof_block")
	})

    //c2m book
    event.recipes.extendedcrafting.shaped_table(Item.of("patchouli:guide_book").withNBT({"patchouli:book": "patchouli:c2m_guide_book"}), [
        'CDEDC',
        'DBBBD',
        'EBABE',
        'DBBBD',
        'CDEDC',
    ], {
        A: MC('book'),
        B: F('#storage_blocks/steel'),
        C: M('enriched_redstone'),
        D: M('enriched_carbon'),
        E: PREXP('violet_matter'),
    }).id(KJ(`c2m_guide_book`))

	//synthetic fuel
	event.custom({
        "type": M("rotary"),
        "fluidInput": {
            "amount": 1,
            "fluid": KJ("synthetic_fuel")
        },
        "fluidOutput": {
            "amount": 1,
            "fluid": KJ("synthetic_fuel")
        },
        "gasInput": {
            "amount": 1,
            "gas": KJ("gaseous_synthetic_fuel")
        },
        "gasOutput": {
            "amount": 1,
            "gas": KJ("gaseous_synthetic_fuel")
        }
    })
    event.custom({
        "type":M("chemical_infusing"),
        "leftInput":{
            "amount":1,
            "gas":KJ("gaseous_fuelium")
        },
        "rightInput":{
            "amount":1,
            "gas":KJ("gaseous_oil")
        },
        "output":{
            "gas":KJ("gaseous_synthetic_fuel"),
            "amount":1
        }
    })
})