// 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`))

    //unstable tools
    event.recipes.createMechanicalCrafting(KJ("unstable_screwdriver"), [
        'CCCCC',
        'CBBBC',
        'CBABC',
        'CBBBC',
        'CCCCC',
    ], {
        A: Item.of(MU("unstable_ingot")).ignoreNBT(),
        B: PR_C('screwdriver'),
        C: AE2('singularity'),
    }).id(KJ(`mechanical_crafting/unstable_screwdriver`))

    event.recipes.extendedcrafting.shaped_table(KJ("unstable_screwdriver"), [
        'CCCCC',
        'CBBBC',
        'CBABC',
        'CBBBC',
        'CCCCC',
    ], {
        A: Item.of(MU("unstable_ingot")).ignoreNBT(),
        B: PR_C('screwdriver'),
        C: AE2('singularity'),
    }).id(KJ(`extended_crafting/unstable_screwdriver`))

    event.recipes.createMechanicalCrafting(KJ("unstable_chromatic_resonator"), [
        'CCCCC',
        'CBBBC',
        'CBABC',
        'CBBBC',
        'CCCCC',
    ], {
        A: Item.of(MU("unstable_ingot")).ignoreNBT(),
        B: KJ('chromatic_resonator'),
        C: AE2('singularity'),
    }).id(KJ(`mechanical_crafting/unstable_chromatic_resonator`))

    event.recipes.extendedcrafting.shaped_table(KJ("unstable_chromatic_resonator"), [
        'CCCCC',
        'CBBBC',
        'CBABC',
        'CBBBC',
        'CCCCC',
    ], {
        A: Item.of(MU("unstable_ingot")).ignoreNBT(),
        B: KJ('chromatic_resonator'),
        C: AE2('singularity'),
    }).id(KJ(`extended_crafting/unstable_chromatic_resonator`))

})