/*
██╗  ██╗ █████╗ ██╗   ██╗███████╗███╗   ██╗    ███╗   ███╗ ██████╗ ██████╗ ██████╗  █████╗  ██████╗██╗  ██╗███████╗
██║  ██║██╔══██╗██║   ██║██╔════╝████╗  ██║    ████╗ ████║██╔═══██╗██╔══██╗██╔══██╗██╔══██╗██╔════╝██║ ██╔╝██╔════╝
███████║███████║██║   ██║█████╗  ██╔██╗ ██║    ██╔████╔██║██║   ██║██║  ██║██████╔╝███████║██║     █████╔╝ ███████╗
██╔══██║██╔══██║╚██╗ ██╔╝██╔══╝  ██║╚██╗██║    ██║╚██╔╝██║██║   ██║██║  ██║██╔═══╝ ██╔══██║██║     ██╔═██╗ ╚════██║
██║  ██║██║  ██║ ╚████╔╝ ███████╗██║ ╚████║    ██║ ╚═╝ ██║╚██████╔╝██████╔╝██║     ██║  ██║╚██████╗██║  ██╗███████║
╚═╝  ╚═╝╚═╝  ╚═╝  ╚═══╝  ╚══════╝╚═╝  ╚═══╝    ╚═╝     ╚═╝ ╚═════╝ ╚═════╝ ╚═╝     ╚═╝  ╚═╝ ╚═════╝╚═╝  ╚═╝╚══════╝
*/
ServerEvents.recipes(e => {
  e.remove({ id: "refinedstorage:raw_basic_processor" })
  e.remove({ id: "refinedstorage:raw_improved_processor" })
  e.remove({ id: "refinedstorage:raw_advanced_processor" })
  e.remove({ id: "extradisks:raw_withering_processor" })
  e.remove({ id: "rebornstorage:parts/raw_super_advanced_processor" })
  e.remove({ id: "creativecrafter:creative_crafter" })
  e.remove({ id: "extrastorage:raw_neural_processor" })

  e.shaped("refinedstorageaddons:wireless_crafting_grid", ["WAC"], {
    W: "refinedstorage:wireless_grid",
    A: "refinedstorage:advanced_processor",
    C: "minecraft:crafting_table",
  }).id('haven:wireless_crafting_grid')
    
  e.shaped(
    Item.of('creativecrafter:creative_crafter', 1),
    [ 
      'HCH', 
      'CRC',
      'HCH'
    ],
    {
      H: 'havenalchemy:havenite_block', 
      R: 'havenalchemy:research_tier_ultimate',
      C: 'extrastorage:netherite_crafter'
    }
  ).id('haven:creative_crafter')

  let rbp = 'haven:incomplete_raw_basic_processor'
  e.recipes.createSequencedAssembly([
    Item.of('refinedstorage:raw_basic_processor').withChance(100)
  ], '#forge:ingots/iron', [
  e.recipes.createDeploying(rbp, [rbp, 'refinedstorage:processor_binding']),
    e.recipes.createDeploying(rbp, [rbp, '#forge:silicon']),
    e.recipes.createDeploying(rbp, [rbp, '#forge:dusts/redstone']),
    e.recipes.createPressing(rbp, rbp)
  ]).transitionalItem(rbp).loops(1).id('haven:raw_basic_processor')
  
  let rip = 'haven:incomplete_raw_improved_processor'
    e.recipes.createSequencedAssembly([
      Item.of('refinedstorage:raw_improved_processor').withChance(100)
    ], '#forge:ingots/gold', [
      e.recipes.createDeploying(rip, [rip, 'refinedstorage:processor_binding']),
      e.recipes.createDeploying(rip, [rip, '#forge:silicon']),
      e.recipes.createDeploying(rip, [rip, '#forge:dusts/redstone']),
      e.recipes.createPressing(rip, rip)
    ]).transitionalItem(rip).loops(1).id('haven:raw_improved_processor')
  
  let rap = 'haven:incomplete_raw_advanced_processor'
    e.recipes.createSequencedAssembly([
      Item.of('refinedstorage:raw_advanced_processor').withChance(100)
    ], '#forge:gems/diamond', [
      e.recipes.createDeploying(rap, [rap, 'refinedstorage:processor_binding']),
      e.recipes.createDeploying(rap, [rap, '#forge:silicon']),
      e.recipes.createDeploying(rap, [rap, '#forge:dusts/redstone']),
      e.recipes.createPressing(rap, rap)
    ]).transitionalItem(rap).loops(1).id('haven:raw_advanced_processor')
    
  let rsap = 'haven:incomplete_raw_super_advanced_processor'
    e.recipes.createSequencedAssembly([
      Item.of('rebornstorage:raw_super_advanced_processor').withChance(100)
    ], '#forge:ingots/netherite', [
      e.recipes.createDeploying(rsap, [rsap, 'refinedstorage:processor_binding']),
      e.recipes.createDeploying(rsap, [rsap, '#forge:silicon']),
      e.recipes.createDeploying(rsap, [rsap, '#forge:dusts/redstone']),
      e.recipes.createPressing(rsap, rsap)
    ]).transitionalItem(rsap).loops(1).id('haven:raw_super_advanced_processor')
    
  let rwp = 'haven:incomplete_raw_withering_processor'
    e.recipes.createSequencedAssembly([
      Item.of('extradisks:raw_withering_processor').withChance(100)
    ], '#forge:nether_stars', [
      e.recipes.createDeploying(rwp, [rwp, 'refinedstorage:processor_binding']),
      e.recipes.createDeploying(rwp, [rwp, '#forge:silicon']),
      e.recipes.createDeploying(rwp, [rwp, '#forge:dusts/redstone']),
      e.recipes.createPressing(rwp, rwp)
    ]).transitionalItem(rwp).loops(1).id('haven:raw_withering_processor')
    
  let rnp = 'haven:incomplete_raw_neural_processor'
    e.recipes.createSequencedAssembly([
      Item.of('extrastorage:raw_neural_processor').withChance(100)
    ], 'refinedstorage:raw_advanced_processor', [
      e.recipes.createDeploying(rnp, [rnp, 'refinedstorage:processor_binding']),
      e.recipes.createDeploying(rnp, [rnp, 'minecraft:quartz']),
      e.recipes.createDeploying(rnp, [rnp, 'minecraft:crafting_table']),
      e.recipes.createDeploying(rnp, [rnp, 'minecraft:obsidian']),
      e.recipes.createDeploying(rnp, [rnp, 'refinedstorage:raw_improved_processor']),
      e.recipes.createPressing(rnp, rnp)
    ]).transitionalItem(rnp).loops(1).id('haven:raw_neural_processor')
})
