events.listen("recipes", function (e) {
  /*********************************** MYSTICAL AGRICULTURE ***********************************/
  function gardenma(crop, soil, qte) {
    e.custom({
      type: "immersiveengineering:cloche",
      input: { item: "mysticalagriculture:" + crop + "_seeds" },
      soil: { item: soil },
      time: 50,
      render: { type: "crop", block: "mysticalagriculture:" + crop + "_crop" },
      results: [
        { item: "mysticalagriculture:" + crop + "_essence", count: qte },
      ],
    });
  }
  var crop = [
    "air",
    "earth",
    "water",
    "fire",
    "inferium",
    "stone",
    "dirt",
    "wood",
    "ice",
    "nature",
    "dye",
    "nether",
    "coal",
    "coral",
    "honey",
    "pig",
    "chicken",
    "cow",
    "sheep",
    "squid",
    "fish",
    "slime",
    "turtle",
    "rubber",
    "silicon",
    "sulfur",
    "aluminum",
    "copper",
    "saltpeter",
    "mystical_flower",
    "apatite",
    "marble",
    "limestone",
    "basalt",
    "iron",
    "nether_quartz",
    "glowstone",
    "redstone",
    "obsidian",
    "prismarine",
    "zombie",
    "skeleton",
    "creeper",
    "spider",
    "rabbit",
    "tin",
    "bronze",
    "zinc",
    "brass",
    "silver",
    "lead",
    "graphite",
    "blizz",
    "blitz",
    "basalz",
    "manasteel",
    "ender_biotite",
    "aquamarine",
    "rose_gold",
    "slimesteel",
    "pig_iron",
    "tinkers_bronze",
    "quartz_enriched_iron",
    "compressed_iron",
    "gold",
    "lapis_lazuli",
    "end",
    "experience",
    "blaze",
    "ghast",
    "enderman",
    "steel",
    "nickel",
    "constantan",
    "electrum",
    "invar",
    "uranium",
    "signalum",
    "lumium",
    "hop_graphite",
    "elementium",
    "osmium",
    "refined_glowstone",
    "refined_obsidian",
    "starmetal",
    "energized_steel",
    "blazing_crystal",
    "fluorite",
    "cobalt",
    "hepatizon",
    "sapphire",
    "ruby",
    "diamond",
    "emerald",
    "netherite",
    "wither_skeleton",
    "platinum",
    "enderium",
    "terrasteel",
    "rock_crystal",
    "yellorium",
    "cyanite",
    "niotic_crystal",
    "spirited_crystal",
    "uraninite",
    "manyullyn",
    "queens_slime",
    "draconium",
    "horse",
    "witch",
    "llama",
    "wolf",
    "cat",
    "bat",
    "fox",
    "panda",
    "parrot",
    "fiery_ingot",
    "knightmetal",
    "evoker",
    "alfstein",
    "tanium",
    "piglin_brute",
    "guardian",
    "steeleaf",
    "ironwood",
    "sky_stone",
    "certus_quartz",
    "husk",
    "zombified_piglin",
    "silverfish",
    "drowned",
    "vex",
    "dolphin",
    "stray",
    "polar_bear",
    "fluix",
    "ravager",
    "magma_cube",
    "pillager",
    "piglin",
    "endermite",
    "shulker",
    "villager",
    "vindicator",
    "phantom",
    "mooshroom",
  ];
  crop.forEach((C) => {
    gardenma(C, "minecraft:dirt", 1);
  });
  crop.forEach((C) => {
    gardenma(C, "mysticalagriculture:inferium_farmland", 2);
  });
  crop.forEach((C) => {
    gardenma(C, "mysticalagriculture:prudentium_farmland", 3);
  });
  crop.forEach((C) => {
    gardenma(C, "mysticalagriculture:tertium_farmland", 4);
  });
  crop.forEach((C) => {
    gardenma(C, "mysticalagriculture:imperium_farmland", 5);
  });
  crop.forEach((C) => {
    gardenma(C, "mysticalagriculture:supremium_farmland", 6);
  });
  crop.forEach((C) => {
    gardenma(C, "mysticalagradditions:insanium_farmland", 7);
  });

  /*********************************** THERMAL ***********************************/
  function gardenthermal(crop, render, soil, qte) {
    e.custom({
      type: "immersiveengineering:cloche",
      input: { item: "thermal:" + crop + "_seeds" },
      soil: { item: soil },
      time: 50,
      render: { type: render, block: "thermal:" + crop + "" },
      results: [{ item: "thermal:" + crop + "", count: qte }],
    });
  }
  var crop = [
    "radish",
    "onion",
    "corn",
    "tomato",
    "strawberry",
    "barley",
    "green_bean",
    "eggplant",
    "peanut",
    "bell_pepper",
    "spinach",
    "sadiroot",
    "rice",
    "tea",
    "coffee",
  ];
  crop.forEach((C) => {
    gardenthermal(C, "crop", "minecraft:dirt", 1);
  });
  crop.forEach((C) => {
    gardenthermal(C, "crop", "mysticalagriculture:inferium_farmland", 2);
  });
  crop.forEach((C) => {
    gardenthermal(C, "crop", "mysticalagriculture:prudentium_farmland", 3);
  });
  crop.forEach((C) => {
    gardenthermal(C, "crop", "mysticalagriculture:tertium_farmland", 4);
  });
  crop.forEach((C) => {
    gardenthermal(C, "crop", "mysticalagriculture:imperium_farmland", 5);
  });
  crop.forEach((C) => {
    gardenthermal(C, "crop", "mysticalagriculture:supremium_farmland", 6);
  });
  crop.forEach((C) => {
    gardenthermal(C, "crop", "mysticalagradditions:insanium_farmland", 7);
  });

  var stem = ["frost_melon"];
  stem.forEach((C) => {
    gardenthermal(C, "stem", "minecraft:dirt", 1);
  });
  stem.forEach((C) => {
    gardenthermal(C, "stem", "mysticalagriculture:inferium_farmland", 2);
  });
  stem.forEach((C) => {
    gardenthermal(C, "stem", "mysticalagriculture:prudentium_farmland", 3);
  });
  stem.forEach((C) => {
    gardenthermal(C, "stem", "mysticalagriculture:tertium_farmland", 4);
  });
  stem.forEach((C) => {
    gardenthermal(C, "stem", "mysticalagriculture:imperium_farmland", 5);
  });
  stem.forEach((C) => {
    gardenthermal(C, "stem", "mysticalagriculture:supremium_farmland", 6);
  });
  stem.forEach((C) => {
    gardenthermal(C, "stem", "mysticalagradditions:insanium_farmland", 7);
  });

  /*********************************** PAMS ***********************************/
  function gardenpam(crop, soil, qte) {
    e.custom({
      type: "immersiveengineering:cloche",
      input: { item: "pamhc2crops:" + crop + "seeditem" },
      soil: { item: soil },
      time: 50,
      render: { type: "crop", block: "pamhc2crops:pam" + crop + "crop" },
      results: [{ item: "pamhc2crops:" + crop + "item", count: qte }],
    });
  }
  var crop = [
    "agave",
    "amaranth",
    "arrowroot",
    "artichoke",
    "asparagus",
    "barley",
    "bean",
    "bellpepper",
    "blackberry",
    "blueberry",
    "broccoli",
    "brusselsprout",
    "cabbage",
    "cactusfruit",
    "candleberry",
    "cantaloupe",
    "cassava",
    "cauliflower",
    "celery",
    "chickpea",
    "chilipepper",
    "coffeebean",
    "corn",
    "cotton",
    "cranberry",
    "cucumber",
    "eggplant",
    "elderberry",
    "flax",
    "garlic",
    "ginger",
    "grape",
    "greengrape",
    "huckleberry",
    "jicama",
    "juniperberry",
    "jute",
    "kale",
    "kenaf",
    "kiwi",
    "kohlrabi",
    "leek",
    "lentil",
    "lettuce",
    "millet",
    "mulberry",
    "mustardseeds",
    "oats",
    "okra",
    "onion",
    "parsnip",
    "peanut",
    "peas",
    "pineapple",
    "quinoa",
    "radish",
    "raspberry",
    "rhubarb",
    "rice",
    "rutabaga",
    "rye",
    "scallion",
    "sesameseeds",
    "sisal",
    "soybean",
    "spiceleaf",
    "spinach",
    "strawberry",
    "sweetpotato",
    "taro",
    "tealeaf",
    "tomatillo",
    "tomato",
    "turnip",
    "waterchestnut",
    "whitemushroom",
    "wintersquash",
    "zucchini",
  ];
  crop.forEach((C) => {
    gardenpam(C, "minecraft:dirt", 1);
  });
  crop.forEach((C) => {
    gardenpam(C, "mysticalagriculture:inferium_farmland", 2);
  });
  crop.forEach((C) => {
    gardenpam(C, "mysticalagriculture:prudentium_farmland", 3);
  });
  crop.forEach((C) => {
    gardenpam(C, "mysticalagriculture:tertium_farmland", 4);
  });
  crop.forEach((C) => {
    gardenpam(C, "mysticalagriculture:imperium_farmland", 5);
  });
  crop.forEach((C) => {
    gardenpam(C, "mysticalagriculture:supremium_farmland", 6);
  });
  crop.forEach((C) => {
    gardenpam(C, "mysticalagradditions:insanium_farmland", 7);
  });
});
