ServerEvents.recipes(event => {
    event.remove({output: 'projecte:philosophers_stone'})
    event.remove({id: 'projecte:collector_mk1'})
    event.remove({id: 'projecte:collector_mk2'})
    event.remove({id: 'projecte:collector_mk3'})
    event.remove({id: 'projecte:relay_mk1'})
    event.remove({id: 'projecte:relay_mk2'})
    event.remove({id: 'projecte:relay_mk3'})
    event.remove({id: 'projecte:condenser_mk1'})
    event.remove({id: 'projectexpansion:collector/basic'})
    event.remove({id: 'projectexpansion:relay/basic'})
    event.remove({id: 'projectexpansion:star/final_star'})
})

ServerEvents.recipes(event => {
    //Philosopher's Stone
    event.custom({
        "type": "extendedcrafting:shaped_table",
        "pattern": [
          "         ",
          "  ABCBA  ",
          " ADEAEDA ",
          " BEDFDEB ",
          " CAFGFAC ",
          " BEDFDEB ",
          " ADEAEDA ",
          "  ABCBA  ",
          "         "
        ],
        "key": {
          "A": {
            "item": "kubejs:perfect_rune"
          },
          "B": {
            "tag": "iceandfire:scales/dragon"
          },
          "C": {
            "item": "mysticalagradditions:creative_essence"
          },
          "D": {
            "item": "mekanism:pellet_antimatter"
          },
          "E": {
            "item": "mekanism:pellet_polonium"
          },
          "F": {
            "item": "bigreactors:insanite_ingot"
          },
          "G": {
            "item": "extendedcrafting:the_ultimate_block"
          }
        },
        "result": {
          "item": "projecte:philosophers_stone"
        }
      }).id('projecte:philosophers_stone')
    
      //Alchemical Coal
      event.replaceInput(
        { output: 'projecte:alchemical_coal' }, // Arg 1: the filter
        'minecraft:coal',            // Arg 2: the item to replace
        'mysticalagradditions:insanium_coal'         // Arg 3: the item to replace it with
      )
    
      //Watch of Flowing Time
      event.replaceInput(
        { output: 'projecte:watch_of_flowing_time' }, // Arg 1: the filter
        'projecte:dark_matter',            // Arg 2: the item to replace
        'projectexpansion:final_star'         // Arg 3: the item to replace it with
      )
    
      //Alchemical Coal -> Coal
      event.replaceOutput(
        { input: 'projecte:alchemical_coal' }, // Arg 1: the filter
        'minecraft:coal',            // Arg 2: the item to replace
        'mysticalagradditions:insanium_coal'         // Arg 3: the item to replace it with
      )

      //Energy Condenser MK1
      event.shaped('projecte:condenser_mk1',
        ['121','232','121'], {
          1: '#forge:storage_blocks/draconium', 
          2: 'rftoolsdim:legendary_essence', 
          3: 'projecte:alchemical_chest'
      }).id('projecte:condenser_mk1')

      //Transmutation Table
      event.shaped('projecte:transmutation_table',
        ['121','232','121'], {
          1: '#forge:storage_blocks/draconium_awakened', 
          2: 'projecte:condenser_mk1', 
          3: 'projecte:philosophers_stone'
      }).id('projecte:transmutation_table')

      //Basic Collector MK1
      event.shaped('projectexpansion:basic_collector',
        ['121','131','141'], {
          1: '#forge:storage_blocks/refined_glowstone', 
          2: '#forge:glass',
          3: 'projecte:alchemical_chest',
          4: '#forge:furnaces/allthemodium'
      }).id('projectexpansion:basic_collector')

      //Basic Relay MK1
      event.shaped('projectexpansion:basic_relay',
        ['121','131','141'], {
          1: '#forge:storage_blocks/refined_obsidian', 
          2: '#forge:glass',
          3: 'projecte:alchemical_chest',
          4: '#forge:furnaces/vibranium'
      }).id('projectexpansion:basic_relay')

      //Final Star
      event.shaped('projectexpansion:final_star',
        ['111','121','111'], {
          1: 'projectexpansion:final_power_flower', 
          2: 'draconicevolution:reactor_core'
      }).id('projectexpansion:final_star')
})