// priority: 10

ServerEvents.recipes(event => {

    saplingCloche("minecraft:oak_sapling", "minecraft:oak_log", "minecraft:oak_leaves", "minecraft:apple")
    saplingCloche("minecraft:dark_oak_sapling", "minecraft:dark_oak_log", "minecraft:dark_oak_leaves", "minecraft:apple")
    saplingCloche("minecraft:birch_sapling", "minecraft:birch_log", "minecraft:birch_leaves", "minecraft:stick")
    saplingCloche("minecraft:jungle_sapling", "minecraft:jungle_log", "minecraft:jungle_leaves", "minecraft:vine")
    saplingCloche("minecraft:acacia_sapling", "minecraft:acacia_log", "minecraft:acacia_leaves", "minecraft:stick")
    saplingCloche("minecraft:spruce_sapling", "minecraft:spruce_log", "minecraft:spruce_leaves", "minecraft:stick")
    saplingCloche("minecraft:cherry_sapling", "minecraft:cherry_log", "minecraft:cherry_leaves", "minecraft:stick")
    saplingCloche("minecraft:mangrove_propagule", "minecraft:mangrove_log", "minecraft:mangrove_leaves", "minecraft:mangrove_roots")

    saplingCloche("caveopolis:black_colored_sapling", "caveopolis:black_colored_log", "caveopolis:black_colored_leaves", "stoneopolis:void_apple")
    saplingCloche("caveopolis:blue_colored_sapling", "caveopolis:blue_colored_log", "caveopolis:blue_colored_leaves", "minecraft:stick")
    saplingCloche("caveopolis:light_blue_colored_sapling", "caveopolis:light_blue_colored_log", "caveopolis:light_blue_colored_leaves", "minecraft:stick")
    saplingCloche("caveopolis:light_gray_colored_sapling", "caveopolis:light_gray_colored_log", "caveopolis:light_gray_colored_leaves", "minecraft:stick")
    saplingCloche("caveopolis:gray_colored_sapling", "caveopolis:gray_colored_log", "caveopolis:gray_colored_leaves", "minecraft:stick")
    saplingCloche("caveopolis:orange_colored_sapling", "caveopolis:orange_colored_log", "caveopolis:orange_colored_leaves", "minecraft:stick")
    saplingCloche("caveopolis:yellow_colored_sapling", "caveopolis:yellow_colored_log", "caveopolis:yellow_colored_leaves", "minecraft:stick")
    saplingCloche("caveopolis:red_colored_sapling", "caveopolis:red_colored_log", "caveopolis:red_colored_leaves", "minecraft:stick")
    saplingCloche("caveopolis:cyan_colored_sapling", "caveopolis:cyan_colored_log", "caveopolis:cyan_colored_leaves", "minecraft:stick")
    saplingCloche("caveopolis:brown_colored_sapling", "caveopolis:brown_colored_log", "caveopolis:brown_colored_leaves", "minecraft:stick")
    saplingCloche("caveopolis:white_colored_sapling", "caveopolis:white_colored_log", "caveopolis:white_colored_leaves", "minecraft:stick")
    saplingCloche("caveopolis:pink_colored_sapling", "caveopolis:pink_colored_log", "caveopolis:pink_colored_leaves", "minecraft:stick")
    saplingCloche("caveopolis:magenta_colored_sapling", "caveopolis:magenta_colored_log", "caveopolis:magenta_colored_leaves", "minecraft:stick")
    saplingCloche("caveopolis:purple_colored_sapling", "caveopolis:purple_colored_log", "caveopolis:purple_colored_leaves", "minecraft:stick")
    saplingCloche("caveopolis:green_colored_sapling", "caveopolis:green_colored_log", "caveopolis:green_colored_leaves", "minecraft:stick")
    saplingCloche("caveopolis:lime_colored_sapling", "caveopolis:lime_colored_log", "caveopolis:lime_colored_leaves", "minecraft:stick")

  
    cloche("stoneopolis:cluster_template", "geode_plus:lapis_cluster", "minecraft:lapis_lazuli", "geode_plus:budding_lapis", 500)
    cloche("stoneopolis:cluster_template", "geode_plus:redstone_crystal", "minecraft:redstone", "geode_plus:budding_redstone", 500)
    cloche("stoneopolis:cluster_template", "geode_plus:nether_quartz_crystal", "minecraft:quartz", "geode_plus:budding_nether_quartz", 500)
    cloche("stoneopolis:cluster_template", "geode_plus:wrappist_crystal", "geode_plus:wrappist_shard", "geode_plus:budding_wrappist", 500)

    //Functions
    function saplingCloche(sapling, log, leaves, extra) {

    event.custom({
      type:"immersiveengineering:cloche",
      input:{item:sapling},
      render:{"type":"generic","block":sapling},
      results:[
        {item: log, count: 6},
        {item: leaves, count: 1},
        {item: extra, count: 1}
      ],
      soil:{item:"minecraft:dirt"},
      time:800})
    }

    function cloche(inItem, render, outItem, soil, duration) {
      event.custom({
        type:"immersiveengineering:cloche",
        input:{item: inItem},
        render:{type:"generic", block: render},
        results:[{item: outItem}],
        soil:[{item: soil}],
        time: duration})
    }



})
