/*
██╗  ██╗ █████╗ ██╗   ██╗███████╗███╗   ██╗    ███╗   ███╗ ██████╗ ██████╗ ██████╗  █████╗  ██████╗██╗  ██╗███████╗
██║  ██║██╔══██╗██║   ██║██╔════╝████╗  ██║    ████╗ ████║██╔═══██╗██╔══██╗██╔══██╗██╔══██╗██╔════╝██║ ██╔╝██╔════╝
███████║███████║██║   ██║█████╗  ██╔██╗ ██║    ██╔████╔██║██║   ██║██║  ██║██████╔╝███████║██║     █████╔╝ ███████╗
██╔══██║██╔══██║╚██╗ ██╔╝██╔══╝  ██║╚██╗██║    ██║╚██╔╝██║██║   ██║██║  ██║██╔═══╝ ██╔══██║██║     ██╔═██╗ ╚════██║
██║  ██║██║  ██║ ╚████╔╝ ███████╗██║ ╚████║    ██║ ╚═╝ ██║╚██████╔╝██████╔╝██║     ██║  ██║╚██████╗██║  ██╗███████║
╚═╝  ╚═╝╚═╝  ╚═╝  ╚═══╝  ╚══════╝╚═╝  ╚═══╝    ╚═╝     ╚═╝ ╚═════╝ ╚═════╝ ╚═╝     ╚═╝  ╚═╝ ╚═════╝╚═╝  ╚═╝╚══════╝
*/
ServerEvents.recipes(e => {
  e.remove({ type: "ae2:inscriber" })
  e.remove({ id: 'ae2things:blocks/advanced_inscriber'})
  e.remove({ id: "ae2:network/blocks/inscribers" })

  //Certus dust
  e.recipes.createCrushing(["ae2:certus_quartz_dust"],'#forge:gems/certus_quartz').id('haven:certus_quartz_dust')

  //Fluix Dust
  e.recipes.createCrushing(["ae2:fluix_dust"], '#forge:gems/fluix').id('haven:fluix_dust')

  e.recipes.createDeploying(['ae2:printed_silicon'], ['#forge:silicon', 'ae2:silicon_press'])
  .keepHeldItem()
  .id('haven:printed_silicon')
  e.recipes.createDeploying(['ae2:printed_logic_processor'], ['minecraft:gold_ingot', 'ae2:logic_processor_press'])
  .keepHeldItem()
  .id('haven:printed_logic_processor')
  e.recipes.createDeploying(['ae2:printed_calculation_processor'], ['ae2:certus_quartz_crystal', 'ae2:calculation_processor_press'])
  .keepHeldItem()
  .id('haven:printed_calculation_processor')
  e.recipes.createDeploying(['ae2:printed_engineering_processor'], ['minecraft:diamond', 'ae2:engineering_processor_press'])
  .keepHeldItem()
  .id('haven:printed_engineering_processor')

  e.recipes.createDeploying(['ae2:engineering_processor_press'], ['minecraft:iron_block', 'minecraft:diamond']).id('haven:engineering_processor_press')
  e.recipes.createDeploying(['ae2:calculation_processor_press'], ['minecraft:iron_block', 'ae2:certus_quartz_crystal']).id('haven:calculation_processor_press')
  e.recipes.createDeploying(['ae2:logic_processor_press'], ['minecraft:iron_block', 'minecraft:gold_ingot']).id('haven:logic_processor_press')
  e.recipes.createDeploying(['ae2:silicon_press'], ['minecraft:iron_block', '#forge:silicon']).id('haven:silicon_press')
  e.recipes.createDeploying(['ae2:name_press'], ['minecraft:iron_ingot', 'minecraft:redstone']).id('haven:inscriber_name_press')

  let ilp = 'haven:incomplete_printed_logic_processor'
    e.recipes.createSequencedAssembly([
      Item.of('ae2:logic_processor').withChance(100) //  result
    ], 'ae2:printed_logic_processor', [ // input
      e.recipes.createDeploying(ilp, [ilp, 'minecraft:redstone']),
      e.recipes.createDeploying(ilp, [ilp, 'ae2:printed_silicon']),
      e.recipes.createPressing(ilp, ilp)
    ]).transitionalItem(ilp).loops(1).id('haven:logic_processor')
      
  let icp = 'haven:incomplete_printed_calculation_processor'
    e.recipes.createSequencedAssembly([
      Item.of('ae2:calculation_processor').withChance(100) //  result
    ], 'ae2:printed_calculation_processor', [ // input
      e.recipes.createDeploying(icp, [icp, 'minecraft:redstone']),
      e.recipes.createDeploying(icp, [icp, 'ae2:printed_silicon']),
      e.recipes.createPressing(icp, icp)
    ]).transitionalItem(icp).loops(1).id('haven:calculation_processor')
  
  let iep = 'haven:incomplete_printed_engineering_processor'
    e.recipes.createSequencedAssembly([
      Item.of('ae2:engineering_processor').withChance(100) //  result
    ], 'ae2:printed_engineering_processor', [ // input
      e.recipes.createDeploying(iep, [iep, 'minecraft:redstone']),
      e.recipes.createDeploying(iep, [iep, 'ae2:printed_silicon']),
      e.recipes.createPressing(iep, iep)
    ]).transitionalItem(iep).loops(1).id('haven:engineering_processor')
    
  let rcc = 'haven:incomplete_radioactive_cell_component'
    e.recipes.createSequencedAssembly([
      Item.of('megacells:radioactive_cell_component').withChance(100) //  result
    ], 'ae2:singularity', [ // input
      e.recipes.createDeploying(rcc, [rcc, 'ae2:cell_component_256k']),
      e.recipes.createDeploying(rcc, [rcc, 'mekanism:radioactive_waste_barrel']),
      e.recipes.createPressing(rcc, rcc)
    ]).transitionalItem(rcc).loops(1).id('haven:radioactive_cell_component')
    
  let bcc = 'haven:incomplete_bulk_cell_component'
    e.recipes.createSequencedAssembly([
      Item.of('megacells:bulk_cell_component').withChance(100) //  result
    ], 'ae2:singularity', [ // input
      e.recipes.createDeploying(bcc, [bcc, 'megacells:cell_component_16m']),
      e.recipes.createDeploying(bcc, [bcc, 'ae2:spatial_cell_component_16']),
      e.recipes.createPressing(bcc, bcc)
    ]).transitionalItem(bcc).loops(1).id('haven:bulk_cell_component')
})
