events.listen("recipes", function (e) {
  //dietetic past

  e.custom({
    type: "create:mechanical_crafting",
    pattern: [" BCB ", "CABAC", "CABAC", " BCB "],
    key: {
      A: { item: "immersivepetroleum:lubricant_bucket" },
      B: { item: "minecraft:clay_ball" },
      C: { item: "thermal:tar" },
    },
    result: { item: "powah:dielectric_paste", count: 64 },
  });

  // bloc de restonia

  e.custom({
    type: "create:mechanical_crafting",
    pattern: ["AAA", "ABA", "AAA"],
    key: {
      A: { item: "create:electron_tube" },
      B: { item: "create:super_glue" },
    },
    result: { item: "kubejs:restonia", count: 1 },
  });

  //dietetic casing

  e.shaped(item.of("powah:capacitor_basic", 1), [" AB", "ACA", "BA "], {
    A: "pneumaticcraft:ingot_iron_compressed",
    B: "powah:dielectric_paste",
    C: "thermal:tar",
  });
  //basic capa

  e.shaped(item.of("powah:dielectric_casing", 1), ["ABA", "CDC", "ABA"], {
    A: "botania:livingrock",
    B: "powah:dielectric_rod_horizontal",
    C: "powah:dielectric_rod",
    D: "powah:dielectric_paste",
  });

  function powahEnergise(craft, itema, itemb, itemc, itemd, rf) {
    e.remove({ id: craft });
    e.custom({
      type: "powah:energizing",
      ingredients: [
        { item: itema },
        { item: itemb },
        { item: itemc },
        { item: itemd },
      ],
      energy: rf,
      result: {
        item: craft,
      },
    });
  }

  e.custom({
    type: "powah:energizing",
    ingredients: [
      { tag: "mekanism:crystals/lead" },
      { tag: "mekanism:crystals/uranium" },
      { item: "mekanism:steel_casing" },
      { tag: "mekanism:crystals/tin" },
      { tag: "mekanism:crystals/gold" },
      { tag: "mekanism:crystals/copper" },
    ],

    energy: 1000000,
    result: {
      item: "mekanismgenerators:fission_reactor_casing",
    },
  });

  powahEnergise(
    "extendedcrafting:basic_component",
    "extendedcrafting:luminessence",
    "minecraft:iron_ingot",
    "minecraft:iron_ingot",
    "extendedcrafting:black_iron_slate",
    300000
  );
  powahEnergise(
    "extendedcrafting:elite_component",
    "extendedcrafting:luminessence",
    "minecraft:diamond",
    "minecraft:diamond",
    "extendedcrafting:black_iron_slate",
    2500000
  );
  powahEnergise(
    "extendedcrafting:ultimate_component",
    "extendedcrafting:luminessence",
    "minecraft:emerald",
    "minecraft:emerald",
    "extendedcrafting:black_iron_slate",
    3000000
  );
  powahEnergise(
    "extendedcrafting:redstone_component",
    "extendedcrafting:luminessence",
    "extendedcrafting:redstone_ingot",
    "extendedcrafting:redstone_ingot",
    "extendedcrafting:black_iron_slate",
    300000
  );
  powahEnergise(
    "extendedcrafting:advanced_component",
    "extendedcrafting:luminessence",
    "minecraft:gold_ingot",
    "minecraft:gold_ingot",
    "extendedcrafting:black_iron_slate",
    300000
  );
  powahEnergise(
    "extendedcrafting:ender_component",
    "extendedcrafting:luminessence",
    "extendedcrafting:ender_ingot",
    "extendedcrafting:ender_ingot",
    "extendedcrafting:black_iron_slate",
    5000000
  );
  powahEnergise(
    "extendedcrafting:enhanced_ender_component",
    "extendedcrafting:luminessence",
    "extendedcrafting:enhanced_ender_ingot",
    "extendedcrafting:enhanced_ender_ingot",
    "extendedcrafting:black_iron_slate",
    9000000
  );
  powahEnergise(
    "extendedcrafting:crystaltine_component",
    "extendedcrafting:luminessence",
    "extendedcrafting:crystaltine_ingot",
    "extendedcrafting:crystaltine_ingot",
    "extendedcrafting:black_iron_slate",
    100000000
  );
  powahEnergise(
    "extendedcrafting:the_ultimate_component",
    "extendedcrafting:luminessence",
    "extendedcrafting:the_ultimate_ingot",
    "extendedcrafting:the_ultimate_ingot",
    "extendedcrafting:black_iron_slate",
    300000000
  );
});
