ServerEvents.recipes(event => {
    event.remove({id: 'refinedstorage:machine_casing'})
    event.remove({id: 'rsinfinitybooster:infinity_card'})
    event.remove({id: 'thermal:compat/refinedstorage/smelter_refinedstorage_alloy_quartz_enriched_iron'})
    event.remove({output: 'refinedstorage:external_storage'})
    event.remove({output: 'refinedstorage:importer'})
    event.remove({output: 'refinedstorage:exporter'})
    event.remove({output: 'refinedstorage:raw_basic_processor'})
    event.remove({output: 'refinedstorage:raw_improved_processor'})
    event.remove({output: 'refinedstorage:raw_advanced_processor'})
    event.remove({output: 'refinedstorage:disk_drive'})
    event.remove({output: 'refinedstorage:controller'})
    event.remove({output: 'extrastorage:iron_crafter'})
    event.remove({output: 'extrastorage:gold_crafter'})
    event.remove({output: 'extrastorage:diamond_crafter'})
    event.remove({output: 'extrastorage:netherite_crafter'})
    event.remove({output: 'extrastorage:raw_neural_processor'})
    event.remove({output: 'extradisks:raw_withering_processor'})
})

ServerEvents.recipes(event => {
    //Machine Casing
    event.custom({
      "type": "pneumaticcraft:pressure_chamber", 
        "inputs": [
            {
              "type": "pneumaticcraft:stacked_item",
              "count": 8,
              "item": "refinedstorage:quartz_enriched_iron"
            },
            {
              "type": "pneumaticcraft:stacked_item",
              "count": 1,
              "item": "rftoolsbase:machine_frame"
            },
            {
              "type": "pneumaticcraft:stacked_item",
              "count": 4,
              "item": "laserio:logic_chip"
            },
      ],
            "pressure": 3.5, 
            "results": [{"item": "refinedstorage:machine_casing"}]
    }).id('refinedstorage:pressure/machine_casing')
    
    //Quartz Enriched Iron
    event.custom({
		"input": [
			{
				"tag": "forge:ingots/compressed_iron"
			},
			{
				"tag": "forge:ingots/compressed_iron"
			},
			{
				"tag": "forge:ingots/compressed_iron"
			},
			{
				"tag": "forge:ingots/compressed_iron"
			}
		],
		"processingTime": 300,
		"output": {
			"item": "refinedstorage:quartz_enriched_iron",
			"count": 4
		},
		"inputFluid": "{FluidName:\"pneumaticcraft:plastic\",Amount:1000}",
		"type": "industrialforegoing:dissolution_chamber"
	}).id('refinedstorage:quartz_enriched_iron')

  //Importer
  event.shaped('refinedstorage:importer',
  [' 1 ','232',' 1 '], {
    1: 'refinedstorage:improved_processor', 
    2: 'refinedstorage:destruction_core', 
    3: 'refinedstorage:cable'
  }).id('refinedstorage:importer')

  //Exporter
  event.shaped('refinedstorage:exporter',
  [' 1 ','232',' 1 '], {
    1: 'refinedstorage:improved_processor', 
    2: 'refinedstorage:construction_core', 
    3: 'refinedstorage:cable'
  }).id('refinedstorage:exporter')

  //Raw Basic Processor
  event.shaped('refinedstorage:raw_basic_processor',
  ['12 ','34 ','   '], {
    1: 'refinedstorage:processor_binding', 
    2: 'naturesaura:infused_iron', 
    3: '#forge:silicon', 
    4: 'laserio:logic_chip_raw'
  }).id('refinedstorage:raw_basic_processor')

  //Raw Improved Processor
  event.shaped('refinedstorage:raw_improved_processor',
  ['12 ','34 ','   '], {
    1: 'refinedstorage:processor_binding', 
    2: 'naturesaura:tainted_gold', 
    3: '#forge:silicon', 
    4: 'laserio:logic_chip_raw'
  }).id('refinedstorage:raw_improved_processor')

  //Raw Advanced Processor
  event.shaped('refinedstorage:raw_advanced_processor',
  ['12 ','34 ','   '], {
    1: 'refinedstorage:processor_binding', 
    2: 'naturesaura:sky_ingot', 
    3: '#forge:silicon', 
    4: 'laserio:logic_chip_raw'
  }).id('refinedstorage:raw_advanced_processor')

  //Raw Withering Processor
  event.shaped('extradisks:raw_withering_processor',
  ['12 ','34 ','   '], {
    1: 'refinedstorage:processor_binding', 
    2: '#forge:ingots/fireite', 
    3: '#forge:silicon', 
    4: 'laserio:logic_chip_raw'
  }).id('extradisks:raw_withering_processor')

  //Raw Neural Processor
  event.shaped('extrastorage:raw_neural_processor',
  ['123','242','565'], {
    1: 'refinedstorage:raw_advanced_processor', 
    2: '#forge:gems/quartz', 
    3: 'refinedstorage:raw_improved_processor', 
    4: 'extradisks:raw_withering_processor', 
    5: '#forge:obsidian', 
    6: 'refinedstorage:raw_basic_processor'
  }).id('extrastorage:raw_neural_processor')

  //Processor Binding
  event.shaped('refinedstorage:processor_binding',
  ['   ','121','   '], {
    1: 'botania:mana_string', 
    2: 'industrialforegoing:pink_slime'
  }).id('refinedstorage:processor_binding')

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

  //Iron Crafter
  event.shaped('extrastorage:iron_crafter',
  ['121','343','121'], {
    1: 'allthecompressed:iron_block_1x', 
    2: 'pneumaticcraft:smart_chest', 
    3: '#forge:circuits/advanced', 
    4: '#refinedstorage:crafter'
  }).id('extrastorage:iron_crafter')

  //Gold Crafter
  event.shaped('extrastorage:gold_crafter',
  ['121','343','121'], {
    1: 'allthecompressed:gold_block_1x', 
    2: '#forge:circuits/ultimate', 
    3: 'extradisks:withering_processor', 
    4: 'extrastorage:iron_crafter'
  }).id('extrastorage:gold_crafter')

  //Diamond Crafter
  event.shaped('extrastorage:diamond_crafter',
  ['121','343','121'], {
    1: 'allthecompressed:diamond_block_1x', 
    2: 'mekanism_extras:supreme_control_circuit', 
    3: 'extrastorage:neural_processor', 
    4: 'extrastorage:gold_crafter'
  }).id('extrastorage:diamond_crafter')

  //Netherite Crafter
  event.shaped('extrastorage:netherite_crafter',
  ['121','343','121'], {
    1: 'allthecompressed:netherite_block_1x', 
    2: 'mekanism_extras:cosmic_control_circuit', 
    3: 'extrastorage:neural_processor', 
    4: 'extrastorage:diamond_crafter'
  }).id('extrastorage:netherite_crafter')
    
  //Cable
  event.custom({
  "input": [
    {
      "item": "refinedstorage:quartz_enriched_iron"
    },
    {
      "item": "refinedstorage:quartz_enriched_iron"
    },
    {
      "item": "refinedstorage:quartz_enriched_iron"
    },
    {
      "item": "prettypipes:pipe"
    }
  ],
  "processingTime": 300,
  "output": {
    "item": "refinedstorage:cable",
    "count": 12
  },
  "inputFluid": "{FluidName:\"thermal:refined_fuel\",Amount:75}",
  "type": "industrialforegoing:dissolution_chamber"
  }).id('refinedstorage:cable')

  //Infinity Range Booster
  event.custom({
    "type": "extendedcrafting:shaped_table",
    "pattern": [
      "ABA",
      "BCB",
      "DDD"
    ],
    "key": {
      "A": {
        "item": "mekanism_extras:absolute_control_circuit"
      },
      "B": {
        "item": "refinedstorage:range_upgrade"
      },
      "C": {
        "item": "extendedcrafting:ender_star"
      },
      "D": {
        "item": "minecraft:netherite_ingot"
      }
    },
    "result": {
      "item": "rsinfinitybooster:infinity_card"
    }
  }).id('rsinfinitybooster:infinity_card')

  //Dimension Card
  event.custom({
    "type": "extendedcrafting:shaped_table",
    "pattern": [
      "ABA",
      "BCB",
      "ABA"
    ],
    "key": {
      "A": {
        "item": "rsinfinitybooster:infinity_card"
      },
      "B": {
        "item": "extendedcrafting:ender_star"
      },
      "C": {
        "item": "mekanism_extras:cosmic_control_circuit"
      }
    },
    "result": {
      "item": "rsinfinitybooster:dimension_card"
    }
  }).id('rsinfinitybooster:dimension_card')

  //Controller
  event.recipes.createSequencedAssembly([
    Item.of('refinedstorage:controller'),
    ], 'refinedstorage:machine_casing', [
    event.recipes.createDeploying('create:incomplete_precision_mechanism', ['create:incomplete_precision_mechanism', '#forge:silicon']),
    event.recipes.createDeploying('create:incomplete_precision_mechanism', ['create:incomplete_precision_mechanism', 'refinedstorage:quartz_enriched_iron']),
    event.recipes.createDeploying('create:incomplete_precision_mechanism', ['create:incomplete_precision_mechanism', 'refinedstorage:basic_processor']),
    event.recipes.createDeploying('create:incomplete_precision_mechanism', ['create:incomplete_precision_mechanism', 'refinedstorage:improved_processor']),
    event.recipes.createDeploying('create:incomplete_precision_mechanism', ['create:incomplete_precision_mechanism', 'refinedstorage:advanced_processor'])
    ]).transitionalItem('create:incomplete_precision_mechanism').loops(25)
    

  //External Storage
  event.recipes.extendedcrafting.compressor("refinedstorage:external_storage", "refinedstorage:disk_drive", "occultism:storage_stabilizer_tier1", 2, 50000);
})