ServerEvents.recipes(event => {
    event.remove({id: 'minecraft:leather_boots'})
    event.remove({id: 'minecraft:leather_leggings'})
    event.remove({id: 'minecraft:leather_chestplate'})
    event.remove({id: 'minecraft:leather_helmet'})
    event.remove({id: 'minecraft:chainmail_boots'})
    event.remove({id: 'minecraft:chainmail_leggings'})
    event.remove({id: 'minecraft:chainmail_chestplate'})
    event.remove({id: 'minecraft:chainmail_helmet'})
    event.remove({id: 'minecolonies:chainmailboots'})
    event.remove({id: 'minecolonies:chainmailleggings'})
    event.remove({id: 'minecolonies:chainmailchestplate'})
    event.remove({id: 'minecolonies:chainmailhelmet'})
    event.remove({id: 'minecraft:iron_boots'})
    event.remove({id: 'minecraft:iron_leggings'})
    event.remove({id: 'minecraft:iron_chestplate'})
    event.remove({id: 'minecraft:iron_helmet'})
    event.remove({id: 'minecraft:golden_boots'})
    event.remove({id: 'minecraft:golden_leggings'})
    event.remove({id: 'minecraft:golden_chestplate'})
    event.remove({id: 'minecraft:golden_helmet'})
    event.remove({id: 'minecraft:diamond_boots'})
    event.remove({id: 'minecraft:diamond_leggings'})
    event.remove({id: 'minecraft:diamond_chestplate'})
    event.remove({id: 'minecraft:diamond_helmet'})
    event.remove({id: 'botania:manasteel_boots'})
    event.remove({id: 'botania:manasteel_leggings'})
    event.remove({id: 'botania:manasteel_chestplate'})
    event.remove({id: 'botania:manasteel_helmet'})
    event.remove({id: 'botania:elementium_boots'})
    event.remove({id: 'botania:elementium_leggings'})
    event.remove({id: 'botania:elementium_chestplate'})
    event.remove({id: 'botania:elementium_helmet'})
    event.remove({id: 'botania:terrasteel_boots'})
    event.remove({id: 'botania:terrasteel_leggings'})
    event.remove({id: 'botania:terrasteel_chestplate'})
    event.remove({id: 'botania:terrasteel_helmet'})
    event.remove({id: 'mythicbotany:alfsteel_boots'})
    event.remove({id: 'mythicbotany:alfsteel_leggings'})
    event.remove({id: 'mythicbotany:alfsteel_chestplate'})
    event.remove({id: 'mythicbotany:alfsteel_helmet'})
    event.remove({id: 'projecte:dm_boots'})
    event.remove({id: 'projecte:dm_leggings'})
    event.remove({id: 'projecte:dm_chestplate'})
    event.remove({id: 'projecte:dm_helmet'})
})

ServerEvents.recipes(event => {
    //Helmets
    function helmet(currentMat, previousItem, result, id){
        event.shaped(result,
            ['   ','111','121'], {
            1: currentMat, 
            2: previousItem
        })
    }
    //Leather Helmet
    event.shaped('minecraft:leather_helmet',
        ['   ','111','1 1'], {
        1: 'minecraft:leather'
    }).id('impostor:leather_helmet')

    //Quantum Armor
    event.replaceInput({mod: 'advanced_ae'}, 'minecraft:netherite_helmet', 'projecte:rm_helmet')

    //MekaSuit
    event.replaceInput({mod: 'mekanism'}, 'minecraft:netherite_helmet', 'advanced_ae:quantum_helmet')

    //Gem Armor
    event.replaceInput({mod: 'projecte'}, 'projecte:rm_helmet', 'mekanism:mekasuit_helmet')

    helmet('minecraft:iron_nugget', 'minecraft:leather_helmet', 'minecraft:chainmail_helmet', 'chainmail_helmet')
    helmet('minecraft:iron_ingot', 'minecraft:chainmail_helmet', 'minecraft:iron_helmet', 'iron_helmet')
    helmet('minecraft:gold_ingot', 'minecraft:iron_helmet', 'minecraft:golden_helmet', 'golden_helmet')
    helmet('minecraft:diamond', 'minecraft:golden_helmet', 'minecraft:diamond_helmet', 'diamond_helmet')
    helmet('#forge:ingots/manasteel', 'allthemodium:vibranium_helmet', 'botania:manasteel_helmet', 'manasteel_helmet')
    helmet('#forge:ingots/elementium', 'botania:manasteel_helmet', 'botania:elementium_helmet', 'elementium_helmet')
    helmet('#forge:ingots/terrasteel', 'botania:elementium_helmet', 'botania:terrasteel_helmet', 'terrasteel_helmet')
    helmet('#forge:ingots/alfsteel', 'botania:terrasteel_helmet', 'mythicbotany:alfsteel_helmet', 'alfsteel_helmet')
    helmet('projecte:dark_matter', 'mythicbotany:alfsteel_helmet', 'projecte:dm_helmet', 'dm_helmet')

    //Chestplates
    function chestplate(currentMat, previousItem, result, id){
        event.shaped(result,
            ['121','111','111'], {
            1: currentMat, 
            2: previousItem
        })
        }
        //Leather Chestplate
        event.shaped('minecraft:leather_chestplate',
            ['1 1','111','111'], {
            1: 'minecraft:leather'
        }).id('impostor:leather_chestplate')

    //Quantum Armor
    event.replaceInput({mod: 'advanced_ae'}, 'minecraft:netherite_chestplate', 'projecte:rm_chestplate')

    //MekaSuit
    event.replaceInput({mod: 'mekanism'}, 'minecraft:netherite_chestplate', 'advanced_ae:quantum_chestplate')

    //Gem Armor
    event.replaceInput({mod: 'projecte'}, 'projecte:rm_chestplate', 'mekanism:mekasuit_bodyarmor')
    
    chestplate('minecraft:iron_nugget', 'minecraft:leather_chestplate', 'minecraft:chainmail_chestplate', 'chainmail_chestplate')
    chestplate('minecraft:iron_ingot', 'minecraft:chainmail_chestplate', 'minecraft:iron_chestplate', 'iron_chestplate')
    chestplate('minecraft:gold_ingot', 'minecraft:iron_chestplate', 'minecraft:golden_chestplate', 'golden_chestplate')
    chestplate('minecraft:diamond', 'minecraft:golden_chestplate', 'minecraft:diamond_chestplate', 'diamond_chestplate')
    chestplate('#forge:ingots/manasteel', 'allthemodium:vibranium_chestplate', 'botania:manasteel_chestplate', 'manasteel_chestplate')
    chestplate('#forge:ingots/elementium', 'botania:manasteel_chestplate', 'botania:elementium_chestplate', 'elementium_chestplate')
    chestplate('#forge:ingots/terrasteel', 'botania:elementium_chestplate', 'botania:terrasteel_chestplate', 'terrasteel_chestplate')
    chestplate('#forge:ingots/alfsteel', 'botania:terrasteel_chestplate', 'mythicbotany:alfsteel_chestplate', 'alfsteel_chestplate')
    chestplate('projecte:dark_matter', 'mythicbotany:alfsteel_chestplate', 'projecte:dm_chestplate', 'dm_chestplate')

    //Leggings
    function leggings(currentMat, previousItem, result, id){
        event.shaped(result,
            ['111','121','1 1'], {
            1: currentMat, 
            2: previousItem
        })
        }
        //Leather Leggings
        event.shaped('minecraft:leather_leggings',
            ['111','1 1','1 1'], {
            1: 'minecraft:leather'
        }).id('impostor:leather_leggings')

    //Quantum Armor
    event.replaceInput({mod: 'advanced_ae'}, 'minecraft:netherite_leggings', 'projecte:rm_leggings')

    //MekaSuit
    event.replaceInput({mod: 'mekanism'}, 'minecraft:netherite_leggings', 'advanced_ae:quantum_leggings')

    //Gem Armor
    event.replaceInput({mod: 'projecte'}, 'projecte:rm_leggings', 'mekanism:mekasuit_pants')
    
    leggings('minecraft:iron_nugget', 'minecraft:leather_leggings', 'minecraft:chainmail_leggings', 'chainmail_leggings')
    leggings('minecraft:iron_ingot', 'minecraft:chainmail_leggings', 'minecraft:iron_leggings', 'iron_leggings')
    leggings('minecraft:gold_ingot', 'minecraft:iron_leggings', 'minecraft:golden_leggings', 'golden_leggings')
    leggings('minecraft:diamond', 'minecraft:golden_leggings', 'minecraft:diamond_leggings', 'diamond_leggings')
    leggings('#forge:ingots/manasteel', 'allthemodium:vibranium_leggings', 'botania:manasteel_leggings', 'manasteel_leggings')
    leggings('#forge:ingots/elementium', 'botania:manasteel_leggings', 'botania:elementium_leggings', 'elementium_leggings')
    leggings('#forge:ingots/terrasteel', 'botania:elementium_leggings', 'botania:terrasteel_leggings', 'terrasteel_leggings')
    leggings('#forge:ingots/alfsteel', 'botania:terrasteel_leggings', 'mythicbotany:alfsteel_leggings', 'alfsteel_leggings')
    leggings('projecte:dark_matter', 'mythicbotany:alfsteel_leggings', 'projecte:dm_leggings', 'dm_leggings')

    //Boots
    function boots(currentMat, previousItem, result, id){
        event.shaped(result,
            ['   ','121','1 1'], {
            1: currentMat, 
            2: previousItem
        })
        }

        //Leather Boots
        event.shaped('minecraft:leather_boots',
            ['   ','1 1','1 1'], {
            1: 'minecraft:leather'
        }).id('impostor:leather_boots')

    //Quantum Armor
    event.replaceInput({mod: 'advanced_ae'}, 'minecraft:netherite_boots', 'projecte:rm_boots')

    //MekaSuit
    event.replaceInput({mod: 'mekanism'}, 'minecraft:netherite_boots', 'advanced_ae:quantum_boots')

    //Gem Armor
    event.replaceInput({mod: 'projecte'}, 'projecte:rm_boots', 'mekanism:mekasuit_boots')
    
    boots('minecraft:iron_nugget', 'minecraft:leather_boots', 'minecraft:chainmail_boots', 'chainmail_boots')
    boots('minecraft:iron_ingot', 'minecraft:chainmail_boots', 'minecraft:iron_boots', 'iron_boots')
    boots('minecraft:gold_ingot', 'minecraft:iron_boots', 'minecraft:golden_boots', 'golden_boots')
    boots('minecraft:diamond', 'minecraft:golden_boots', 'minecraft:diamond_boots', 'diamond_boots')
    boots('#forge:ingots/manasteel', 'allthemodium:vibranium_boots', 'botania:manasteel_boots', 'manasteel_boots')
    boots('#forge:ingots/elementium', 'botania:manasteel_boots', 'botania:elementium_boots', 'elementium_boots')
    boots('#forge:ingots/terrasteel', 'botania:elementium_boots', 'botania:terrasteel_boots', 'terrasteel_boots')
    boots('#forge:ingots/alfsteel', 'botania:terrasteel_boots', 'mythicbotany:alfsteel_boots', 'alfsteel_boots')
    boots('projecte:dark_matter', 'mythicbotany:alfsteel_boots', 'projecte:dm_boots', 'dm_boots')
})