// priority: -9999

ServerEvents.recipes(event => {
    return;
    console.log("reporting uncraftables");
    global.uncraftables.uncraftable.forEach(uncraftable => {
        console.log(`===== ${uncraftable}`);
        event.forEachRecipe({output: uncraftable}, recipe => {
            console.log(recipe.json.toString());
        });
        console.log('=== inputs');
        event.forEachRecipe({input: uncraftable}, recipe => {
            console.log(recipe.json.get('result').toString());
        });
    });

    let _ = ['build', 'agricultural', 'intelligent', 'energetic'].forEach(element => {
        let __ = ['basic', 'improved', 'radiant'].forEach(tier => {
            console.log(`===== ${tier} ${element}:`);
            event.forEachRecipe({input: `kubejs:grist_${element}_${tier}`}, r => {
                if (r.json.get('result') == undefined) {
                    console.log(r.json.toString());
                } else {
                    console.log(r.json.get('result').toString());
                }
            });
        }); 
    });
    /*event.forEachRecipe({}, recipe => {
        global.uncraftables.uncraftable.forEach(uncrafableItem => {
            let asJson = recipe.json;
            let foundResults = [];
            console.log(recipe.outputValues());
            console.log(asJson.toString());
            console.log(recipe.getType());
            if (recipe.getType() == 'farmersdelight:cutting') {
                //foundResults = [asJson.get('result').get('item')];
                asJson.get('result').forEach(result => {
                    foundResults.push(result.get('item'));
                });
            } else {
                foundResults = [asJson.get('result').get('item')];
            }
            if (foundResults == []) {
                console.log(`unknown result in ${asJson.toString()}`);
            } else {
                foundResults.forEach(output => {
                    console.log(output);
                    if (output == uncrafableItem) {
                        console.log('found uncraftable item:', recipe.json.toString());
                    }
                });
            }
        });
    });*/
});