onEvent('recipes', (event) => {
    const id_prefix = 'immersiveengineering:kubejs/arc_furnace';
    const BASE_TIME = 100;
    const BASE_ENERGY = 51200;
    
    let recipes = [
        {
            input: Ingredient.of('2x emendatusenigmatica:cast_iron_ingot'),
            secondaries: ['#forge:dusts/coke'],
            outputs: ['2x emendatusenigmatica:steel_ingot'],
            factor: 2,
            id: 'steel_ingot'
        },
        {
            input: Ingredient.of('4x occultism:otherstone'),
            secondaries: ['#forge:dusts/coke'],
            outputs: ['4x occultism:burnt_otherstone'],
            factor: 2,
            id: 'burnt_otherstone'
        },
        {
            input: Ingredient.of('minecraft:iron_ingot'),
            secondaries: ['emendatusenigmatica:lead_ingot'],
            outputs: ['2x eidolon:pewter_ingot'],
            id: 'pewter_ingot'
        },
        {
            input: Ingredient.of('3x emendatusenigmatica:copper_ingot'),
            secondaries: ['#forge:sand'],
            outputs: ['3x tconstruct:tinkers_bronze_ingot'],
            id: 'tinkers_bronze_ingot'
        },
        {
            input: Ingredient.of('minecraft:iron_ingot'),
            secondaries: ['tconstruct:blood_slime_ball', 'minecraft:clay_ball'],
            outputs: ['2x tconstruct:pig_iron_ingot'],
            id: 'pig_iron_ingot'
        },
        {
            input: Ingredient.of('minecraft:iron_ingot'),
            secondaries: ['tconstruct:sky_slime_ball', 'tconstruct:seared_brick'],
            outputs: ['2x tconstruct:slimesteel_ingot'],
            id: 'slimesteel_ingot'
        },
        {
            input: Ingredient.of('emendatusenigmatica:cobalt_ingot'),
            secondaries: ['minecraft:gold_ingot', 'minecraft:magma_cream'],
            outputs: ['2x tconstruct:queens_slime_ingot'],
            id: 'queens_slime_ingot'
        },
        {
            input: Ingredient.of('emendatusenigmatica:cobalt_ingot'),
            secondaries: ['2x emendatusenigmatica:copper_ingot', '4x minecraft:quartz'],
            outputs: ['2x tconstruct:hepatizon_ingot'],
            id: 'hepatizon_ingot'
        },
        {
            input: Ingredient.of('4x minecraft:iron_ingot'),
            secondaries: ['3x minecraft:coal'],
            outputs: ['4x emendatusenigmatica:cast_iron_ingot'],
            id: 'cast_iron_ingot'
        },
        {
            input: Ingredient.of('emendatusenigmatica:silver_ingot'),
            secondaries: ['3x emendatusenigmatica:tin_ingot', '2x minecraft:glowstone_dust'],
            outputs: ['4x emendatusenigmatica:lumium_ingot'],
            factor: 1.5,
            id: 'lumium_ingot'
        },
        {
            input: Ingredient.of('emendatusenigmatica:diamond_dust'),
            secondaries: ['3x emendatusenigmatica:lead_ingot', '2x emendatusenigmatica:ender_dust'],
            outputs: ['4x emendatusenigmatica:enderium_ingot'],
            factor: 1.5,
            id: 'enderium_ingot'
        },
        {
            input: Ingredient.of('emendatusenigmatica:silver_ingot'),
            secondaries: ['3x emendatusenigmatica:copper_ingot', '4x minecraft:redstone'],
            outputs: ['4x emendatusenigmatica:signalum_ingot'],
            factor: 1.5,
            id: 'signalum_ingot'
        },
        {
            input: Ingredient.of('naturesaura:tainted_gold'),
            secondaries: ['jaept:holy_ingot'],
            outputs: ['2x emendatusenigmatica:electrum_ingot'],
            factor: 1.5,
            id: 'electrum_ingot'
        },
        {
            input: Ingredient.of('4x minecraft:netherite_scrap'),
            secondaries: ['atum:nebu_ingot'],
            outputs: ['minecraft:netherite_ingot'],
            factor: 2,
            id: 'netherite_ingot'
        },
        {
            input: Ingredient.of('4x emendatusenigmatica:steel_ingot'),
            secondaries: ['alexsmobs:soul_heart'],
            outputs: ['4x tconstruct:soulsteel_ingot'],
            id: 'soulsteel_ingot'
        },
        {
            input: Ingredient.of('2x immersiveengineering:dust_hop_graphite'),
            secondaries: ['occultism:iesnium_ingot'],
            outputs: ['2x immersiveengineering:ingot_hop_graphite'],
            factor: 2,
            id: 'graphite_ingot'
        },
        {
            input: Ingredient.of('4x astralsorcery:stardust'),
            secondaries: ['#forge:ingots/titanium', '#forge:ingots/sky'],
            outputs: ['2x astralsorcery:starmetal_ingot'],
            factor: 4,
            id: 'starmetal_ingot'
        },
        {
            input: Ingredient.of('3x #forge:ingots/invar'),
            secondaries: ['#forge:ingots/chromium'],
            outputs: [Item.of('2x jaept:stainless_steel_ingot')],
            factor: 2,
            id: 'stainless_steel_ingot'
        },
        {
            input: Ingredient.of('2x appliedenergistics2:purified_nether_quartz_crystal'),
            secondaries: ['tconstruct:rose_gold_ingot', '2x emendatusenigmatica:cinnabar_dust'],
            outputs: ['2x create:rose_quartz'],
            id: 'rose_quartz'
        },
        {
            input: '2x create:polished_rose_quartz',
            secondaries: ['emendatusenigmatica:obsidian_dust', 'eidolon:ender_calx', '#forge:dusts/holy', 'emendatusenigmatica:signalum_dust'],
            outputs: ['2x create:chromatic_compound'],
            id: 'chromatic_compound'
        },
        /*
        {
            input: Ingredient.of('jaept:holy_ingot'),
            secondaries: ['astralsorcery:illumination_powder'],
            outputs: ['create:refined_radiance'],
            factor: 2,
            id: 'refined_radiance'
        },
        {
            input: Ingredient.of('emendatusenigmatica:steel_ingot'),
            secondaries: ['astralsorcery:nocturnal_powder'],
            outputs: ['create:shadow_steel'],
            factor: 2,
            id: 'shadow_steel'
        },
        */
        {
            input: Ingredient.of('#atum:relic/silver'),
            secondaries: [],
            outputs: ['5x emendatusenigmatica:silver_nugget'],
            id: 'silver_relic_recycle'
        },
        {
            input: Ingredient.of('#atum:relic/gold'),
            secondaries: [],
            outputs: ['5x atum:nebu_drop'],
            id: 'gold_relic_recycle'
        },
        {
            input: Ingredient.of('#atum:relic/sapphire'),
            secondaries: [],
            outputs: ['5x atum:nebu_drop', 'emendatusenigmatica:sapphire_gem'],
            id: 'sapphire_relic_recycle'
        },
        {
            input: Ingredient.of('#atum:relic/ruby'),
            secondaries: [],
            outputs: ['5x atum:nebu_drop', 'emendatusenigmatica:ruby_gem'],
            id: 'ruby_relic_recycle'
        },
        {
            input: Ingredient.of('#atum:relic/emerald'),
            secondaries: [],
            outputs: ['5x atum:nebu_drop', 'minecraft:emerald'],
            id: 'emerald_relic_recycle'
        },
        {
            input: Ingredient.of('#atum:relic/diamond'),
            secondaries: [],
            outputs: ['5x atum:nebu_drop', 'minecraft:diamond'],
            id: 'diamond_relic_recycle'
        },
        {
            input: Ingredient.of('atum:golden_date'),
            secondaries: [Item.of('4x atum:nebu_block')],
            outputs: ['atum:golden_date_enchanted'],
            id: 'golden_date_enchanted'
        },
        {
            input: Ingredient.of('immersivepetroleum:asphalt'),
            secondaries: ['occultism:burnt_otherstone', 'quark:biotite'],
            outputs: ['compactmachines:wall'],
            id: 'compact_wall'
        },
        {
            input: Ingredient.of('kubejs:linen_leather'),
            secondaries: ['minecraft:prismarine_shard', 'minecraft:prismarine_crystals'],
            outputs: ['thermal:diving_fabric'],
            id: 'diving_fabric'
        },
        {
            input: Ingredient.of('thermal:rubber'),
            secondaries: [Item.of('2x emendatusenigmatica:sulfur_dust')],
            outputs: ['thermal:cured_rubber'],
            id: 'cured_rubber'
        },
        {
            input: Ingredient.of('botania:livingwood'),
            secondaries: ['atum:osiris_godshard', 'astralsorcery:illumination_powder'],
            outputs: ['botania:glimmering_livingwood'],
            factor: 4,
            id: 'glimmering_livingwood'
        },
        {
            input: Ingredient.of('#forge:rods/hop_graphite'),
            secondaries: [Item.of('2x powah:dielectric_paste')],
            outputs: ['powah:dielectric_rod'],
            id: 'dielectric_rod'
        },
        {
            input: 'kubejs:dielectric_frame',
            secondaries: [Item.of('tconstruct:large_plate', '{Material:"tconstruct:steel"}'),Item.of('2x botania:quartz_red')],
            outputs: ['rftoolsbase:machine_base'],
            factor: 4,
            id: 'machine_base'
        },
        {
            input: Ingredient.of('4x industrialforegoing:dryrubber'),
            secondaries: ['#forge:dusts/vanadium'],
            outputs: [Item.of('4x industrialforegoing:plastic')],
            factor: 2,
            energy: 2,
            id: 'plastic'
        },
        {
            input: Ingredient.of('#forge:ingots/titanium'),
            secondaries: [Item.of('2x industrialforegoing:pink_slime'), 'botania:tiny_potato'],
            outputs: ['industrialforegoing:pink_slime_ingot'],
            factor: 2,
            energy: 2,
            id: 'pink_slime_ingot'
        },
        {
            input: Ingredient.of('byg:quartzite_sand'),
            secondaries: ['emendatusenigmatica:certus_quartz_dust'],
            outputs: ['appliedenergistics2:quartz_glass'],
            energy: 2,
            id: 'quartz_glass'
        },
        {
            input: Ingredient.of('botania:manasteel_ingot'),
            secondaries: [Item.of('2x emendatusenigmatica:dimensional_dust'), 'bloodmagic:dungeon_metal'],
            outputs: ['jaept:dimension_ingot'],
            factor: 2,
            energy: 4,
            id: 'dimension_ingot'
        },
        {
            input: Ingredient.of('2x modularrouters:blank_upgrade'),
            secondaries: ['powah:battery_starter'],
            outputs: [Item.of('2x modularrouters:energy_upgrade')],
            factor: 2,
            energy: 2,
            id: 'energy_upgrade_2'
        },
        {
            input: Ingredient.of('4x modularrouters:blank_upgrade'),
            secondaries: ['powah:battery_basic'],
            outputs: [Item.of('4x modularrouters:energy_upgrade')],
            factor: 2,
            energy: 4,
            id: 'energy_upgrade_4'
        },
        {
            input: Ingredient.of('3x appliedenergistics2:1k_cell_component'),
            secondaries: ['#forge:gears/dimension', 'appliedenergistics2:calculation_processor'],
            outputs: ['appliedenergistics2:4k_cell_component'],
            factor: 4,
            energy: 4,
            id: '4k_cell_component'
        },
        {
            input: Ingredient.of('3x appliedenergistics2:1k_fluid_cell_component'),
            secondaries: ['#forge:gears/dimension', 'appliedenergistics2:calculation_processor'],
            outputs: ['appliedenergistics2:4k_fluid_cell_component'],
            factor: 4,
            energy: 4,
            id: '4k_fluid_cell_component'
        },
        {
            input: Ingredient.of('powah:ender_core'),
            secondaries: [Item.of('2x appliedenergistics2:purified_fluix_crystal'), Item.of('2x botania:quartz_lavender')],
            outputs: ['appliedenergistics2:fluix_pearl'],
            factor: 2,
            energy: 4,
            id: 'fluix_pearl'
        },
        {
            input: Ingredient.of('6x botania:white_pavement'),
            secondaries: [
                Item.of('24x appliedenergistics2:yellow_paint_ball'), 
                Ingredient.customNBT('rftoolspower:blazing_rod', (tag) => {
                    return (tag.infSteps == 0 && tag.time <= 0);
                })
            ],
            outputs: ['6x botania:yellow_pavement'],
            factor: 4,
            energy: 2,
            id: 'yellow_pavement'
        },
        {
            input: Ingredient.of('6x botania:white_pavement'),
            secondaries: [Item.of('24x appliedenergistics2:blue_paint_ball'), 'twilightforest:alpha_fur'],
            outputs: ['6x botania:blue_pavement'],
            factor: 4,
            energy: 2,
            id: 'blue_pavement'
        },
        {
            input: Ingredient.of('6x botania:white_pavement'),
            secondaries: [Item.of('24x appliedenergistics2:black_paint_ball'), Item.of('botania:brew_vial', '{brewKey:"botania:overload"}')],
            outputs: ['6x botania:black_pavement'],
            factor: 4,
            energy: 2,
            id: 'black_pavement'
        }
    ];

    marble_types.forEach(type => {
        recipes.push({
            input: Ingredient.of(`4x astralsorcery:marble_${type}`),
            secondaries: ['#forge:dusts/coke'],
            outputs: [`4x astralsorcery:black_marble_${type}`],
            factor: 2,
            id: `black_marble_${type}`
        });
    });

    recipes.forEach((recipe) => {

        if(!recipe.factor) {
            recipe.factor = 1;
        }

        if(!recipe.energy) {
            recipe.energy = 1;
        }

        const re = event.recipes.immersiveengineering
            .arc_furnace(recipe.outputs, recipe.input, recipe.secondaries)
            .time(recipe.factor*BASE_TIME)
            .energy(recipe.factor*recipe.energy*BASE_ENERGY)
            .id(`${id_prefix}/${recipe.id}`);
    });

});
