ServerEvents.recipes(event => {

  event.campfireCooking('minecraft:torch', 'minecraft:stick').cookingTime(200)

  event.shapeless(
    Item.of('minecraft:packed_mud', 1),
    [
      'minecraft:dirt',
      'minecraft:clay_ball',
      'farmersdelight:straw'
    ]
  );

  event.shaped(
    Item.of('minecraft:recovery_compass', 1),
    [
      ' A ',
      'ABA',
      ' A '
    ],
    {
      A: 'minecraft:echo_shard',
      B: '#fantasia:compass'
    }
  );

  event.shaped(
    Item.of('spelunkery:magnetic_compass', 1),
    [
      ' A ',
      'ABA',
      ' A '
    ],
    {
      A: 'overgeared:steel_ingot',
      B: 'spelunkery:raw_magnetite_nugget'
    }
  );

  event.shapeless(
    Item.of('spelunkery:portal_fluid_bottle', 1),
    [
      'spelunkery:portal_fluid_bottle'
    ]
  );

  event.custom({
    "type": "minecraft:crafting_shaped",
    "key": {
      "x": {
        "item": "minecraft:black_dye"
      },
      "y": {
        "item": "minecraft:bone_meal"
      },
      "z": {
        "type": "forge:partial_nbt",
        "item": "minecraft:potion",
        "nbt": "{Potion:\"minecraft:water\"}"
      }
    },
    "pattern": [
      "xy",
      "z "
    ],
    "result": {
      "item": "minecraft:ink_sac"
    }
  })

  event.shaped(
    Item.of('minecraft:campfire', 1),
    [
      'AA',
      'BB'
    ],
    {
      A: 'minecraft:stick',
      B: '#minecraft:logs'
    }
  );

  event.shaped(
    Item.of('spelunkery:wooden_channel', 2),
    [
      'A A',
      'AAA',
      'B B'
    ],
    {
      A: '#minecraft:wooden_slabs',
      B: '#minecraft:fences'
    }
  );

  event.shaped(
    Item.of('spelunkery:stone_channel', 2),
    [
      'A A',
      'AAA',
      'B B'
    ],
    {
      A: 'minecraft:stone_brick_slab',
      B: 'minecraft:stone_brick_wall'
    }
  );

  event.shaped(
    Item.of('minecraft:saddle', 1),
    [
      ' A ',
      'ABA'
    ],
    {
      A: 'minecraft:leather',
      B: 'minecraft:iron_ingot'
    }
  );

  event.shaped(
    Item.of('supplementaries:sack', 1),
    [
      'BAB',
      'B B',
      'BBB'
    ],
    {
      A: 'minecraft:string',
      B: 'farmersdelight:canvas'
    }
  );

  event.shapeless(
    Item.of('minecraft:string', 3),
    [
      '#minecraft:wool',
      '#farmersdelight:tools/knives'
    ]
  ).damageIngredient("#farmersdelight:tools/knives", 1);

  event.shaped(
    Item.of('minecraft:torch', 1),
    [
      'BC',
      'A '
    ],
    {
      A: 'minecraft:stick',
      B: '#fantasia:coal_recipe',
      C: 'farmersdelight:straw'
    }
  );

  event.shapeless(
    Item.of('minecraft:mud', 1),
    [
      'minecraft:dirt',
      'minecraft:water_bucket'
    ]
  ).keepIngredient('minecraft:water_bucket');

  event.shapeless(
    Item.of('regions_unexplored:silt_mud', 1),
    [
      'regions_unexplored:silt_dirt',
      'minecraft:water_bucket'
    ]
  ).keepIngredient('minecraft:water_bucket');

  event.shapeless(
    Item.of('regions_unexplored:peat_mud', 1),
    [
      'regions_unexplored:peat_dirt',
      'minecraft:water_bucket'
    ]
  ).keepIngredient('minecraft:water_bucket');

  event.shapeless(
    Item.of('minecraft:map', 1),
    [
      '#minecraft:compasses',
      'minecraft:paper'
    ]
  ).keepIngredient('#minecraft:compasses');

  event.shapeless(
    Item.of('supplementaries:slice_map', 1),
    [
      'spelunkery:depth_gauge',
      'minecraft:paper'
    ]
  ).keepIngredient('spelunkery:depth_gauge');

  event.shapeless(
    Item.of('irons_spellbooks:arcane_essence', 2),
    [
      'minecraft:amethyst_shard',
      'galosphere:allurite_shard',
      'minecraft:quartz',
      'overgeared:smithing_hammer'
    ]
  ).damageIngredient('overgeared:smithing_hammer', 3);

  event.shapeless(
    Item.of('farmersdelight:wheat_dough', 1),
    [
      'minecraft:wheat',
      'minecraft:potion'
    ]
  ).replaceIngredient('minecraft:potion', 'minecraft:glass_bottle');

  event.shapeless(
    Item.of('farmersdelight:wheat_dough', 1),
    [
      'regions_unexplored:barley',
      'minecraft:potion'
    ]
  ).replaceIngredient('minecraft:potion', 'minecraft:glass_bottle');

  event.shapeless(
    Item.of('minecraft:crying_obsidian', 1),
    [
      'minecraft:obsidian',
      'minecraft:ghast_tear',
      'irons_spellbooks:arcane_essence'
    ]
  );

  event.shaped(
    Item.of('clayworks:kiln', 1),
    [
      "AAA",
      "A A",
      "CCC"
    ],
    {
      A: 'minecraft:cobblestone',
      C: 'minecraft:mud_bricks'
    }
  );

  event.custom(
    {
      "type": "farmersdelight:cutting",
      "ingredients": [
        {
          "item": "galosphere:allurite_block"
        }
      ],
      "result": [
        {
          "count": 4,
          "item": "galosphere:allurite_shard"
        }
      ],
      "tool": {
        "type": "farmersdelight:tool_action",
        "action": "pickaxe_dig"
      }
    }
  );

  event.smelting('8x spelunkery:salt', 'windswept:wooden_water_bucket');

  //hearth and harvest crate recipe fix
  function crate_fix(bottle_input, crate_output) {

    event.shaped(
      Item.of(crate_output, 1),
      [
        'AAA',
        'AAA',
        'AAA'
      ],
      {
        A: bottle_input
      }).replaceIngredient(bottle_input, "minecraft:air");;
  }

  crate_fix('hearthandharvest:red_grape_wine', 'hearthandharvest:red_grape_wine_crate')
  crate_fix('hearthandharvest:green_grape_wine', 'hearthandharvest:green_grape_wine_crate')
  crate_fix('hearthandharvest:raspberry_wine', 'hearthandharvest:raspberry_wine_crate')
  crate_fix('hearthandharvest:blueberry_wine', 'hearthandharvest:blueberry_wine_crate')
  crate_fix('hearthandharvest:cherry_wine', 'hearthandharvest:cherry_wine_crate')
  crate_fix('hearthandharvest:sweet_berry_wine', 'hearthandharvest:sweet_berry_wine_crate')
  crate_fix('hearthandharvest:mead', 'hearthandharvest:mead_crate')
  crate_fix({ "type": "forge:partial_nbt", "item": "minecraft:potion", "nbt": "{Potion:\"minecraft:water\"}" }, 'hearthandharvest:water_crate')
  crate_fix('hearthandharvest:goat_milk_bottle', 'hearthandharvest:goat_milk_crate')
  crate_fix('farmersdelight:milk_bottle', 'hearthandharvest:milk_crate')
  crate_fix('minecraft:honey_bottle', 'hearthandharvest:honey_crate')
  crate_fix('hearthandharvest:syrup_bottle', 'hearthandharvest:syrup_crate')

  //water bottle crate recipe fix
  event.remove({ id: 'hearthandharvest:water_crate' })

  event.shapeless(
    Item.of({ "type": "forge:partial_nbt", "item": "minecraft:potion", "nbt": "{Potion:\"minecraft:water\"}" }, 9),
    [
      'hearthandharvest:water_crate'
    ]
  )

});
