//priority: 0

onEvent('recipes', e => {

    removeRecipeByOutput(e, [
        AV("skullfire_sword"),
        //lava and blaze blades can be removed only through crafttweaker for some reason (handled in Removals.zs)
        MU("kikoku"),
        MU("etheric_sword"),
        PRE("dm_sword"),
        PRE("rm_sword"),
		PRE("rm_katar"),
		CC('the_incinerator'),
    ])

	//skullfire sword (neutral)
	const transSkullfire = TC("sword")
	e.recipes.createSequencedAssembly([
		AV("skullfire_sword"),
	], Item.of(TC("sword")).ignoreNBT(), [
		e.recipes.createFilling(transSkullfire, [transSkullfire, Fluid.of(EE("molten_coal"), 1000)]),
		e.recipes.createDeploying(transSkullfire, [transSkullfire, F('#gems/coke')]),
		e.recipes.createDeploying(transSkullfire, [transSkullfire, PRE('klein_star_drei')]), //(2048*8+8192)*4*4 = 393k
		e.recipes.createFilling(transSkullfire, [transSkullfire, Fluid.of(TC("molten_brass"), 1000)]),
	]).transitionalItem(transSkullfire)
		.loops(1)
		.id(KJ('skullfire_sword'))



	//evil sword (evil)
	e.shaped(SS("evil_sword"), [
		'EDE',
		'CAC',
		'EBE'
	], {
		A: Item.of(AV("skullfire_sword")).ignoreNBT(),
		B: PRE('klein_star_vier'), //393216*4 = 1.57 mil
		C: MC("lava_bucket"),
		D: EE("molten_redstone_bucket"),
		E: AE2("charged_certus_quartz_crystal"),
	}).id(KJ('evil_sword'))



	//nature sword (good)
	e.shaped(SS("nature_sword"), [
		'EDE',
		'CAC',
		'EBE'
	], {
		A: Item.of(AV("skullfire_sword")).ignoreNBT(),
		B: PRE('klein_star_vier'), //393216*4 = 1.57 mil
		C: MC("water_bucket"),
		D: TC("molten_obsidian_bucket"),
		E: AE2('sky_dust'),
	}).id(KJ('nature_sword'))



	//lightning sword (evil)
	const transLightningSword = SS("evil_sword")
	e.recipes.createSequencedAssembly([
		LS("lightningswordtool"),
	], Item.of(SS("evil_sword")).ignoreNBT(), [
		e.recipes.createDeploying(transLightningSword, [transLightningSword, MC('end_rod')]),
		e.recipes.createDeploying(transLightningSword, [transLightningSword, CR('electron_tube')]),
		e.recipes.createDeploying(transLightningSword, [transLightningSword, PRE('klein_star_drei')]), //393216*4*4 = 6.2 mil
		e.recipes.createFilling(transLightningSword, [transLightningSword, Fluid.of(TC("molten_obsidian"), 1000)]),
	]).transitionalItem(transLightningSword)
		.loops(16)
		.id(KJ('lightning_sword'))



	//cloud sword (good)
	const transCloudSword = SS("nature_sword")
	e.recipes.createSequencedAssembly([
		SS("cloud_sword"),
	], Item.of(SS("nature_sword")).ignoreNBT(), [
		e.recipes.createDeploying(transCloudSword, [transCloudSword, Q('bottled_cloud')]),
		e.recipes.createDeploying(transCloudSword, [transCloudSword, CR('electron_tube')]),
		e.recipes.createDeploying(transCloudSword, [transCloudSword, PRE('klein_star_drei')]), //393216*4*4 = 6.2 mil
		e.recipes.createFilling(transCloudSword, [transCloudSword, Fluid.of(EE("molten_redstone"), 1000)]),
	]).transitionalItem(transCloudSword)
		.loops(16)
		.id(KJ('cloud_sword'))



	//redstone flaming sword (immolation blade) (evil)
    e.recipes.createMechanicalCrafting(WST('lava_blade'), [
		'   DD',
		' BDED',
		' BCD ',
		' FBB ',
		'A    ',
	], {
		A: PRE('klein_star_omega'), //25 mil
		B: MU('diamond_opinium_core'),
		C: Item.of(LS("lightningswordtool")).ignoreNBT(),
		D: F('#ingots/red_alloy'),
		E: MC('nether_star'),
		F: PRE('relay_mk1'),
	}).id(KJ("lava_blade"))



	//sword of skylord (good)
    e.recipes.createMechanicalCrafting(SS('sword_of_skylord'), [
		'   DD',
		' BDED',
		' BCD ',
		' FBB ',
		'A    ',
	], {
		A: PRE('klein_star_omega'), //25 mil
		B: MU('diamond_opinium_core'),
		C: Item.of(SS("cloud_sword")).ignoreNBT(),
		D: AE2('singularity'),
		E: MC('nether_star'),
		F: PRE('collector_mk1'),
	}).id(KJ("sword_of_skylord"))



	//soul sword (evil)
    e.recipes.createMechanicalCrafting(SS('soul_sword'), [
		'     DD',
		'    DFD',
		' H DFD ',
		' CDED  ',
		'  GD   ',
		' B CH  ',
		'A      ',
	], {
		A: PREXP('magnum_star_ein'), //100.64 mil
		B: MU('experience_opinium_core'),
		C: MU('nether_star_opinium_core'),
		D: CRAD('overcharged_alloy'),
		E: Item.of(WST('lava_blade')).ignoreNBT(),
		F: CR('shadow_steel'),
		G: PRE('relay_mk1'),
		H: CC('monstrous_horn'),
	}).id(KJ("soul_sword"))



	//protective soul sword (wither sword) (good)
    e.recipes.createMechanicalCrafting(SS('wither_sword'), [
		'     DD',
		'    DFD',
		' H DFD ',
		' CDED  ',
		'  GD   ',
		' B CH  ',
		'A      ',
	], {
		A: PREXP('magnum_star_ein'), //100.64 mil
		B: MU('experience_opinium_core'),
		C: MU('nether_star_opinium_core'),
		D: CRAD('overcharged_alloy'),
		E: Item.of(SS('sword_of_skylord')).ignoreNBT(),
		F: CR('refined_radiance'),
		G: PRE('collector_mk1'),
		H: CC('monstrous_horn'),
	}).id(KJ("wither_sword"))



	//evil dragon sword (weak dragon sword) (evil)
    e.recipes.extendedcrafting.shaped_table(SS('weak_dragon_sword'), [
		'     DD',
		'    DFD',
		' H DFD ',
		' GDED  ',
		'  ID   ',
		' B GH  ',
		'A      ',
	], {
		A: PREXP('magnum_star_zwei'), //400.64 mil
		B: MU('the_final_opinium_core'),
		D: TC('blood_slime_ball'),
		E: Item.of(SS('soul_sword')).ignoreNBT(),
		F: MC('dragon_egg'),
		G: KJ("256k_component_wafer"),
		H: SS('red_nether_star'),
		I: PRE('relay_mk1'),
	}).id(KJ("weak_dragon_sword"))



	//good dragon sword (good)
    e.recipes.extendedcrafting.shaped_table(WST('blaze_blade'), [
		'     DD',
		'    DFD',
		' H DFD ',
		' GDED  ',
		'  ID   ',
		' B GH  ',
		'A      ',
	], {
		A: PREXP('magnum_star_zwei'), //400.64 mil
		B: MU('the_final_opinium_core'),
		D: MC('magma_cream'),
		E: Item.of(SS('wither_sword')).ignoreNBT(),
		F: MC('dragon_egg'),
		G: KJ("256k_component_wafer"),
		H: EC('ender_star'),
		I: PRE('collector_mk1'),
	}).id(KJ("blaze_blade"))



	//self-harm sword (weak god sword) (evil)
    e.recipes.extendedcrafting.shaped_table(SS('weak_god_sword'), [
		'       KL',
		'      JRM',
		'     IEN ',
		' F  HEO  ',
		' C GEP   ',
		'  CDQ    ',
		'  BC     ',
		' B  CF   ',
		'A        ',
	], {
		A: PREXP('magnum_star_zwei'), //400.64 mil
		B: MU('the_final_opinium_core'),
		C: CM('star_infused_netherite_ingot'),
		D: Item.of(SS('weak_dragon_sword')).ignoreNBT(),
		E: KJ('computation_matrix'),
		F: CR('shadow_steel_casing'),
		G: KJ('zero'),
		H: KJ('one'),
		I: KJ('two'),
		J: KJ('three'),
		K: KJ('four'),
		L: Item.of('extendedcrafting:singularity', { Id:"extendedcrafting:shadow_steel" }),
		M: KJ('five'),
		N: KJ('six'),
		O: KJ('seven'),
		P: KJ('eight'),
		Q: KJ('nine'),
		R: PRE('relay_mk1'),
	}).id(KJ("weak_god_sword"))



	//oceanic sword (good)
    e.recipes.extendedcrafting.shaped_table(SS('oceanic_sword'), [
		'       KL',
		'      JRM',
		'     IEN ',
		' F  HEO  ',
		' C GEP   ',
		'  CDQ    ',
		'  BC     ',
		' B  CF   ',
		'A        ',
	], {
		A: PREXP('magnum_star_zwei'), //400.64 mil
		B: MU('the_final_opinium_core'),
		C: CM('star_infused_netherite_ingot'),
		D: Item.of(WST('blaze_blade')).ignoreNBT(),
		E: KJ('computation_matrix'),
		F: CR('refined_radiance_casing'),
		G: KJ('zero'),
		H: KJ('one'),
		I: KJ('two'),
		J: KJ('three'),
		K: KJ('four'),
		L: Item.of('extendedcrafting:singularity', { Id:"extendedcrafting:refined_radiance" }),
		M: KJ('five'),
		N: KJ('six'),
		O: KJ('seven'),
		P: KJ('eight'),
		Q: KJ('nine'),
		R: PRE('collector_mk1'),
	}).id(KJ("oceanic_sword"))



    //etheric sword (the doubter's sword) from evil (neutral)
    e.custom({
        input: [
			{ item: KJ('1m_component_wafer') },
			{ item: SS('weak_god_sword') },
			{ item: KJ('1m_component_wafer') },
			{ item: IF("plastic") },
			{ item: IF("plastic") },
			{ item: EC("ender_star") },
			{ item: PREXP("magnum_star_zwei") }, //400.64 mil
			{ item: EC("ender_star") }
        ],
        inputFluid: "{FluidName:\"industrialforegoing:latex\",Amount:8000}",
        processingTime: 400,
        output: {
          item: MU("etheric_sword"),
          count: 1
        },
        type: IF("dissolution_chamber")
    }).id(KJ("etheric_sword_from_evil"))



    //etheric sword (the doubter's sword) from good (neutral)
    e.custom({
        input: [
			{ item: KJ('1m_component_wafer') },
			{ item: SS('oceanic_sword') },
			{ item: KJ('1m_component_wafer') },
			{ item: IF("plastic") },
			{ item: IF("plastic") },
			{ item: SS("red_nether_star") },
			{ item: PREXP("magnum_star_zwei") }, //400.64 mil
			{ item: SS("red_nether_star") }
        ],
        inputFluid: "{FluidName:\"industrialforegoing:latex\",Amount:8000}",
        processingTime: 400,
        output: {
          item: MU("etheric_sword"),
          count: 1
        },
        type: IF("dissolution_chamber")
    }).id(KJ("etheric_sword_from_good"))



    //zweinder sword (evil)
    e.custom({
        input: [
			{ item: AV("endest_pearl") },
			{ item: MU("etheric_sword") },
			{ item: AV("endest_pearl") },
			{ tag: F("ingots/pink_slime") },
			{ tag: F("ingots/pink_slime") },
			{ item: PRE("relay_mk2") },
			{ item: PREXP("magnum_star_drei") }, //1.6 bil
			{ item: PRE("relay_mk2") },
        ],
        inputFluid: "{FluidName:\"industrialforegoing:pink_slime\",Amount:8000}",
        processingTime: 400,
        output: {
          item: CC("zweiender"),
          count: 1
        },
        type: IF("dissolution_chamber")
    }).id(KJ("zweinder"))



    //saint kikoku sword (good)
    e.custom({
        input: [
			{ item: AV("endest_pearl") },
			{ item: MU("etheric_sword") },
			{ item: AV("endest_pearl") },
			{ tag: F("ingots/pink_slime") },
			{ tag: F("ingots/pink_slime") },
			{ item: PRE("collector_mk2") },
			{ item: PREXP("magnum_star_drei") }, //1.6 bil
			{ item: PRE("collector_mk2") },
        ],
        inputFluid: "{FluidName:\"industrialforegoing:pink_slime\",Amount:8000}",
        processingTime: 400,
        output: {
          item: MU("kikoku"),
          count: 1
        },
        type: IF("dissolution_chamber")
    }).id(KJ("kikoku"))



    //final fractal sword (evil)
    e.custom({
        input: [
			{ item: AV("endest_pearl") },
			{ item: CC("zweiender") },
			{ item: AV("endest_pearl") },
			{ item: CC("ignitium_block") },
			{ item: CC("ignitium_block") },
			{ item: PRE("relay_mk2") },
			{ item: PREXP("magnum_star_drei") }, //1.6 bil
			{ item: PRE("relay_mk2") },
        ],
        inputFluid: "{FluidName:\"industrialforegoing:ether_gas\",Amount:8000}",
        processingTime: 400,
        output: {
          item: CC("final_fractal"),
          count: 1
        },
        type: IF("dissolution_chamber")
    }).id(KJ("final_fractal"))



    //the incinerator (good)
    e.custom({
        input: [
			{ item: AV("endest_pearl") },
			{ item: MU("kikoku") },
			{ item: AV("endest_pearl") },
			{ item: CC("ignitium_block") },
			{ item: CC("ignitium_block") },
			{ item: PRE("collector_mk2") },
			{ item: PREXP("magnum_star_drei") }, //1.6 bil
			{ item: PRE("collector_mk2") },
        ],
        inputFluid: "{FluidName:\"industrialforegoing:ether_gas\",Amount:8000}",
        processingTime: 400,
        output: {
          item: CC("the_incinerator"),
          count: 1
        },
        type: IF("dissolution_chamber")
    }).id(KJ("the_incinerator"))



	//dark matter sword from evil (neutral)
    e.recipes.extendedcrafting.shaped_table(PRE('dm_sword'), [
		'       EE',
		'      EGE',
		'     EFE ',
		'    EFE  ',
		' C EFE   ',
		'  CDE    ',
		'  BC     ',
		' B  C    ',
		'A        ',
	], {
		A: PREXP('magnum_star_drei'), // 1.6 bil
		B: Item.of('extendedcrafting:singularity', { Id:"extendedcrafting:shadow_steel" }),
		C: KJ('4m_component_wafer'),
		D: CC("final_fractal"),
		E: PRE('dark_matter_block'),
		F: Item.of('extendedcrafting:singularity', { Id:"extendedcrafting:dark_matter" }),
		G: Item.of('extendedcrafting:singularity', { Id:"extendedcrafting:antimatter_relay_mk2" }),
	}).id(KJ("dm_sword_from_evil"))



	//dark matter sword from good (neutral)
    e.recipes.extendedcrafting.shaped_table(PRE('dm_sword'), [
		'       EE',
		'      EGE',
		'     EFE ',
		'    EFE  ',
		' C EFE   ',
		'  CDE    ',
		'  BC     ',
		' B  C    ',
		'A        ',
	], {
		A: PREXP('magnum_star_drei'), // 1.6 bil
		B: Item.of('extendedcrafting:singularity', { Id:"extendedcrafting:refined_radiance" }),
		C: KJ('4m_component_wafer'),
		D: CC("the_incinerator"),
		E: PRE('dark_matter_block'),
		F: Item.of('extendedcrafting:singularity', { Id:"extendedcrafting:dark_matter" }),
		G: Item.of('extendedcrafting:singularity', { Id:"extendedcrafting:energy_collector_mk2" }),
	}).id(KJ("dm_sword_from_good"))



    //rm sword (neutral)
    e.custom({
        input: [
			{ item: SS('red_nether_star') },
			{ item: PRE("dm_sword") },
			{ item: SS('red_nether_star') },
			{ item: PRE("red_matter_block") },
			{ item: PRE("red_matter_block") },
			{ item: PREXP("dark_power_flower") },
			{ item: PREXP("magnum_star_drei") }, //1.6 bil
			{ item: PREXP("dark_power_flower") }
        ],
        inputFluid: "{FluidName:\"boss_tools:oil\",Amount:8000}",
        processingTime: 400,
        output: {
          item: PRE("rm_sword"),
          count: 1
        },
        type: IF("dissolution_chamber")
    }).id(KJ("rm_sword"))



    //rm katar (neutral)
    e.custom({
        input: [
			{ item: M("ultimate_induction_cell") },
			{ item: PRE("rm_sword") },
			{ item: M("ultimate_induction_cell") },
			{ item: PREXP("magnum_star_drei") }, //1.6 bil
			{ item: PREXP("magnum_star_drei") }, //1.6 bil
			{ item: M("ultimate_induction_provider") },
			{ item: KJ('4m_component_wafer') },
			{ item: M("ultimate_induction_provider") }
        ],
        inputFluid: "{FluidName:\"mekanism:lithium\",Amount:8000}",
        processingTime: 400,
        output: {
          item: PRE("rm_katar"),
          count: 1
        },
        type: IF("dissolution_chamber")
    }).id(KJ("rm_katar"))



	//atomic dissasembler (neutral)
    e.recipes.extendedcrafting.shaped_table(M('atomic_disassembler'), [
		' EEEEEEE ',
		'EGFFFFFGE',
		'EEFFFFFE ',
		' EEFGFE  ',
		'   BDE   ',
		'   BCB   ',
		'   BCB   ',
		'   BCB   ',
		'    A    ',
	], {
		A: PREXP('magnum_star_vier'), // 6.4 bil
		B: F('#storage_blocks/refined_obsidian'),
		C: F('#storage_blocks/refined_glowstone'),
		D: PRE("rm_katar"),
		E: M('hdpe_rod'),
		F: M("reprocessed_fissile_fragment"),
		G: KJ('16m_component_wafer'),
	}).id(KJ("atomic_disassembler"))



	//infinity hammer (neutral)
    e.recipes.extendedcrafting.shaped_table(IF('infinity_hammer'), [
		'     C   ',
		'    HIC  ',
		'   HICGC ',
		'  HICFC  ',
		' CICEC   ',
		'  CDC    ',
		'  BC     ',
		' B       ',
		'A        ',
	], {
		A: PREXP('magnum_star_vier'), // 6.4 bil
		B: M("reprocessed_fissile_fragment"),
		C: M('ultimate_induction_cell'),
		D: M("atomic_disassembler"),
		E: Item.of('extendedcrafting:singularity', { Id:"extendedcrafting:energy_collector_mk3" }),
		F: Item.of('extendedcrafting:singularity', { Id:"extendedcrafting:green_matter" }),
		G: Item.of('extendedcrafting:singularity', { Id:"extendedcrafting:antimatter_relay_mk3" }),
		H: M("pellet_antimatter"),
		I: AV("neutronium_ingot"),
	}).id(KJ("infinity_hammer"))


})