ServerEvents.recipes(event => {
  
  event.shapeless('create:honeyed_apple', [
    'minecraft:apple',
    '#forge:honey',
  ])
  
  event.remove({id: 'buzzier_bees:honey/glazed_porkchop'})
  event.shapeless('buzzier_bees:glazed_porkchop', [
    'minecraft:cooked_porkchop',
    '#forge:honey',
  ])
  
  event.shapeless('kubejs:rotten_flesh_burger', [
    '#forge:bread',
    '2x minecraft:rotten_flesh',
  ])
  
  event.replaceInput({id: 'miners_delight:vegan_steak_and_potatoes' }, 'farmersdelight:onion', '#forge:crops/onion')  
  event.replaceInput({id: 'miners_delight:copper_carrot' }, 'minecraft:copper_ingot', '#forge:nuggets/copper')  
  
  event.custom({
    "type": "farmersdelight:cutting",
    "ingredients": [{"item": "netherexp:nether_pizza"}],
    "result": [{"count": 4, "item": "netherexp:nether_pizza_slice"}],
    "tool": {"tag": "forge:tools/knives"}
  })
  
  event.remove({id: 'netherexp:nether_pizza'})
  event.shaped('netherexp:nether_pizza', [
    ' C ',
    'TST',
    'WWW'
  ],{
    C:'netherexp:glowcheese',
    S:'mynethersdelight:hot_cream',
    T:'#caramel:nether_pizza_toppings',
    W:'#caramel:nether_wart'
  })
  
  event.remove({id: 'brewinandchewin:pizza'})
  event.shaped('brewinandchewin:pizza', [
    ' C ',
    'TST',
    'WWW'
  ],{
    C:'#brewinandchewin:cheese_wedges',
    S:'farmersdelight:tomato_sauce',
    T:'#brewinandchewin:pizza_toppings',
    W:'#forge:grain/wheat'
  })
  
  event.shapeless('collectorsreap:portobello_burger', [
    '#forge:bread',
    '#forge:salad_ingredients/cabbage',
    '#forge:crops/tomato',
    '#forge:crops/onion',
    '#forge:mushrooms/portabella',
  ])
  
  event.custom({
    "type": "farmersdelight:cooking",
    "cookingtime": 200,
    "experience": 1.0,
    "ingredients": [
      {"tag": "forge:crops/rice" },
      {"tag": "forge:crops/onion"},
      {"tag": "forge:mushrooms/portabella"},
      {"item": "brewinandchewin:rice_wine"},
      {"tag": "forge:cheese" }
    ],
    "result": {"item": "collectorsreap:portobello_risotto"}
  })
  
  event.custom({
    "type": "farmersdelight:cooking",
    "cookingtime": 200,
    "experience": 1.0,
    "ingredients": [
      {"tag": "forge:crops/rice" },
      {"tag": "forge:crops/rice" },
      {"tag": "forge:vegetables"},
      {"tag": "forge:vegetables"},
      {"tag": "forge:fruits/citrus"},
      {"tag": "forge:mushrooms/portabella"},
    ],
    "result": {"item": "collectorsreap:portobello_rice_soup"}
  })
  
  event.custom({
    "type": "farmersdelight:cooking",
    "cookingtime": 200,
    "experience": 1.0,
    "ingredients": [
      {"tag": "forge:salt" },
      {"tag": "forge:sugar" },
      {"tag": "forge:sugar"},
      {"tag": "forge:milk"},
    ],
    "result": {"item": "kubejs:caramel"}
  })
  
  // CAKE
  event.remove({id: 'deep_aether:cake'})
  event.remove({id: 'farmersdelight:cake_from_milk_bottle'})
  
  
  let cakeCrafting = (
    cake, 
    slice,
    ingredient
  ) => { 

    event.remove({output: cake})
    
    event.shaped(cake, [
      'MIM',
      'SES',
      'WIW'
    ],{
      E:'#forge:eggs',
      I: ingredient,
      M:'#forge:milk',
      S:'#forge:sugar',
      W:'#forge:grain/wheat'
    })
    
    event.shapeless(cake, ["7x "+slice])
    
  }

  cakeCrafting(
    'respiteful:green_tea_cake', 
    'respiteful:green_tea_cake_slice', 
    '#forge:tea_leaves/green', 
  )

  cakeCrafting(
    'respiteful:yellow_tea_cake', 
    'respiteful:yellow_tea_cake_slice', 
    '#forge:tea_leaves/yellow', 
  )

  cakeCrafting(
    'respiteful:black_tea_cake', 
    'respiteful:black_tea_cake_slice', 
    '#forge:tea_leaves/black', 
  )

  cakeCrafting(
    'farmersrespite:coffee_cake', 
    'farmersrespite:coffee_cake_slice', 
    '#forge:coffee_beans', 
  )
  
  // PIES
  let pieCrafting = (
    pie, 
    slice,
    ingredient
  ) => { 

    event.remove({output: pie})
    
    event.shaped(pie, [
      'WEW',
      'III',
      'SBS'
    ],{
      B:'farmersdelight:pie_crust',
      E:'#forge:eggs',
      I: ingredient,
      S:'#forge:sugar',
      W:'#forge:grain/wheat'
    })
    
    event.shaped(pie, [
      'SS ',
      'SS ',
      '   '
    ],{
      S: slice,
    })
    
  }

  pieCrafting(
    'minecraft:pumpkin_pie', 
    'delightful:pumpkin_pie_slice', 
    'farmersdelight:pumpkin_slice', 
  )

  pieCrafting(
    'upgrade_aquatic:mulberry_pie', 
    'delightful:mulberry_pie_slice', 
    '#forge:fruits/mulberry', 
  )

  pieCrafting(
    'farmersrespite:rose_hip_pie', 
    'farmersrespite:rose_hip_pie_slice', 
    'farmersrespite:rose_hips', 
  )

  pieCrafting(
    'aether_redux:blueberry_pie', 
    'kubejs:blueberry_pie_slice', 
    '#forge:fruits/blueberry', 
  )

  pieCrafting(
    'farmersdelight:apple_pie', 
    'farmersdelight:apple_pie_slice', 
    '#forge:fruits/apple', 
  )

  pieCrafting(
    'farmersdelight:chocolate_pie', 
    'farmersdelight:chocolate_pie_slice', 
    '#forge:chocolate', 
  )

  pieCrafting(
    'delightful:salmonberry_pie', 
    'delightful:salmonberry_pie_slice', 
    '#forge:fruits/salmonberries', 
  )

  pieCrafting(
    'collectorsreap:lime_pie', 
    'collectorsreap:lime_pie_slice', 
    '#forge:fruits/lime', 
  )
  
  // FISH CUTTING
  
  let fishCutting = (
    raw, 
    cooked, 
    cut_raw, 
    cut_cooked
  ) => { 
    
    event.custom({
      "type": "farmersdelight:cutting",
      "ingredients": [
        {"item": raw}
      ],
      "result": [
        {"count": 2,"item": cut_raw},
        {"item": "minecraft:bone_meal"}
      ],
      "tool": {"tag": "forge:tools/knives"}
    })
    
    event.custom({
      "type": "farmersdelight:cutting",
      "ingredients": [
        {"item": cooked}
      ],
      "result": [
        {"count": 2,"item": cut_cooked},
        {"item": "minecraft:bone_meal"}
      ],
      "tool": {"tag": "forge:tools/knives"}
    })
    
    event.smelting(cut_cooked, cut_raw).xp(0.35)
    
  }
  
  fishCutting(
    'sullysmod:lanternfish', 
    'sullysmod:cooked_lanternfish', 
    'kubejs:lanternfish_slice', 
    'kubejs:cooked_lanternfish_slice', 
  )
  
  fishCutting(
    'deep_aether:raw_aerglow_fish', 
    'deep_aether:cooked_aerglow_fish', 
    'kubejs:aerglow_fish_slice', 
    'kubejs:cooked_aerglow_fish_slice', 
  )
  
  fishCutting(
    'sullysmod:piranha', 
    'sullysmod:cooked_piranha', 
    'kubejs:piranha_slice', 
    'kubejs:cooked_piranha_slice', 
  )
  
})