events.listen("recipes", function (e) {
  var types = ["ruby", "sapphire"];
  types.forEach((S) => {
    e.custom({
      type: "thermal:press",
      ingredients: [
        {
          item: "thermal:" + S,
          count: 1,
        },
      ],
      result: [
        {
          item: "kubejs:" + S + "_plate",
        },
      ],
    });
  });

  function craftPlate(lingot, plate) {
    e.custom({
      type: "minecraft:crafting_shapeless",
      ingredients: [{ item: lingot }, { item: "immersiveengineering:hammer" }],
      result: { item: plate },
    });
  }

  craftPlate("thermal:signalum_ingot", "thermal:signalum_plate");
  craftPlate("thermal:lumium_ingot", "thermal:lumium_plate");
  craftPlate("thermal:enderium_ingot", "thermal:enderium_plate");
  craftPlate("thermal:bronze_ingot", "thermal:bronze_plate");
  craftPlate("alltheores:tin_ingot", "thermal:tin_plate");
  craftPlate("thermal:invar_ingot", "thermal:invar_plate");
  craftPlate("thermal:sapphire", "kubejs:sapphire_plate");
  craftPlate("thermal:ruby", "kubejs:ruby_plate");

  e.custom({
    type: "thermal:press",
    ingredients: [
      {
        item: "alltheores:aluminum_ingot",
        count: 1,
      },
    ],
    result: [
      {
        item: "kubejs:aluminum_plate",
      },
    ],
  });

  e.custom({
    type: "thermal:press",
    ingredients: [
      {
        item: "mekanism:ingot_steel",
        count: 1,
      },
    ],
    result: [
      {
        item: "kubejs:steel_plate",
      },
    ],
  });
});
