//Priority: 100
/**
  
  █▀▄▀█ █▀█ █▄░█ █░█ █▀▄▀█ █▀▀ █▄░█ ▀█▀ ▄▀█ █░░   █▀▀ ▀▄▀ █▀█ █▀▀ █▀█ █ █▀▀ █▄░█ █▀▀ █▀▀
  █░▀░█ █▄█ █░▀█ █▄█ █░▀░█ ██▄ █░▀█ ░█░ █▀█ █▄▄   ██▄ █░█ █▀▀ ██▄ █▀▄ █ ██▄ █░▀█ █▄▄ ██▄

  ☻/  * @file Nature's Aura recipes script
  /▌  * @copyright KnightDexx's Modded Minecraft World | ModernGamingWorld | GeekTechMedia
  /▌  * Mostly made by @Cyn-SolveroftheAbsoluteGremlins on Discord
  /\  

*/
ServerEvents.recipes(event => {

    let hammer = '#alltheores:ore_hammers'
    //event.remove({mod: 'alltheores', item: hammer})
    const dust = [
        { mat: 'nickel', mod: 'alltheores' },
        { mat: 'tin', mod: 'alltheores' },
        { mat: 'platinum', mod: 'alltheores' },
        { mat: 'lead', mod: 'alltheores' },
        { mat: 'osmium', mod: 'alltheores' },
        { mat: 'iridium', mod: 'alltheores' },
        { mat: 'silver', mod: 'alltheores' },
        { mat: 'aluminum', mod: 'alltheores' },
        { mat: 'zinc', mod: 'alltheores' },
        { mat: 'uranium', mod: 'alltheores' },
        { mat: 'gold', mod: 'minecraft' },
        { mat: 'iron', mod: 'minecraft' },
        { mat: 'copper', mod: 'minecraft' },
        { mat: 'allthemodium', mod: 'allthemodium' },
        { mat: 'vibranium', mod: 'allthemodium' },
        { mat: 'unobtainium', mod: 'allthemodium' },
        { mat: 'desh', mod: 'moremekanismprocessing', add: 'ad_astra' },
        { mat: 'ostrum', mod: 'moremekanismprocessing', add: 'ad_astra' },
        { mat: 'calorite', mod: 'moremekanismprocessing', add: 'ad_astra' }
    ]
    const rodPlate = [
        'electrum',
        'platinum',
        'gold',
        'lumium',
        'silver',
        'osmium',
        'constantan',
        'uranium',
        'lead',
        'diamond',
        'brass',
        'invar',
        'enderium',
        'iridium',
        'zinc',
        'iron',
        'nickel',
        'signalum',
        'copper',
        'tin',
        'aluminum',
        'steel',
        'bronze',
        'ostrum',
        'desh',
        'calorite'
    ]
    const gem = [
        'peridot',
        'sapphire',
        'ruby'
    ]
    const gemDust = [
        'peridot',
        'ruby',
        'sapphire',
        'diamond',
        'netherite'
    ]
    dust.forEach(d => {
        let raw = 'unused'
        let dust = 'unused'
        if (d.mod != 'moremekanismprocessing' && d.mod != 'allthemodium') {
            raw = `${d.mod}:raw_${d.mat}`
            dust = `alltheores:${d.mat}_dust`
            event.remove({ input: raw, input: hammer, output: dust })
        } else if (d.mod == 'allthemodium') {
            raw = `${d.mod}:raw_${d.mat}`
            dust = `allthemodium:${d.mat}_dust`
            event.remove({ input: raw, input: hammer, output: dust })
        } else if (d.mod == 'moremekanismprocessing') {
            raw = `${d.add}:raw_${d.mat}`
            dust = `${d.mod}:dust_${d.mat}`
        } else {
            console.error(`Something went wrong! Please fix ${d.mat}, ${d.add}`)
        }
        event.shapeless(
            Item.of(dust, 2),
            [
                hammer,
                raw
            ]
        ).id(`kubejs:${d.mat}_dust_from_hammer_crushing_manual_only`)
    })
    rodPlate.forEach((ing) => {
        if (ing == 'diamond') {
            event.shaped(
                Item.of(`alltheores:${ing}_rod`),
                [
                    "  a",
                    "ha ",
                    "   "
                ],
                {
                    a: `minecraft:${ing}`,
                    h: hammer
                }
            ).id(`kubejs:${ing}_rod_manual_only`)
            event.remove({ input: hammer, output: `alltheores:${ing}_plate` })
            event.shaped(
                Item.of(`alltheores:${ing}_plate`),
                [
                    "ha ",
                    "a  ",
                    "   "
                ],
                {
                    a: `minecraft:${ing}`,
                    h: hammer
                }
            ).id(`kubejs:${ing}_plate_manual_only`)
            event.remove({ input: hammer, output: `alltheores:${ing}_rod` })
        } else if (ing == 'desh' || ing == 'calorite' || ing == 'ostrum') {
            event.shaped(
                Item.of(`ad_astra:${ing}_plate`),
                [
                    "ha ",
                    "a  ",
                    "   "
                ],
                {
                    a: `#forge:ingots/${ing}`,
                    h: hammer
                }
            ).id(`kubejs:${ing}_plate_manual_only`)
            event.remove({ input: hammer, output: `ad_astra:${ing}_plate` })
        } else {
            event.shaped(
                Item.of(`alltheores:${ing}_rod`),
                [
                    "  a",
                    "ha ",
                    "   "
                ],
                {
                    a: `#forge:ingots/${ing}`,
                    h: hammer
                }
            ).id(`kubejs:${ing}_rod_manual_only`)
            event.remove({ input: hammer, output: `alltheores:${ing}_plate` })
            event.shaped(
                Item.of(`alltheores:${ing}_plate`),
                [
                    "ha ",
                    "a  ",
                    "   "
                ],
                {
                    a: `#forge:ingots/${ing}`,
                    h: hammer
                }
            ).id(`kubejs:${ing}_plate_manual_only`)
            event.remove({ input: hammer, output: `alltheores:${ing}_rod` })
        }
    })
    gem.forEach((ge) => {
        event.shapeless(
            Item.of(`alltheores:${ge}`, 3),
            [
                hammer,
                '#forge:ores/' + ge
            ]
        ).id(`kubejs:${ge}_from_hammer_crushing_manual_only`)
        event.remove({ input: `#forge:ores/${ge}`, input: hammer, output: `alltheores:${ge}` })
    })
    gemDust.forEach((gemDus) => {
        if (gemDus == 'netherite') {
            event.shapeless(
                Item.of(`thermal:${gemDus}_dust`),
                [
                    hammer,
                    '#forge:ingots/' + gemDus
                ]
            ).id(`kubejs:${gemDus}_dust_from_hammer_crushing_manual_only`)
            event.remove({ input: `#forge:ingots/${gemDus}`, input: hammer, output: `alltheores:${gemDus}_dust` })
        } else {
            event.shapeless(
                Item.of(`alltheores:${gemDus}_dust`),
                [
                    hammer,
                    '#forge:gems/' + gemDus
                ]
            ).id(`kubejs:${gemDus}_dust_from_hammer_crushing_manual_only`)
            event.remove({ input: `#forge:gems/${gemDus}`, input: hammer, output: `alltheores:${gemDus}_dust` })
        }
    })
    event.shapeless(
        Item.of('allthemodium:ancient_chiseled_stone_bricks'),
        [
            hammer,
            'allthemodium:ancient_cracked_stone_bricks'
        ]
    ).id('kubejs:ancient_chiseled_stone_bricks_from_crushing_manual_only')
    event.shapeless(
        Item.of('allthemodium:ancient_cracked_stone_bricks'),
        [
            hammer,
            'allthemodium:ancient_stone_bricks'
        ]
    ).id('kubejs:ancient_cracked_stone_bricks_from_crushing_manual_only')
    event.shaped(
        Item.of('alltheores:enderium_dust', 4),
        [
            "lll",
            "pee",
            "h  "
        ],
        {
            l: '#forge:dusts/lead',
            h: hammer,
            e: 'minecraft:ender_pearl',
            p: '#forge:dusts/platinum'
        }
    ).id(`kubejs:enderium_dust_from_alloy_blending_manual_only`)
    event.shaped(
        Item.of('alltheores:steel_dust'),
        [
            "dcc",
            "cch",
            "   "
        ],
        {
            d: '#forge:dusts/iron',
            h: hammer,
            c: 'minecraft:coal'
        }
    ).id('kubejs:steel_dust_from_alloy_blending_manual_only')
    event.remove({ id: 'alltheores:steel_dust_from_alloy_blending' })
    event.remove({ id: 'alltheores:enderium_dust_from_alloy_blending' })
    event.remove({ id: 'allthemodium:ancient_cracked_stone_bricks_from_crushing' })
    event.remove({ id: 'allthemodium:ancient_chiseled_stone_bricks_from_crushing' })

    event.remove({ id: 'ad_astra:steel_rod' })
    event.remove({ id: 'ad_astra:iron_rod' })
    event.remove({ id: 'buildersaddition:iron_rod' })
})