ServerEvents.recipes(event => {
    var lcd = 'itemalchemy:low_covalence_dust'
    var mcd = 'itemalchemy:middle_covalence_dust'
    var hcd = 'itemalchemy:high_covalence_dust'
    var pstone = 'itemalchemy:philosopher_stone'

    event.remove({output: pstone})
    event.shaped(
        Item.of(pstone, 1), // arg 1: output
        [ 
          'RGR', 
          'GMG',
          'RGR'
        ],
        {
          M: 'botania:mana_diamond',
          R: 'minecraft:redstone',
          G: 'minecraft:glowstone_dust'
        }
    )

    event.remove({output: 'itemalchemy:alchemy_table'})
    event.shaped(
        Item.of('itemalchemy:alchemy_table', 1), // arg 1: output
        [ 
          'ODO', 
          'MPM',
          'ODO'
        ],
        {
          P: pstone,
          M: 'botania:mana_diamond',
          O: 'minecraft:obsidian',
          D: 'itemalchemy:dark_matter'
        }
    ).keepIngredient(pstone)
    
    event.remove({output: 'itemalchemy:alchemy_chest'})
    event.shaped(
        Item.of('itemalchemy:alchemy_chest', 1),
        [ 
          'LMH', 
          'SDS',
          'IOI'
        ],
        {
          O: 'ironchests:obsidian_chest', 
          I: 'minecraft:iron_ingot', 
          S: 'minecraft:stone',
          D: 'minecraft:diamond',
          L: lcd,
          M: mcd,
          H: hcd
        }
    )

    event.remove({output: 'itemalchemy:emc_condenser'})
    event.shaped(
        Item.of('itemalchemy:emc_condenser', 1),
        [ 
          'RNR', 
          'MAM',
          'OOO'
        ],
        {
          A: 'itemalchemy:alchemy_chest',
          O: 'minecraft:obsidian',
          M: 'botania:mana_diamond',
          N: 'minecraft:nether_star',
          R: 'itemalchemy:red_matter'
        }
    )

    event.remove({output: lcd})
    event.shapeless(
        Item.of(lcd, 3),
        [ 
            'minecraft:coal',
            '3x minecraft:cobblestone'
        ]
    )

    event.remove({output: mcd})
    event.shapeless(
        Item.of(mcd, 3),
        [ 
            'minecraft:iron_ingot',
            'minecraft:redstone'
        ]
    )

    event.remove({output: hcd})
    event.shapeless(
        Item.of(hcd, 3),
        [ 
            'minecraft:diamond',
            'minecraft:coal'
        ]
    )

    event.remove({output: 'itemalchemy:aeternalis_fuel'})
    event.shaped(
        Item.of('itemalchemy:aeternalis_fuel', 1),
        [ 
          'MMM', 
          'MPM',
          'MMM'
        ],
        {
          M: 'itemalchemy:mobius_fuel',
          P: hcd
        }
    )

    event.remove({output: 'itemalchemy:mobius_fuel'})
    event.shaped(
        Item.of('itemalchemy:mobius_fuel', 1),
        [ 
          'MMM', 
          'MPM',
          'MMM'
        ],
        {
          M: 'itemalchemy:alchemical_fuel',
          P: mcd
        }
    )


    event.remove({output: 'itemalchemy:alchemical_fuel'})
    event.shaped(
        Item.of('itemalchemy:alchemical_fuel', 1),
        [ 
          'MMM', 
          'MPM',
          'MMM'
        ],
        {
          M: 'minecraft:coal',
          P: lcd
        }
    )
})