ServerEvents.recipes(event => {
    event.remove({id: 'draconicevolution:components/draconium_core'})
    event.remove({id: 'draconicevolution:machines/crafting_core'})
    event.remove({id: 'draconicevolution:machines/basic_crafting_injector'})
    event.remove({id: 'draconicevolution:machines/wyvern_crafting_injector'})
    event.remove({id: 'draconicevolution:machines/awakened_crafting_injector'})
    event.remove({id: 'draconicevolution:machines/chaotic_crafting_injector'})
    event.remove({output: 'draconicevolution:draconium_ingot'})
})

ServerEvents.recipes(event => {
  //Draconium Nugget to Ingot
  event.shapeless(
    Item.of('draconicevolution:draconium_ingot'), // arg 1: output
    [ 
      '9x draconicevolution:draconium_nugget'
    ]
  ).id('draconicevolution:draconium_ingot_from_nugget')

  //Draconium Core
  event.shaped('draconicevolution:draconium_core',
  ['121','232','121'], {
      1: '#forge:ingots/draconium', 
      2: '#forge:ingots/utherium', 
      3: 'forbidden_arcanus:stellarite_piece'
  }).id('draconicevolution:draconium_core')
  
  //Iron Nugget -> Cloggrum Nugget
  event.replaceInput(
      { mod: 'draconicevolution' }, // Arg 1: the filter
      'minecraft:iron_nugget',            // Arg 2: the item to replace
      '#forge:nuggets/cloggrum'         // Arg 3: the item to replace it with
  )
  
  //Iron Ingot -> Cloggrum Ingot
  event.replaceInput(
      { mod: 'draconicevolution' }, // Arg 1: the filter
      'minecraft:iron_ingot',            // Arg 2: the item to replace
      '#forge:ingots/cloggrum'         // Arg 3: the item to replace it with
  )
  
  //Iron Block -> Cloggrum Block
  event.replaceInput(
      { mod: 'draconicevolution' }, // Arg 1: the filter
      'minecraft:iron_block',            // Arg 2: the item to replace
      '#forge:storage_blocks/cloggrum'         // Arg 3: the item to replace it with
  )
  
  //Gold Nugget -> Swift Alloy Nugget
  event.replaceInput(
      { mod: 'draconicevolution' }, // Arg 1: the filter
      'minecraft:gold_nugget',            // Arg 2: the item to replace
      '#forge:nuggets/swift_alloy'         // Arg 3: the item to replace it with
  )
  
  //Gold Ingot -> Swift Alloy Ingot
  event.replaceInput(
      { mod: 'draconicevolution' }, // Arg 1: the filter
      'minecraft:gold_ingot',            // Arg 2: the item to replace
      '#forge:ingots/swift_alloy'         // Arg 3: the item to replace it with
  )
  
  //Gold Block -> Swift Alloy Block
  event.replaceInput(
      { mod: 'draconicevolution' }, // Arg 1: the filter
      'minecraft:gold_block',            // Arg 2: the item to replace
      '#forge:storage_blocks/swift_alloy'         // Arg 3: the item to replace it with
  )

  //Fusion Crafting Core
  event.custom({
    "type": "extendedcrafting:shapeless_flux_crafter",
    "powerRequired": 50000000,
    "powerRate": 5000,
    "ingredients": [
      {
        "item": "extendedcrafting:enhanced_ender_ingot_block"
      },
      {
        "item": "botania:bifrost_perm"
      },
      {
        "item": "extendedcrafting:enhanced_ender_ingot_block"
      },
      {
        "item": "botania:bifrost_perm"
      },
      {
        "item": "draconicevolution:draconium_core"
      },
      {
        "item": "botania:bifrost_perm"
      },
      {
        "item": "extendedcrafting:enhanced_ender_ingot_block"
      },
      {
        "item": "botania:bifrost_perm"
      },
      {
        "item": "extendedcrafting:enhanced_ender_ingot_block"
      }
    ],
    "result": {
      "item": "draconicevolution:crafting_core"
    }
  }).id('draconicevolution:crafting_core')
  
  //Draconium Injector
  event.shaped('draconicevolution:basic_crafting_injector',
  ['121','343','333'], {
      1: 'mekanism_extras:absolute_control_circuit', 
      2: 'botania:spark', 
      3: 'ad_astra:glacio_stone',
      4: 'mekanism:steel_casing'
  }).id('draconicevolution:basic_crafting_injector')

  //Wyvern Injector
  event.custom({
      "type": "draconicevolution:fusion_crafting",
      "catalyst": {
        "item": "draconicevolution:basic_crafting_injector"
      },
      "ingredients": [
        {
          "item": "draconicevolution:wyvern_core"
        },
        {
          "tag": "forge:gems/mana_diamond"
        },
        {
          "item": "draconicevolution:draconium_core"
        },
        {
          "tag": "forge:gems/mana_diamond"
        },
        {
          "item": "draconicevolution:draconium_core"
        },
        {
          "tag": "forge:gems/mana_diamond"
        },
        {
          "tag": "forge:storage_blocks/draconium"
        },
        {
          "tag": "forge:gems/mana_diamond"
        }
      ],
      "result": {
        "item": "draconicevolution:wyvern_crafting_injector"
      },
      "tier": "DRACONIUM",
      "total_energy": 32000
  })

  //Draconic Injector
  event.custom({
      "type": "draconicevolution:fusion_crafting",
      "catalyst": {
        "item": "draconicevolution:wyvern_crafting_injector"
      },
      "ingredients": [
        {
          "item": "draconicevolution:awakened_core"
        },
        {
          "item": "projecte:red_matter"
        },
        {
          "item": "draconicevolution:wyvern_core"
        },
        {
          "tag": "forge:storage_blocks/draconium_awakened"
        },
        {
          "item": "draconicevolution:wyvern_core"
        },
        {
          "tag": "forge:storage_blocks/draconium_awakened"
        },
        {
          "item": "draconicevolution:awakened_core"
        },
        {
          "item": "projecte:red_matter"
        }
      ],
      "result": {
        "item": "draconicevolution:awakened_crafting_injector"
      },
      "tier": "WYVERN",
      "total_energy": 256000
  })

  //Draconic Injector
  event.custom({
      "type": "draconicevolution:fusion_crafting",
      "catalyst": {
        "item": "draconicevolution:awakened_crafting_injector"
      },
      "ingredients": [
        {
          "item": "draconicevolution:chaotic_core"
        },
        {
          "item": "projectexpansion:purple_matter"
        },
        {
          "item": "draconicevolution:awakened_core"
        },
        {
          "item": "projectexpansion:pink_matter"
        },
        {
          "item": "draconicevolution:awakened_core"
        },
        {
          "item": "projectexpansion:pink_matter"
        },
        {
          "item": "draconicevolution:chaotic_core"
        },
        {
          "item": "projectexpansion:purple_matter"
        }
      ],
      "result": {
        "item": "draconicevolution:chaotic_crafting_injector"
      },
      "tier": "DRACONIC",
      "total_energy": 8192000
  })
  
})