ServerEvents.recipes((event) => {
  // =========================================
  // Powah Components
  // =========================================

  // Dielectric Paste
  event
    .custom({
      type: "create_new_age:energising",
      energy_needed: 1000,
      ingredients: [
        {
          item: "deeperdarker:soul_dust",
        },
      ],
      results: [
        {
          item: "powah:dielectric_paste",
        },
      ],
    })
    .id("powah:crafting/dielectric_paste");

  // Dielectric Rods
  event
    .shaped("8x powah:dielectric_rod", [
        "ABA", 
        "ABA", 
        "ABA"
    ], 
    {
      A: "powah:dielectric_paste",
      B: "deeperdarker:sculk_bone",
    })
    .id("powah:crafting/dielectric_rod");
  event
    .shaped("8x powah:dielectric_rod_horizontal", [
        "AAA", 
        "BBB", 
        "AAA"
    ], 
    {
      A: "powah:dielectric_paste",
      B: "deeperdarker:sculk_bone",
    })
    .id("powah:crafting/dielectric_rod_h");

  // Dielectric Casing
  event
    .shaped("powah:dielectric_casing", [
        "ABA", 
        "CDC", 
        "ABA"
    ], 
    {
      A: "#forge:ingots/invar",
      B: "powah:dielectric_rod_horizontal",
      C: "powah:dielectric_rod",
      D: "alexscaves:heart_of_iron",
    })
    .id("powah:crafting/dielectric_casing");

  // Basic Capacitor
  event
    .shaped("4x powah:capacitor_basic", [
        " AB", 
        "ACA", 
        "BA "
    ], 
    {
      A: "#forge:ingots/invar",
      B: "powah:dielectric_paste",
      C: "thermal:rf_coil",
    })
    .id("powah:crafting/capacitor_basic");

  // =========================================
  // Powah Machines
  // =========================================
  event.replaceInput(
    { id: /^powah:.*starter$/ },
    "powah:dielectric_casing",
    "create_new_age:sculked_magnet"
  );
  event.replaceInput(
    { id: /^powah:.*starter$/ },
    "minecraft:furnace",
    "thermal:machine_furnace"
  );
  event.replaceInput(
    { id: /^powah:.*starter$/ },
    "minecraft:bucket",
    "thermal:machine_crucible"
  );
  event.replaceInput(
    { id: /^powah:.*/ },
    "#forge:ingots/iron",
    "#forge:ingots/invar"
  );
  event.replaceInput(
    { id: /^powah:.*/ },
    "#forge:nuggets/iron",
    "#forge:nuggets/invar"
  );
  event.replaceInput(
    { id: /^powah:.*/ },
    "#forge:storage_blocks/quartz",
    "alexscaves:tesla_bulb"
  );
  event
    .shaped("powah:reactor_starter", [
        "ABA", 
        "BCB", 
        "ABA"
    ], 
    {
      A: "powah:uraninite",
      B: "powah:capacitor_basic_tiny",
      C: "create_new_age:lunar_magnet",
    })
    .id("powah:crafting/reactor_starter");

  // =========================================
  // Energizing Orb Recipes
  // =========================================
  event.recipes.powah.energizing(
    ["alexscaves:block_of_uranium"],
    "10x powah:uraninite",
    100000
  );
  event.recipes.powah
    .energizing(["rats:oratchalcum_ingot"], "2x powah:steel_energized", 10000)
    .id("powah:energizing/energized_steel");
  event.recipes.powah
    .energizing(
      ["minecraft:blaze_powder", "ad_astra:desh_ingot"],
      "powah:crystal_blazing",
      120000
    )
    .id("powah:energizing/blazing_crystal");
  event.recipes.powah
    .energizing(
      ["create_new_age:overcharged_diamond"],
      "powah:crystal_niotic",
      300000
    )
    .id("powah:energizing/niotic_crystal");
  event.recipes.powah
    .energizing(["create_dd:mithril_ingot"], "powah:crystal_spirited", 1000000)
    .id("powah:energizing/spirited_crystal");
  event.recipes.powah
    .energizing(
      [
        "alexscaves:pure_darkness",
        "ad_astra:calorite_block",
        "ad_astra:calorite_block",
        "powah:blazing_crystal_block",
      ],
      "16x powah:crystal_nitro",
      20000000
    )
    .id("powah:energizing/nitro_crystal");
});
