ServerEvents.recipes(event => {
    const id_prefix = 'infinity_nexus_mod:pneumaticcraft/assembly/';
    const recipes = [
        {
            input: 'pneumaticcraft:plastic',
            input_count: 4,
            output: { item: 'infinity_nexus_mod:industrial_screw', count: 1 },
            program: 'laser',
            id: `${id_prefix}industrial_screw`
        },
        {
            input: 'pneumaticcraft:plastic_brick_red',
            input_count: 1,
            output: { item: 'infinity_nexus_mod:industrial_wire', count: 1 },
            program: 'laser',
            id: `${id_prefix}industrial_wire`
        },
        {
            input: 'pneumaticcraft:plastic_brick_yellow',
            input_count: 2,
            output: { item: 'infinity_nexus_mod:industrial_rod', count: 1 },
            program: 'laser',
            id: `${id_prefix}industrial_rod`
        },
        {
            input: 'pneumaticcraft:plastic_brick_orange',
            input_count: 1,
            output: { item: 'infinity_nexus_mod:industrial_sheet', count: 1 },
            program: 'laser',
            id: `${id_prefix}industrial_sheet`
        },

    ];


    recipes.forEach((recipe) => {
        let constructed_input = recipe.input.charAt(0) == '#' ? { tag: recipe.input.slice(1) } : { item: recipe.input };
        if (recipe.input_count) {
            constructed_input.type = 'pneumaticcraft:stacked_item';
            constructed_input.count = recipe.input_count;
        }

        let re = event.custom({
            type: `pneumaticcraft:assembly_${recipe.program}`,
            input: constructed_input,
            result: recipe.output,
            program: recipe.program
        });
        if (recipe.id) {
            re.id(recipe.id);
        }
    });
});
