ServerEvents.recipes(event => {
    event.remove({id: 'enderio:void_chassis'})
    event.remove({id: 'enderio:primitive_alloy_smelter'})
    event.remove({id: 'enderio:alloy_smelter'})
    event.remove({id: 'enderio:pressurized_fluid_tank'})
    event.remove({id: 'enderio:alloy_smelting/energetic_alloy_ingot'})
    event.remove({id: 'enderio:alloy_smelting/dark_steel_ingot'})
    event.remove({id: 'enderio:alloy_smelting/soularium_ingot'})
    event.remove({id: 'enderio:alloy_smelting/fused_quartz'})
    event.remove({output: 'enderio:energy_conduit'})
})

ServerEvents.recipes(event => {
  //Conductive Conduit
  event.shaped('8x enderio:conductive_conduit',
      ['111','222','111'], {
      1: 'enderio:conduit_binder', 
      2: '#forge:ingots/conductive_alloy'
  }).id('enderio:conductive_conduit')
  
  //Energetic Conduit
  event.shaped('8x enderio:energetic_conduit',
    ['111','232','111'], {
    1: 'enderio:conduit_binder', 
    2: '#forge:ingots/energetic_alloy',
    3: 'enderio:conductive_conduit'
  }).id('enderio:energetic_conduit')
  
  //Vibrant Conduit
  event.shaped('8x enderio:vibrant_conduit',
    ['111','232','111'], {
    1: 'enderio:conduit_binder', 
    2: '#forge:ingots/vibrant_alloy',
    3: 'enderio:energetic_conduit'
  }).id('enderio:vibrant_conduit')
  
  //End Steel Conduit
  event.shaped('8x enderio:endsteel_conduit',
    ['111','232','111'], {
    1: 'enderio:conduit_binder', 
    2: '#forge:ingots/end_steel',
    3: 'enderio:vibrant_conduit'
  }).id('enderio:endsteel_conduit')
  
  //Lumium Conduit
  event.shaped('8x enderio:lumium_conduit',
    ['111','232','111'], {
    1: 'enderio:conduit_binder', 
    2: '#forge:ingots/lumium',
    3: 'enderio:endsteel_conduit'
  }).id('enderio:lumium_conduit')
  
  //Signalum Conduit
  event.shaped('8x enderio:signalum_conduit',
    ['111','232','111'], {
    1: 'enderio:conduit_binder', 
    2: '#forge:ingots/signalum',
    3: 'enderio:lumium_conduit'
  }).id('enderio:signalum_conduit')
  
  //Enderium Conduit
  event.shaped('8x enderio:enderium_conduit',
    ['111','232','111'], {
    1: 'enderio:conduit_binder', 
    2: '#forge:ingots/enderium',
    3: 'enderio:signalum_conduit'
  }).id('enderio:enderium_conduit')

  //Void Chassis
  event.shaped('enderio:void_chassis',
      ['121','232','121'], {
      1: 'enderio:dark_steel_bars', 
      2: '#forge:ingots/dark_steel',
      3: '#forge:dusts/grains_of_infinity'
  }).id('enderio:void_chassis')

    //Primitive Alloy Smelter
    event.shaped('enderio:primitive_alloy_smelter',
        ['141','232','222'], {
        1: 'minecraft:blast_furnace', 
        2: '#forge:ingots/blazegold',
        3: '#forge:dusts/grains_of_infinity',
        4: 'eidolon:unholy_symbol'
    }).id('enderio:primitive_alloy_smelter')

    //Alloy Smelter
    event.shaped('enderio:alloy_smelter',
        ['121','232','454'], {
        1: '#forge:ingots/dark_steel', 
        2: 'minecraft:furnace',
        3: 'enderio:void_chassis',
        4: '#forge:gears/vibrant',
        5: 'enderio:primitive_alloy_smelter'
    }).id('enderio:alloy_smelter')

    //Pressurized Fluid Tank
    event.shaped('enderio:pressurized_fluid_tank',
        ['121','232','121'], {
        1: '#forge:ingots/dark_steel', 
        2: 'enderio:dark_steel_bars',
        3: 'enderio:fluid_tank'
    }).id('enderio:pressurized_fluid_tank')

    //Energetic Alloy
    event.custom({
        "type": "enderio:alloy_smelting",
        "energy": 4800,
        "experience": 0.3,
        "inputs": [
          {
            "count": 1,
            "ingredient": {
              "tag": "forge:dusts/redstone"
            }
          },
          {
            "count": 1,
            "ingredient": {
              "tag": "forge:ingots/arcane_gold"
            }
          },
          {
            "count": 1,
            "ingredient": {
              "tag": "forge:dusts/glowstone"
            }
          }
        ],
        "result": {
          "item": "enderio:energetic_alloy_ingot"
        }
      })

    //Dark Steel
    event.custom({
        "type": "enderio:alloy_smelting",
        "energy": 4800,
        "experience": 0.3,
        "inputs": [
          {
            "count": 1,
            "ingredient": {
              "tag": "forge:ingots/steel"
            }
          },
          {
            "count": 1,
            "ingredient": {
              "tag": "forge:dusts/coal"
            }
          },
          {
            "count": 1,
            "ingredient": {
              "tag": "forge:obsidian"
            }
          }
        ],
        "result": {
          "tag": "forge:ingots/dark_steel"
        }
      })

    //Steel Ingot
    event.custom({
        "type": "enderio:alloy_smelting",
        "energy": 4800,
        "experience": 0.3,
        "inputs": [
          {
            "count": 1,
            "ingredient": {
              "tag": "forge:ingots/iron"
            }
          },
          {
            "count": 2,
            "ingredient": {
              "tag": "forge:coal_coke"
            }
          }
        ],
        "result": {
          "item": "alltheores:steel_ingot"
        }
      }).id('enderio:steel_ingot')

    //Steel Block
    event.custom({
        "type": "enderio:alloy_smelting",
        "energy": 38400,
        "experience": 0.3,
        "inputs": [
          {
            "count": 1,
            "ingredient": {
              "tag": "forge:storage_blocks/iron"
            }
          },
          {
            "count": 2,
            "ingredient": {
              "tag": "forge:storage_blocks/coal_coke"
            }
          }
        ],
        "result": {
          "item": "alltheores:steel_block"
        }
    }).id('enderio:steel_block')

    //Soularium
    event.custom({
        "type": "enderio:alloy_smelting",
        "energy": 4800,
        "experience": 0.3,
        "inputs": [
          {
            "count": 1,
            "ingredient": {
              "tag": "forge:ingots/arcane_gold"
            }
          },
          {
            "count": 1,
            "ingredient": {
              "tag": "forge:soul_sand"
            }
          }
        ],
        "result": {
          "tag": "forge:ingots/soularium"
        }
    }).id('enderio:soularium_ingot')

    //Fused Quartz - Non Block
    event.custom({
        "type": "enderio:alloy_smelting",
        "energy": 4800,
        "experience": 0.3,
        "inputs": [
          {
            "count": 4,
            "ingredient": {
              "tag": "forge:gems/quartz"
            }
          }
        ],
        "result": {
          "item": "enderio:fused_quartz"
        }
    }).id('enderio:fused_quartz')

    //Base Alloys — EnderIO Alloy Smelter
    //Bronze (3x Copper + 1x Tin -> 4x Bronze)
    event.custom({
        "type": "enderio:alloy_smelting",
        "energy": 6400,
        "experience": 0.3,
        "inputs": [
          {"count": 3, "ingredient": {"tag": "forge:ingots/copper"}},
          {"count": 1, "ingredient": {"tag": "forge:ingots/tin"}}
        ],
        "result": {"tag": "forge:ingots/bronze", "count": 4}
    }).id('enderio:bronze_ingot')

    //Brass (3x Copper + 1x Zinc -> 4x Brass)
    event.custom({
        "type": "enderio:alloy_smelting",
        "energy": 6400,
        "experience": 0.3,
        "inputs": [
          {"count": 3, "ingredient": {"tag": "forge:ingots/copper"}},
          {"count": 1, "ingredient": {"tag": "forge:ingots/zinc"}}
        ],
        "result": {"tag": "forge:ingots/brass", "count": 4}
    }).id('enderio:brass_ingot')

    //Electrum (Gold + Silver -> 2x Electrum)
    event.custom({
        "type": "enderio:alloy_smelting",
        "energy": 4800,
        "experience": 0.3,
        "inputs": [
          {"count": 1, "ingredient": {"tag": "forge:ingots/gold"}},
          {"count": 1, "ingredient": {"tag": "forge:ingots/silver"}}
        ],
        "result": {"item": "alltheores:electrum_ingot", "count": 2}
    }).id('enderio:electrum_ingot')

    //Invar (2x Iron + 1x Nickel -> 3x Invar)
    event.custom({
        "type": "enderio:alloy_smelting",
        "energy": 5600,
        "experience": 0.3,
        "inputs": [
          {"count": 2, "ingredient": {"tag": "forge:ingots/iron"}},
          {"count": 1, "ingredient": {"tag": "forge:ingots/nickel"}}
        ],
        "result": {"tag": "forge:ingots/invar", "count": 3}
    }).id('enderio:invar_ingot')

    //Constantan (Copper + Nickel -> 2x Constantan)
    event.custom({
        "type": "enderio:alloy_smelting",
        "energy": 4800,
        "experience": 0.3,
        "inputs": [
          {"count": 1, "ingredient": {"tag": "forge:ingots/copper"}},
          {"count": 1, "ingredient": {"tag": "forge:ingots/nickel"}}
        ],
        "result": {"tag": "forge:ingots/constantan", "count": 2}
    }).id('enderio:constantan_ingot')

    //Rose Gold (Gold + 3x Copper -> 4x Rose Gold)
    event.custom({
        "type": "enderio:alloy_smelting",
        "energy": 4800,
        "experience": 0.3,
        "inputs": [
          {"count": 1, "ingredient": {"tag": "forge:ingots/gold"}},
          {"count": 3, "ingredient": {"tag": "forge:ingots/copper"}}
        ],
        "result": {"item": "thermal:rose_gold_ingot", "count": 4}
    }).id('enderio:rose_gold_ingot')

    //Manyullyn (Netherite Scrap + 3x Cobalt -> 4x Manyullyn)
    event.custom({
        "type": "enderio:alloy_smelting",
        "energy": 4800,
        "experience": 0.3,
        "inputs": [
          {"count": 1, "ingredient": {"tag": "forge:ingots/netherite_scrap"}},
          {"count": 3, "ingredient": {"tag": "forge:ingots/cobalt"}}
        ],
        "result": {"tag": "forge:ingots/manyullyn", "count": 4}
    }).id('enderio:manyullyn_ingot')

  //Soularium Block -> Ingots
  event.shapeless(
    Item.of('9x #forge:ingots/soularium'), // arg 1: output
    [ 
      '#forge:storage_blocks/soularium'
    ]
  ).id('enderio:soularium_from_block')
  
  //Conduit Probe Fix
  event.replaceInput(
    { mod: 'enderio' }, // Arg 1: the filter
    'enderio:energy_conduit',            // Arg 2: the item to replace
    'enderio:conductive_conduit'         // Arg 3: the item to replace it with
  )

  event.custom({
  "type": "enderio:sag_milling",
  "bonus": "none",
  "energy": 2400,
  "input": {
    "tag": "forge:ender_pearls"
  },
  "outputs": [
    {
      "chance": 1.0,
      "item": {
        "count": 1,
        "tag": "forge:dusts/ender_pearl"
      },
      "optional": false
    }
  ]
}).id('enderio:sag_milling/ender_pearl')
})
