const metals = [
    `aluminum`,
    `copper`,
    `lead`,
    `nickel`,
    `osmium`,
    `platinum`,
    `silver`,
    `tin`,
    `uranium`,
    `zinc`,
    `enderium`,
    `invar`,
    `signalum`,
    `lumium`,
    `electrum`,
    `steel`,
];

onEvent(`recipes`, event => {
    for(let pos in metals){
        event.replaceOutput({},`#forge:ingots/${metals[pos]}`, `emendatusenigmatica:${metals[pos]}_ingot`) 
        event.replaceOutput({}, `#forge:dusts/${metals[pos]}`, `emendatusenigmatica:${metals[pos]}_dust`)
        event.replaceOutput({},`#forge:plates/${metals[pos]}`,`emendatusenigmatica:${metals[pos]}_plate`)
        event.replaceOutput({},`#forge:gears/${metals[pos]}`,`emendatusenigmatica:${metals[pos]}_gear`)
        event.replaceOutput({},`#forge:nuggets/${metals[pos]}`,`emendatusenigmatica:${metals[pos]}_nugget`)
        event.replaceOutput({},`#forge:rods/${metals[pos]}`,`emendatusenigmatica:${metals[pos]}_rod`) 
        event.replaceOutput({},`#forge:storage_blocks/${metals[pos]}`,`emendatusenigmatica:${metals[pos]}_block`)     
    }
    
});

const metalsmine = [
    `iron`,
    `gold`,    
];

onEvent(`recipes`, event => {
    for(let posmine in metalsmine){ 
        event.replaceOutput({}, `#forge:dusts/${metals[posmine]}`, `emendatusenigmatica:${metals[posmine]}_dust`)
        event.replaceOutput({},`#forge:plates/${metals[posmine]}`,`emendatusenigmatica:${metals[posmine]}_plate`)
        event.replaceOutput({},`#forge:gears/${metals[posmine]}`,`emendatusenigmatica:${metals[posmine]}_gear`)
        event.replaceOutput({},`#forge:nuggets/${metals[posmine]}`,`emendatusenigmatica:${metals[posmine]}_nugget`)
    }
});

const certusemendatus = [
    `gem`,
    `dust`,
    `chunk`,
    `cluster`,
    `clump`,
    `crystal`,
    `dirty_dust`,
    `shard`,
    `crushed`,
    `fragment`,
    `gravel`,
];

onEvent(`recipes`,event=>{
    for(let pos in certusemendatus) {
        event.remove({output: `emendatusenigmatica:certus_quartz_${certusemendatus[pos]}`})
        event.remove({output: `emendatusenigmatica:charged_certus_quartz_${certusemendatus[pos]}`})
    }
});

onEvent('jei.hide.items', event => {
    for(let pos in certusemendatus){
        event.hide(`emendatusenigmatica:certus_quartz_${certusemendatus[pos]}`)
        event.hide(`emendatusenigmatica:charged_certus_quartz_${certusemendatus[pos]}`)
    }
});


