onEvent('recipes', event => {

    const extras = ['soulsteel'];

    for(let i = 0; i < metals.length + gems.length; i++) {

        var material, type;
        if(i<metals.length) {
            material = metals[i];
            type = 'ingot';
        }else{
            material = gems[i-metals.length];
            type = 'gem';
        }

        var basic = itemOf(`#forge:${type}s/${material}`);
        var nugget = itemOf(`#forge:nuggets/${material}`);
        var block = itemOf(`#forge:storage_blocks/${material}`);

        if(nugget != null && (extras.includes(material) || nugget.split(':')[0] == 'jaopca')) {
            event.shapeless(
                Item.of(nugget,9), [ basic ]
            ).id(`emendatusenigmatica:nugget_from_${type}/${material}`);
            event.shapeless(
                basic, [ nugget,nugget,nugget,nugget,nugget,nugget,nugget,nugget,nugget ]
            ).id(`emendatusenigmatica:${type}_from_nugget/${material}`);
        }

        if(block != null && (extras.includes(material) || block.split(':')[0] == 'jaopca')) {
            event.shapeless(
                Item.of(basic,9), [ block ]
            ).id(`emendatusenigmatica:${type}_from_block/${material}`);
            event.shapeless(
                block, [ basic,basic,basic,basic,basic,basic,basic,basic,basic ]
            ).id(`emendatusenigmatica:block_from_${type}/${material}`);
        }

    }

})