ServerEvents.recipes(event => {
    event.remove({id: 'ae2:transform/fluix_crystal'})
    event.remove({id: 'ae2:transform/fluix_crystals'})
    event.remove({id: 'ae2:transform/certus_quartz_crystals'})
    event.remove({id: 'ae2:network/crafting/cpu_crafting_unit'})
    event.remove({id: 'ae2:network/blocks/storage_drive'})
    event.remove({id: 'ae2:network/blocks/energy_energy_acceptor'})
    event.remove({id: 'ae2:network/blocks/controller'})
    event.remove({id: 'ae2:network/blocks/pattern_providers_interface'})
    event.remove({id: 'ae2:network/parts/storage_bus'})
    event.remove({id: 'ae2:inscriber/engineering_processor_print'})
    event.remove({id: 'ae2:inscriber/logic_processor_print'})
    event.remove({id: 'ae2:inscriber/calculation_processor_print'})
    event.remove({id: 'ae2things:cells/disk_housing'})
})

ServerEvents.recipes(event => {
    //Iron Ingot -> Steel Ingot
    event.replaceInput(
      { mod: 'ae2' }, // Arg 1: the filter
      'minecraft:iron_ingot',            // Arg 2: the item to replace
      'refinedstorage:quartz_enriched_iron'         // Arg 3: the item to replace it with
    )

    //Iron Block -> Steel Block
    event.replaceInput(
      { mod: 'ae2' }, // Arg 1: the filter
      'minecraft:iron_block',            // Arg 2: the item to replace
      'refinedstorage:quartz_enriched_iron_block'         // Arg 3: the item to replace it with
    )

    event.replaceInput(
      { mod: 'ae2' }, // Arg 1: the filter
      'minecraft:gold_ingot',            // Arg 2: the item to replace
      'naturesaura:sky_ingot'         // Arg 3: the item to replace it with
    )

    //Iron Block -> Steel Block
    event.replaceInput(
      { mod: 'ae2' }, // Arg 1: the filter
      'minecraft:gold_block',            // Arg 2: the item to replace
      'naturesaura:sky_ingot_block'         // Arg 3: the item to replace it with
    )

    event.replaceInput(
      { mod: 'ae2' }, // Arg 1: the filter
      'minecraft:diamond',            // Arg 2: the item to replace
      'botania:mana_diamond'         // Arg 3: the item to replace it with
    )

    event.replaceInput(
      { mod: 'ae2' }, // Arg 1: the filter
      'minecraft:glass',            // Arg 2: the item to replace
      'thermal_extra:soul_infused_glass'         // Arg 3: the item to replace it with
    )

    //Certus Quartz
    event.custom({
        "type": "actuallyadditions:mining_lens",
        "ingredient": {
          "item": "minecraft:quartz_block"
        },
        "result": {
          "item": "ae2:quartz_block"
        },
        "weight": 1
    })

    //Crafting Unit
    event.shaped('ae2:crafting_unit',
    ['121','343','121'], {
      1: 'create:mechanical_crafter', 
      2: 'ae2:calculation_processor', 
      3: '#forge:circuits/basic', 
      4: 'rftoolsbase:machine_frame'
    }).id('ae2:crafting_unit')

    //Fluix Block
    event.custom({
      "type": "actuallyadditions:empowering",
      "base": {
        "item": "ae2:quartz_block"
      },
      "color": 6522834,
      "energy": 5000,
      "modifiers": [
        {
          "item": "minecraft:quartz_block"
        },
        {
          "item": "minecraft:redstone_block"
        },
        {
          "item": "minecraft:quartz_block"
        },
        {
          "item": "minecraft:redstone_block"
        }
      ],
      "result": {
        "item": "ae2:fluix_block"
      },
      "time": 50
    }).id('ae2:fluix_block')

    //Energy Acceptor
    event.shaped('ae2:energy_acceptor',
    ['121','232','121'], {
      1: 'refinedstorage:quartz_enriched_iron', 
      2: 'ae2:quartz_glass', 
      3: 'refinedstorage:machine_casing'
    }).id('ae2:energy_acceptor')

    //ME Controller
    event.shaped('ae2:controller',
    ['121','232','121'], {
      1: 'ae2:smooth_sky_stone_block', 
      2: 'ae2:fluix_block', 
      3: 'refinedstorage:machine_casing'
    }).id('ae2:controller')

    //Disk Drive
    event.shaped('ae2:drive',
    ['121','131','141'], {
      1: 'refinedstorage:quartz_enriched_iron', 
      2: 'occultism:storage_stabilizer_tier4', 
      3: 'ae2:energy_acceptor', 
      4: 'extrastorage:neural_processor'
    }).id('ae2:drive')

    //ME DISK Housing
    event.shaped('ae2things:disk_housing',
    ['121','232','454'], {
      1: 'ae2:quartz_glass', 
      2: 'actuallyadditions:empowered_restonia_crystal', 
      3: 'ae2:item_cell_housing', 
      4: '#forge:ingots/netherite', 
      5: 'actuallyadditions:empowered_emeradic_crystal_block'
    }).id('ae2things:disk_housing')

    //Pattern Provider
    event.shaped('ae2:pattern_provider',
    ['121','345','121'], {
      1: 'refinedstorage:quartz_enriched_iron', 
      2: 'extendedcrafting:basic_table', 
      3: 'ae2:annihilation_core', 
      4: 'rftools:machine_frame', 
      5: 'ae2:formation_core'
    }).id('ae2:pattern_provider')

    //Calculation Press
    event.custom({
        "type": "ae2:inscriber",
        "ingredients": {
          "middle": {
            "item": "minecraft:iron_block"
          },
          "top": {
            "item": "ae2:fluix_block"
          }
        },
        "mode": "press",
        "result": {
          "count": 1,
          "item": "ae2:calculation_processor_press"
        }
    })

    //Logic Press
    event.custom({
        "type": "ae2:inscriber",
        "ingredients": {
          "middle": {
            "item": "minecraft:iron_block"
          },
          "top": {
            "item": "refinedstorage:raw_improved_processor"
          }
        },
        "mode": "press",
        "result": {
          "count": 1,
          "item": "ae2:logic_processor_press"
        }
    })

    //Engineering Press
    event.custom({
        "type": "ae2:inscriber",
        "ingredients": {
          "middle": {
            "item": "minecraft:iron_block"
          },
          "top": {
            "item": "refinedstorage:raw_advanced_processor"
          }
        },
        "mode": "press",
        "result": {
          "count": 1,
          "item": "ae2:engineering_processor_press"
        }
    })

    //Silicon Press
    event.custom({
        "type": "ae2:inscriber",
        "ingredients": {
          "middle": {
            "item": "minecraft:iron_block"
          },
          "top": {
            "item": "refinedstorage:raw_basic_processor"
          }
        },
        "mode": "press",
        "result": {
          "count": 1,
          "item": "ae2:silicon_press"
        }
    })

    //Printed Calculation Circuit
    event.custom({
        "type": "ae2:inscriber",
        "ingredients": {
          "middle": {
            "item": "refinedstorage:raw_basic_processor"
          },
          "top": {
              "item": "ae2:calculation_processor_press"
          }
        },
        "mode": "inscribe",
        "result": {
          "count": 1,
          "item": "ae2:printed_calculation_processor"
        }
    })

    //Printed Logic Circuit
    event.custom({
        "type": "ae2:inscriber",
        "ingredients": {
          "middle": {
            "item": "refinedstorage:raw_improved_processor"
          },
          "top": {
              "item": "ae2:logic_processor_press"
          }
        },
        "mode": "inscribe",
        "result": {
          "count": 1,
          "item": "ae2:printed_logic_processor"
        }
    })

    //Printed Engineering Circuit
    event.custom({
        "type": "ae2:inscriber",
        "ingredients": {
          "middle": {
            "item": "refinedstorage:raw_advanced_processor"
          },
          "top": {
              "item": "ae2:engineering_processor_press"
          }
        },
        "mode": "inscribe",
        "result": {
          "count": 1,
          "item": "ae2:printed_engineering_processor"
        }
    })

    //External Storage
    event.recipes.extendedcrafting.compressor("ae2:storage_bus", "ae2:drive", "occultism:storage_stabilizer_tier1", 2, 50000);

    //Infinity Range Booster
    event.custom({
      "type": "extendedcrafting:shaped_table",
      "pattern": [
        "ABA",
        "BCB",
        "DDD"
      ],
      "key": {
        "A": {
          "item": "mekanism_extras:absolute_control_circuit"
        },
        "B": {
          "item": "ae2:wireless_booster"
        },
        "C": {
          "item": "extendedcrafting:ender_star"
        },
        "D": {
          "item": "minecraft:netherite_ingot"
        }
      },
      "result": {
        "item": "aeinfinitybooster:infinity_card"
      }
    }).id('aeinfinitybooster:infinity_card')
  
    //Dimension Card
    event.custom({
      "type": "extendedcrafting:shaped_table",
      "pattern": [
        "ABA",
        "BCB",
        "ABA"
      ],
      "key": {
        "A": {
          "item": "aeinfinitybooster:infinity_card"
        },
        "B": {
          "item": "extendedcrafting:ender_star"
        },
        "C": {
          "item": "mekanism_extras:cosmic_control_circuit"
        }
      },
      "result": {
        "item": "aeinfinitybooster:dimension_card"
      }
    }).id('aeinfinitybooster:dimension_card')
})