ServerEvents.recipes(event => {
  event.remove({id: 'extendedcrafting:redstone_ingot'})
  event.remove({id: 'extendedcrafting:black_iron_ingot'})
  event.remove({id: 'extendedcrafting:ender_ingot'})
  event.remove({id: 'extendedcrafting:luminessence'})
  event.remove({id: 'extendedcrafting:black_iron_slate'})
  event.remove({id: 'extendedcrafting:basic_component'})
  event.remove({id: 'extendedcrafting:advanced_component'})
  event.remove({id: 'extendedcrafting:elite_component'})
  event.remove({id: 'extendedcrafting:ultimate_component'})
  event.remove({id: 'extendedcrafting:compressor'})
  event.remove({id: 'extendedcrafting:handheld_table'})
  event.remove({id: 'extendedcrafting:epic_table'})
})

ServerEvents.recipes(event => {
  //Redstone Ingot -Induction Smelter
  event.custom({
      "type": "thermal:smelter",
      "ingredients": [
        {
          "value": [
            {"tag": "forge:dusts/redstone"}
          ],
          "count": 5
        },
        {
          "value": [
            {"tag": "forge:ingots/rose_gold"}
          ],
          "count": 2
        }
      ],
      "result": [
        {
          "item": "extendedcrafting:redstone_ingot",
          "count": 1
        }
      ],
      "energy": 4000
    }).id('extendedcrafting:redstone_ingot')
  
  //Flux Alternator - Gold -> Tainted Gold
  event.replaceInput(
    { id: 'extendedcrafting:flux_alternator' }, // Arg 1: the filter
    'minecraft:gold_ingot',            // Arg 2: the item to replace
    'naturesaura:tainted_gold'         // Arg 3: the item to replace it with
  )
  
  //Flux Crafter - Gold -> Tainted Gold
  event.replaceInput(
    { id: 'extendedcrafting:flux_crafter' }, // Arg 1: the filter
    'minecraft:gold_ingot',            // Arg 2: the item to replace
    'naturesaura:tainted_gold'         // Arg 3: the item to replace it with
  )

  //Redstone Ingot - Alloy Smelter
  event.custom({
    "type": "enderio:alloy_smelting",
    "energy": 6400,
    "experience": 0.3,
    "inputs": [
      {
        "count": 2,
        "ingredient": {
          "tag": "forge:ingots/rose_gold"
        }
      },
      {
        "count": 5,
        "ingredient": {
          "tag": "forge:dusts/redstone"
        }
      }
    ],
    "result": {
      "count": 1,
      "tag": "forge:ingots/redstone_ingot"
    }
  })
      
  //Ender Ingot
  event.custom({
    "type": "thermal:smelter",
    "ingredients": [
      {
        "value": [
          {"item": "minecraft:dragon_breath"}
        ],
        "count": 1
      },
      {
        "value": [
          {"tag": "forge:ingots/terrasteel"}
        ],
        "count": 1
      }
    ],
    "result": [
      {
        "item": "extendedcrafting:ender_ingot",
        "count": 1
      }
    ],
    "energy": 4000
  }).id('extendedcrafting:ender_ingot')
    
  //Black Iron Ingot
  event.custom({
    "type": "thermal:smelter",
    "ingredients": [
      {
        "value": [
          {"item": "createdeco:industrial_iron_ingot"}
        ],
        "count": 1
      },
      {
        "value": [
          {"tag": "forge:ingots/hop_graphite"}
        ],
        "count": 1
      },
      {
        "value": [
          {"tag": "forge:ingots/compressed_iron"}
        ],
        "count": 1
      }
    ],
    "result": [
      {
        "item": "extendedcrafting:black_iron_ingot",
        "count": 1
      }
    ],
    "energy": 4000
  }).id('extendedcrafting:black_iron_ingot')
  
  //Luminessence
  event.custom({
    "type": "create:filling",
    "ingredients": [
      {
        "item": "mysticalagriculture:tertium_essence"
      },
      {
        "fluid": "thermal:glowstone",
        "nbt": {},
        "amount": 250
      }
    ],
    "results": [
      {
        "item": "extendedcrafting:luminessence"
      }
    ]
  }).id('extendedcrafting:luminessence')
  
  //Basic Component
  event.shaped('extendedcrafting:basic_component',
  ['12 ','34 ','   '], {
      1: 'extendedcrafting:black_iron_slate',
      2: 'extendedcrafting:luminessence',
      3: '#forge:ingots/stellarium',
      4: '#forge:ingots/stellarium'
  }).id('extendedcrafting:basic_component')
  
  //Advanced Component
  event.shaped('extendedcrafting:advanced_component',
  ['12 ','34 ','   '], {
      1: 'extendedcrafting:black_iron_slate',
      2: 'extendedcrafting:luminessence',
      3: '#forge:ingots/allthemodium',
      4: '#forge:ingots/allthemodium'
  }).id('extendedcrafting:advanced_component')
  
  //Elite Component
  event.shaped('extendedcrafting:elite_component',
  ['12 ','34 ','   '], {
      1: 'extendedcrafting:black_iron_slate',
      2: 'extendedcrafting:luminessence',
      3: '#forge:gems/mana_diamond',
      4: '#forge:gems/mana_diamond'
  }).id('extendedcrafting:elite_component')
  
  //Ultimate Component
  event.shaped('extendedcrafting:ultimate_component',
  ['12 ','34 ','   '], {
      1: 'extendedcrafting:black_iron_slate',
      2: 'extendedcrafting:luminessence',
      3: '#forge:ingots/gaia',
      4: '#forge:ingots/gaia'
  }).id('extendedcrafting:ultimate_component')

  //Black Iron Slate
  event.custom({
      "type": "thermal:press",
      "ingredients": [
        {
          "tag": "forge:ingots/black_iron",
          "count": 1
      }
      ],
      "result": [
        {
          "item": "extendedcrafting:black_iron_slate",
          "count": 1
        }
      ]
    }).id('extendedcrafting:black_iron_slate')

  //Quantum Compressor
  event.custom({
    "type": "extendedcrafting:shaped_table",
    "pattern": [
      "ABBBA",
      "AACAA",
      "AADAA",
      "AEFEA",
      "ABBBA"
    ],
    "key": {
      "A": {
        "item": "extendedcrafting:black_iron_block"
      },
      "B": {
        "item": "extendedcrafting:crystaltine_ingot"
      },
      "C": {
        "item": "extendedcrafting:elite_catalyst"
      },
      "D": {
        "item": "extendedcrafting:frame"
      },
      "E": {
        "item": "extendedcrafting:elite_component"
      },
      "F": {
        "item": "mekanism:ultimate_control_circuit"
      }
    },
    "result": {
      "item": "extendedcrafting:compressor"
    }
  }).id('extendedcrafting:compressor')

  //Epic Crafting Table
  event.shaped('extendedcrafting:epic_table',
  ['121','343','111'], {
  1: 'extendedcrafting:enhanced_redstone_component',
  2: 'extendedcrafting:enhanced_redstone_catalyst',
  3: 'extendedcrafting:ultimate_table',
  4: 'extendedcrafting:enhanced_redstone_ingot_block'
  }).id('extendedcrafting:epic_table')

  });