// priority: 0

onEvent('recipes', e => {
  //removals
  removeRecipeByID(e, [
    MU("solar_panel"),
    MU("solar_panel_controller"),
    MU("lunar_panel"),
    MU("ender_tile"),
    MU("chorus_tile"),
    MU("stone_drum"),
    MU("iron_drum"),
    MU("reinforced_large_drum"),
    MU("netherite_reinforced_drum"),
    MU("unstable_drum"),
    MU("quantum_quarry"),
    MU("golden_lasso"),
    MU("speed_upgrade"),
    MU("laser_hub"),
    MU("laser_port"),
    MU("unstable_ingot"),
    MU("chorus_opinium_core"),
    MU("experience_opinium_core"),
    MU("nether_star_opinium_core"),
    MU("the_final_opinium_core"),
    MU("infused_helmet"),
    MU("infused_chestplate"),
    MU("infused_leggings"),
    MU("infused_boots"),
  ])

  //tools & armors
  const fromNetherite = [
    {
      input: MC("netherite_sword"),
      output: MU("etheric_sword"),
    },
    {
      input: MC("netherite_hoe"),
      output: MU("reversing_hoe"),
    },
    {
      input: MC("netherite_axe"),
      output: MU("healing_axe"),
    },
    {
      input: MC("netherite_shovel"),
      output: MU("erosion_shovel"),
    },
    {
      input: MC("shears"),
      output: MU("precision_shears"),
    },
    {
      input: MC("netherite_pickaxe"),
      output: MU("destruction_pickaxe"),
    },
    {
      input: MC("netherite_helmet"),
      output: MU("unstable_helmet"),
    },
    {
      input: MC("netherite_chestplate"),
      output: MU("unstable_chestplate"),
    },
    {
      input: MC("netherite_leggings"),
      output: MU("unstable_leggings"),
    },
    {
      input: MC("netherite_boots"),
      output: MU("unstable_boots"),
    },
  ]
  fromNetherite.forEach(obj => {
    const { input, output } = obj

    e.remove({ id: output })
    e.smithing(Item.of(output), input, Item.of(MU("unstable_ingot")).ignoreNBT())
  })

  //energy acceptor
  e.replaceInput({ id: MU("iron_opinium_core") }, MC("coal"), F("#gems/coke"))

  //angel ring: dragon ring
  e.replaceInput({ id: MU("ender_dragon_angel_ring") }, MC("black_dye"), F("#scales/dragon_scale"))

  //unstable ingot
  e.shaped(MU("unstable_ingot"), [
		'AAA',
		'BBB',
		'CCC'
	], {
		A: EC("crystaltine_ingot"),
		B: PREXP("basic_collector"),
		C: AV("crystal_matrix_ingot"),
	})

  //opinium cores
  e.shaped(MU("chorus_opinium_core"), [
		'ABA',
		'BCB',
		'ABA'
	], {
		A: MC("chorus_flower"),
		B: MU("emerald_opinium_core"),
		C: AE2("singularity"),
	})

  e.shaped(MU("experience_opinium_core"), [
		'ABA',
		'BCB',
		'ABA'
	], {
		A: MU("experience_pearl_3x"),
		B: MU("chorus_opinium_core"),
		C: AV("crystal_matrix_ingot"),
	})

  e.shaped(MU("nether_star_opinium_core"), [
		'ABA',
		'BCB',
		'ABA'
	], {
		A: MC("nether_star"),
		B: MU("experience_opinium_core"),
    C: EC("crystaltine_ingot"),
	})

  e.shaped(MU("the_final_opinium_core"), [
		'ABA',
		'BCB',
		'ABA'
	], {
		A: CR("refined_radiance"),
		B: MU("nether_star_opinium_core"),
    C: Item.of(MU("unstable_ingot")).ignoreNBT(),
	})

  //infused armor
  const { infused } = armorMats
  const { ultimate } = templates

  e.recipes.extendedcrafting.shaped_table(MU('infused_helmet'), ultimate.helmet, ultArmorObj(infused, "helmet"))
    .id(`${KJ()}:${MU()}/extended_crafting/infused_helmet`)

  e.recipes.extendedcrafting.shaped_table(MU('infused_chestplate'), ultimate.chestplate, ultArmorObj(infused, "chestplate"))
    .id(`${KJ()}:${MU()}/extended_crafting/infused_chestplate`)

  e.recipes.extendedcrafting.shaped_table(MU('infused_leggings'), ultimate.pants, ultArmorObj(infused, "pants"))
    .id(`${KJ()}:${MU()}/extended_crafting/infused_leggings`)

  e.recipes.extendedcrafting.shaped_table(MU('infused_boots'), ultimate.boots, ultArmorObj(infused, "boots"))
    .id(`${KJ()}:${MU()}/extended_crafting/infused_boots`)
})
