'use strict';
onEvent('recipes', (event) => {
    if (global.isNormalMode) {
        return;
    }
    const id_prefix = 'enigmatica:expert/masterful_machinery/auto_iridescent_altar/';
    const recipes = [
        {
            outputs: [
                {
                    chance: 1.0,
                    data: 'kubejs:observatory_lens'
                },
                {
                    chance: 0.05,
                    data: 'kubejs:observatory_lens'
                }
            ],

            inputs: [
                '8x #forge:ingots/shadow_steel',
                '4x #botania:runes/air',
                '4x astralsorcery:colored_lens_spectral',
                '4x astralsorcery:resonating_gem',
                '4x astralsorcery:illumination_powder',
                '2x astralsorcery:nocturnal_powder',
                '2x #forge:dusts/starmetal',
                'astralsorcery:attuned_celestial_crystal',

                { type: 'masterfulmachinery:energy', perTick: true, data: { amount: 500000 } },
                { type: 'masterfulmachinery:astral_starlight', perTick: true, data: { amount: 50 } }
            ],
            ticks: 200,
            id: `${id_prefix}observatory_lens`
        },
        {
            outputs: [
                {
                    chance: 1.0,
                    data: '3x astralsorcery:colored_lens_fire'
                },
                {
                    chance: 0.1,
                    data: 'astralsorcery:colored_lens_fire'
                }
            ],
            inputs: [
                '4x #forge:dusts/starmetal',
                '4x astralsorcery:resonating_gem',
                '2x quark:orange_rune',
                '2x bloodmagic:smelting_anointment_l',
                'astralsorcery:glass_lens',

                { type: 'masterfulmachinery:energy', perTick: true, data: { amount: 50000 } },
                { type: 'masterfulmachinery:astral_starlight', perTick: true, data: { amount: 50 } }
            ],
            ticks: 100,
            id: `${id_prefix}colored_lens_fire`
        },
        {
            outputs: [
                {
                    chance: 1.0,
                    data: '3x astralsorcery:colored_lens_break'
                },
                {
                    chance: 0.1,
                    data: 'astralsorcery:colored_lens_break'
                }
            ],
            inputs: [
                '4x #forge:dusts/starmetal',
                '4x astralsorcery:resonating_gem',
                '2x quark:yellow_rune',
                '2x bloodmagic:hidden_knowledge_anointment_l',
                'astralsorcery:glass_lens',

                { type: 'masterfulmachinery:energy', perTick: true, data: { amount: 50000 } },
                { type: 'masterfulmachinery:astral_starlight', perTick: true, data: { amount: 50 } }
            ],
            ticks: 100,
            id: `${id_prefix}colored_lens_break`
        },
        {
            outputs: [
                {
                    chance: 1.0,
                    data: '3x astralsorcery:colored_lens_growth'
                },
                {
                    chance: 0.1,
                    data: 'astralsorcery:colored_lens_growth'
                }
            ],
            inputs: [
                '4x #forge:dusts/starmetal',
                '4x naturesaura:gold_powder',
                '2x quark:lime_rune',
                '2x bloodmagic:fortune_anointment_l',
                'astralsorcery:glass_lens',

                { type: 'masterfulmachinery:energy', perTick: true, data: { amount: 50000 } },
                { type: 'masterfulmachinery:astral_starlight', perTick: true, data: { amount: 50 } }
            ],
            ticks: 100,
            id: `${id_prefix}colored_lens_growth`
        },
        {
            outputs: [
                {
                    chance: 1.0,
                    data: '3x astralsorcery:colored_lens_damage'
                },
                {
                    chance: 0.1,
                    data: 'astralsorcery:colored_lens_damage'
                }
            ],
            inputs: [
                '4x #forge:dusts/starmetal',
                '4x astralsorcery:resonating_gem',
                '2x quark:red_rune',
                '2x bloodmagic:melee_anointment_l',
                'astralsorcery:glass_lens',

                { type: 'masterfulmachinery:energy', perTick: true, data: { amount: 50000 } },
                { type: 'masterfulmachinery:astral_starlight', perTick: true, data: { amount: 50 } }
            ],
            ticks: 100,
            id: `${id_prefix}colored_lens_damage`
        },
        {
            outputs: [
                {
                    chance: 1.0,
                    data: '3x astralsorcery:colored_lens_regeneration'
                },
                {
                    chance: 0.1,
                    data: 'astralsorcery:colored_lens_regeneration'
                }
            ],
            inputs: [
                '4x #forge:dusts/starmetal',
                '4x astralsorcery:resonating_gem',
                '2x quark:pink_rune',
                '2x bloodmagic:holy_water_anointment_l',
                'astralsorcery:glass_lens',

                { type: 'masterfulmachinery:energy', perTick: true, data: { amount: 50000 } },
                { type: 'masterfulmachinery:astral_starlight', perTick: true, data: { amount: 50 } }
            ],
            ticks: 100,
            id: `${id_prefix}colored_lens_regeneration`
        },
        {
            outputs: [
                {
                    chance: 1.0,
                    data: '3x astralsorcery:colored_lens_push'
                },
                {
                    chance: 0.1,
                    data: 'astralsorcery:colored_lens_push'
                }
            ],
            inputs: [
                '4x #forge:dusts/starmetal',
                '4x astralsorcery:resonating_gem',
                '2x quark:light_blue_rune',
                '2x bloodmagic:bow_velocity_anointment_l',
                'astralsorcery:glass_lens',

                { type: 'masterfulmachinery:energy', perTick: true, data: { amount: 50000 } },
                { type: 'masterfulmachinery:astral_starlight', perTick: true, data: { amount: 50 } }
            ],
            ticks: 100,
            id: `${id_prefix}colored_lens_push`
        },
        {
            outputs: [
                {
                    chance: 1.0,
                    data: '3x astralsorcery:colored_lens_spectral'
                },
                {
                    chance: 0.1,
                    data: 'astralsorcery:colored_lens_spectral'
                }
            ],
            inputs: [
                '4x atum:ectoplasm',
                '4x astralsorcery:resonating_gem',
                '2x quark:purple_rune',
                '2x bloodmagic:silk_touch_anointment_l',
                'astralsorcery:glass_lens',

                { type: 'masterfulmachinery:energy', perTick: true, data: { amount: 50000 } },
                { type: 'masterfulmachinery:astral_starlight', perTick: true, data: { amount: 50 } }
            ],
            ticks: 100,
            id: `${id_prefix}colored_lens_spectral`
        },
        {
            outputs: [
                {
                    chance: 1.0,
                    data: 'astralsorcery:altar_radiance'
                }
            ],
            inputs: [
                '4x create:shadow_steel_casing',
                '4x redstone_arsenal:flux_gem',
                '4x astralsorcery:resonating_gem',
                '2x astralsorcery:colored_lens_spectral',
                '2x bloodmagic:etherealslate',
                '#botania:runes/asgard',
                '#botania:runes/niflheim',
                '#botania:runes/alfheim',
                '#botania:runes/midgard',
                '#astralsorcery:crystals/attuned',

                { type: 'masterfulmachinery:energy', perTick: true, data: { amount: 500000 } },
                { type: 'masterfulmachinery:astral_starlight', perTick: true, data: { amount: 50 } }
            ],
            ticks: 400,
            id: `${id_prefix}altar_radiance`
        },
        {
            outputs: [
                {
                    chance: 1.0,
                    data: 'botania:gaia_spreader'
                }
            ],
            inputs: [
                '6x botania:bifrost_perm',
                '4x botania:life_essence',
                '2x #botania:runes/midgard',
                'astralsorcery:colored_lens_spectral',
                'botania:elven_spreader',
                'naturesaura:ancient_sapling',
                'mythicbotany:dream_cherry',
                '#forge:gems/dragonstone',

                { type: 'masterfulmachinery:energy', perTick: true, data: { amount: 500000 } },
                { type: 'masterfulmachinery:astral_starlight', perTick: true, data: { amount: 50 } }
            ],
            ticks: 400,
            id: `${id_prefix}gaia_spreader`
        },
        {
            outputs: [
                {
                    chance: 1.0,
                    data: 'botania:elven_spreader'
                }
            ],
            inputs: [
                '#forge:ingots/elementium',
                '8x botania:dreamwood',
                '2x botania:glimmering_dreamwood',
                'botania:spark',
                '2x #botania:runes/summer',
                '2x #botania:runes/air',
                'astralsorcery:colored_lens_push',

                { type: 'masterfulmachinery:energy', perTick: true, data: { amount: 500000 } },
                { type: 'masterfulmachinery:astral_starlight', perTick: true, data: { amount: 50 } }
            ],
            ticks: 400,
            id: `${id_prefix}elven_spreader`
        },
        {
            outputs: [
                {
                    chance: 1.0,
                    data: 'astralsorcery:shifting_star'
                }
            ],
            inputs: [
                '4x #forge:gems/niotic',
                '2x bloodmagic:reagentbinding',
                '2x #forge:dusts/starmetal',
                '4x astralsorcery:illumination_powder',
                'industrialforegoing:ether_gas_bucket',

                { type: 'masterfulmachinery:energy', perTick: true, data: { amount: 500000 } },
                { type: 'masterfulmachinery:astral_starlight', perTick: true, data: { amount: 50 } }
            ],
            ticks: 400,
            id: `${id_prefix}shifting_star`
        },
        {
            outputs: [
                {
                    chance: 1.0,
                    data: 'astralsorcery:chalice'
                }
            ],
            inputs: [
                '4x #forge:ingots/gold',
                '4x astralsorcery:resonating_gem',
                '2x #forge:ingots/starmetal',
                '3x astralsorcery:black_marble_raw',
                '5x #forge:gems/aquamarine',

                { type: 'masterfulmachinery:energy', perTick: true, data: { amount: 500000 } },
                { type: 'masterfulmachinery:astral_starlight', perTick: true, data: { amount: 50 } }
            ],
            ticks: 400,
            id: `${id_prefix}chalice`
        },
        {
            outputs: [
                {
                    chance: 1.0,
                    data: 'astralsorcery:shifting_star_vicio'
                }
            ],
            inputs: [
                'astralsorcery:shifting_star',
                '2x #forge:ingots/starmetal',
                '6x #forge:dusts/starmetal',
                '2x astralsorcery:illumination_powder',
                '2x bloodmagic:defaultcrystal',
                '2x bloodmagic:reagentair',

                { type: 'masterfulmachinery:energy', perTick: true, data: { amount: 500000 } },
                { type: 'masterfulmachinery:astral_starlight', perTick: true, data: { amount: 50 } }
            ],
            ticks: 400,
            id: `${id_prefix}shifting_star_vicio`
        },
        {
            outputs: [
                {
                    chance: 1.0,
                    data: 'astralsorcery:shifting_star_evorsio'
                }
            ],
            inputs: [
                'astralsorcery:shifting_star',
                '2x #forge:ingots/starmetal',
                '6x #forge:dusts/starmetal',
                '2x astralsorcery:illumination_powder',
                '2x bloodmagic:destructivecrystal',
                '2x bloodmagic:reagentfastminer',

                { type: 'masterfulmachinery:energy', perTick: true, data: { amount: 500000 } },
                { type: 'masterfulmachinery:astral_starlight', perTick: true, data: { amount: 50 } }
            ],
            ticks: 400,
            id: `${id_prefix}shifting_star_evorsio`
        },
        {
            outputs: [
                {
                    chance: 1.0,
                    data: 'astralsorcery:shifting_star_discidia'
                }
            ],
            inputs: [
                'astralsorcery:shifting_star',
                '2x #forge:ingots/starmetal',
                '6x #forge:dusts/starmetal',
                '2x astralsorcery:illumination_powder',
                '2x bloodmagic:vengefulcrystal',
                '2x bloodmagic:reagentlava',

                { type: 'masterfulmachinery:energy', perTick: true, data: { amount: 500000 } },
                { type: 'masterfulmachinery:astral_starlight', perTick: true, data: { amount: 50 } }
            ],
            ticks: 400,
            id: `${id_prefix}shifting_star_discidia`
        },
        {
            outputs: [
                {
                    chance: 1.0,
                    data: 'astralsorcery:shifting_star_armara'
                }
            ],
            inputs: [
                'astralsorcery:shifting_star',
                '2x #forge:ingots/starmetal',
                '6x #forge:dusts/starmetal',
                '2x astralsorcery:illumination_powder',
                '2x bloodmagic:steadfastcrystal',
                '2x bloodmagic:reagentbinding',

                { type: 'masterfulmachinery:energy', perTick: true, data: { amount: 500000 } },
                { type: 'masterfulmachinery:astral_starlight', perTick: true, data: { amount: 50 } }
            ],
            ticks: 400,
            id: `${id_prefix}shifting_star_armara`
        },
        {
            outputs: [
                {
                    chance: 1.0,
                    data: 'astralsorcery:shifting_star_aevitas'
                }
            ],
            inputs: [
                'astralsorcery:shifting_star',
                '2x #forge:ingots/starmetal',
                '6x #forge:dusts/starmetal',
                '2x astralsorcery:illumination_powder',
                '2x bloodmagic:corrosivecrystal',
                '2x bloodmagic:reagentgrowth',

                { type: 'masterfulmachinery:energy', perTick: true, data: { amount: 500000 } },
                { type: 'masterfulmachinery:astral_starlight', perTick: true, data: { amount: 50 } }
            ],
            ticks: 400,
            id: `${id_prefix}shifting_star_aevitas`
        },
        {
            outputs: [
                {
                    chance: 1.0,
                    data: 'astralsorcery:mantle'
                }
            ],
            inputs: [
                'botania:balance_cloak',
                'astralsorcery:celestial_crystal',
                'magicfeather:magicfeather',

                '4x #forge:dusts/starmetal',
                '4x astralsorcery:illumination_powder',
                '4x astralsorcery:resonating_gem',
                '#botania:runes/mana',
                '#botania:runes/pride',
                '#botania:runes/envy',
                '#forge:storage_blocks/starmetal',

                { type: 'masterfulmachinery:energy', perTick: true, data: { amount: 500000 } },
                { type: 'masterfulmachinery:astral_starlight', perTick: true, data: { amount: 50 } }
            ],
            ticks: 400,
            id: `${id_prefix}mantle`
        },
        {
            outputs: [
                {
                    chance: 1.0,
                    data: '2x mekanism:solar_neutron_activator'
                }
            ],
            inputs: [
                '5x kubejs:observatory_lens',
                '5x powah:solar_panel_niotic',
                '5x mekanism:hdpe_sheet',
                '#industrialforegoing:machine_frame/advanced',
                '2x #forge:circuits/elite',
                '2x #forge:plates/enderium',
                '2x #forge:dusts/iesnium',
                '2x #forge:dusts/starmetal',
                '2x #forge:dusts/end_stone',

                { type: 'masterfulmachinery:energy', perTick: true, data: { amount: 500000 } },
                { type: 'masterfulmachinery:astral_starlight', perTick: true, data: { amount: 50 } }
            ],
            ticks: 400,
            id: `${id_prefix}solar_neutron_activator`
        }
    ];

    recipes.forEach((recipe) => {
        recipe.inputs = recipe.inputs.map(toMMJson);
        recipe.outputs = recipe.outputs.map(toMMJson);
        recipe.type = 'masterfulmachinery:machine_process';
        recipe.structureId = 'auto_iridescent_altar_structure';
        recipe.controllerId = 'auto_iridescent_altar';
        event.custom(recipe).id(recipe.id);
    });
});
