onEvent('recipes', (event) => {
    const id_prefix = 'immersiveengineering:kubejs/metal_press';

    const recipes = [
        // {
        //     output: '#forge:rods/hop_graphite',
        //     input: 'immersiveengineering:ingot_hop_graphite',
        //     mold: 'immersiveengineering:mold_rod',
        //     id: 'hop_graphite_rod'
        // }
    ];

    recipes.forEach((recipe) => {
        event.recipes.immersiveengineering.metal_press(recipe.output, recipe.input, recipe.mold).id(recipe.id);
    });

    metals.concat(gems).forEach((metal) => {

        const ingot = itemOf(`#forge:ingots/${metal}`);
        const gem = itemOf(`#forge:gems/${metal}`);
        const gear = itemOf(`#forge:gears/${metal}`);
        const plate = itemOf(`#forge:plates/${metal}`);
        const rod = itemOf(`#forge:rods/${metal}`);
        const wire = itemOf(`#forge:wires/${metal}`);

        let base = ingot!=null? ingot:gem;
        if(gear!=null){
            event.recipes.immersiveengineering.metal_press(
                gear, Item.of(base,4), 'immersiveengineering:mold_gear'
            ).id(`${id_prefix}/${metal}_gear`);
        }
        if(plate!=null){
            event.recipes.immersiveengineering.metal_press(
                Item.of(plate,4), Item.of(base,4), 'immersiveengineering:mold_plate'
            ).id(`${id_prefix}/${metal}_plate`);
        }
        if(rod!=null){
            event.recipes.immersiveengineering.metal_press(
                Item.of(rod,8), Item.of(base,4), 'immersiveengineering:mold_rod'
            ).id(`${id_prefix}/${metal}_rod`);
        }
        if(wire!=null){
            event.recipes.immersiveengineering.metal_press(
                Item.of(wire,8), Item.of(base,4), 'immersiveengineering:mold_wire'
            ).id(`${id_prefix}/${metal}_wire`);
        }
        
    });

    tconstructs.forEach((material) => {

        const large_plate = Item.of('tconstruct:large_plate', `{Material:"${material.id}"}`);
        const ingredients = Ingredient.of(material.base, 4);
        const id = material.id.substring(material.id.indexOf(':')+1);

        event.recipes.immersiveengineering.metal_press(
            large_plate, ingredients, 'kubejs:mold_large_plate'
        ).id(`${id_prefix}/${id}_large_plate`);

    })


});