ServerEvents.recipes((event) => {
  // =========================================
  // Alexs Caves
  // =========================================

  // Acid
  event.recipes.create
    .mixing(Fluid.of("alexscaves:acid", 1000), [
      Fluid.of("minecraft:water", 1000),
      "#forge:dusts/sulfur",
    ])
    .heated()
    .id("create_oppenheimered:mixing/sulfuric_acid");

  // Depth Glass
  event
    .shaped("16x alexscaves:depth_glass", [
      "ABA", 
      "BBB", 
      "ABA"
    ], 
    {
      A: "seadwellers:depth_ingot",
      B: "alexscaves:sea_glass_shards",
    })
    .id("alexscaves:depth_glass");

    // Sack of Sating
  event
    .shaped("alexscaves:sack_of_sating", [
      "ABA", 
      "CDC", 
      "CCC"
    ], 
    {
      A: "alexscaves:licoroot_vine",
      B: "alexscaves:sweet_tooth",
      C: "#alexscaves:gelatins",
      D: "rats:rat_sack"
    })
    .id("alexscaves:sack_of_sating");

    // Scarlet Magnet
  event.replaceInput(
    { id: "alexscaves:scarlet_magnet" },
    "minecraft:iron_ingot", 
    "call_of_yucutan:hematite" 
  );

    // Azure Magnet
  event.replaceInput(
    { id: "alexscaves:azure_magnet" },
    "minecraft:iron_ingot", 
    "call_of_yucutan:hematite" 
  );

  // Thermal Recipes
  
  event.recipes.thermal
    .pulverizer("8x alexscaves:sulfur_dust", "alexscaves:sulfur_cluster")
    .energy(4000);

  event.recipes.thermal
    .sawmill("5x alexscaves:peppermint_powder", "alexscaves:candy_cane")
    .energy(1000);
  

    // Polymer Plate
  event.replaceInput(
    { id: "alexscaves:polymer_plate" },
    "minecraft:iron_ingot", 
    "rats:raw_plastic" 
  );
  
  // =========================================
  // Cookie Block Recipes (Used For Portal To Candy Cavities)
  // =========================================
  event
    .shapeless("alexscaves:cookie_block", [
      "8x qualitycrops:cookie_iron"
    ])
    .id("alexscaves:cookie_block");
  
  event
    .shapeless("2x alexscaves:cookie_block", [
      "8x qualitycrops:cookie_gold"
    ])
    .id("alexscaves:cookie_block_gold");
  
  event
    .shapeless("4x alexscaves:cookie_block", [
      "8x qualitycrops:cookie_diamond"
    ])
    .id("alexscaves:cookie_block_diamond");
  

// Gingerbread crumbs (eternal recipe)
  
    let gingerbreadArmorTypes = [
    "alexscaves:gingerbread_helmet",
    "alexscaves:gingerbread_chestplate",
    "alexscaves:gingerbread_leggings",
    "alexscaves:gingerbread_boots",
  ];

  gingerbreadArmorTypes.forEach((armor) => {
    event.recipes.create
    .mixing([`${armor}`, "alexscaves:gingerbread_crumbs"], [
      Fluid.of("milk", 250),
      `${armor}`,
    ])
    .heated();
  });

// Caramel Production

  event.custom({
    type: "createdieselgenerators:basin_fermenting",
    ingredients: [
      {
        item: "alexscaves:caramel"
      },
      {
      fluid: "the_bumblezone:sugar_water_still",
      amount: 1000
    }],
    heatRequirement: "heated",
    processingTime: 500,
    results: [{
      fluid: "create_dd:caramel",
      amount: 1000
  }]
  });

  event.custom({
    type: "createdieselgenerators:casting",
    ingredients: [{
      fluid: "create_dd:caramel",
      amount: 250
    }],
      mold: "createdieselgenerators:bar",
    results: [{
      item: "alexscaves:caramel",
      count: 1
  }]
  });
  





  // Create Oppenheimer Candy Cane Recipe
    event
    .custom({
      type: "create:sequenced_assembly",
      ingredient: {
        item: "alexscaves:peppermint_powder",
      },
      transitionalItem: {
        item: "alexscaves:peppermint_powder",
      },
      sequence: [
        {
          type: "create:filling",
          ingredients: [
            {
              item: "alexscaves:peppermint_powder",
            },
            {
              fluid: "the_bumblezone:sugar_water_still",
              amount: 250
            },
          ],
          results: [
            {
              item: "alexscaves:peppermint_powder",
            },
          ],
        },
        {
          type: "create:pressing",
          ingredients: [
            {
              item: "alexscaves:peppermint_powder",
            }
          ],
          results: [
            {
              item: "alexscaves:peppermint_powder",
            },
          ],
        }
      ],
      results: [
        {
          item: "alexscaves:candy_cane"
        }
      ],
      loops: 1,
    })
    .id("create_oppenheimered:sequenced_assembly/candy_cane_pressing");



  // =========================================
  // Galena Recipes (Used For Portal To Magnetic Caves)
  // =========================================

  // Galena
  event.recipes.create
    .mixing("alexscaves:galena", [
      Fluid.of("minecraft:lava", 250),
      "#forge:nuggets/lead",
      "minecraft:stone",
    ])
    .id("create_oppenheimered:compacting/galena");
  event.recipes.create.compacting(
    ["8x alexscaves:energized_galena_neutral"],
    ["8x alexscaves:packed_galena", "thermal:lightning_charge"]
  );

  // =========================================
  // Alex's Caves Pearls from Mussels
  // =========================================

  event.recipes.farmersdelight.cutting(
    "alexscaves:mussel",
    "#farmersdelight:tools/knives", // tool
    [
      // results
      "crabbersdelight:raw_clam_meat",
      Item.of("alexscaves:pearl").withChance(0.33),
    ]
    // "" // sound
  );

});
