ServerEvents.recipes(event => {
    event.replaceInput(
        {id: 'ars_nouveau:enchanting_apparatus'},
        'minecraft:diamond',
        'kubejs:grist_intelligent_basic_block'
    );
    event.replaceInput(
        {id: 'ars_nouveau:enchanting_apparatus'},
        'minecraft:gold_nugget',
        '#kubejs:grist/primordeal/basic'
    );

    event.replaceInput(
        {id: 'ars_nouveau:enchanting_apparatus'},
        'minecraft:gold_ingot',
        '#kubejs:grist/intelligent/basic'
    );

    event.shaped('ars_nouveau:imbuement_chamber', [
        'ABA',
        'ACA',
        'ABA'
    ], {
        'A': 'ars_nouveau:archwood_planks',
        'B': 'minecraft:gold_ingot',
        'C': '#kubejs:grist/intelligent/basic'
    });

    event.replaceInput(
        {mod: 'ars_nouveau'},
        'minecraft:lapis_lazuli',
        '#kubejs:grist/intelligent/basic'
    );

    event.replaceInput(
        {mod: 'ars_nouveau'},
        'minecraft:redstone_block',
        '#kubejs:grist/energetic/basic'
    );

    event.replaceInput(
        {output: 'ars_nouveau:arcane_core'},
        'ars_nouveau:source_gem',
        '#kubejs:grist/intelligent/basic'
    );

    // Gating elements behind grist
    event.replaceInput(
        {output: 'ars_nouveau:air_essence'},
        'ars_nouveau:source_gem',
        '#kubejs:grist/build/basic'
    );
    event.replaceInput(
        {output: 'ars_nouveau:earth_essence'},
        'ars_nouveau:source_gem',
        '#kubejs:grist/build/basic'
    );

    event.replaceInput(
        {output: 'ars_nouveau:manipulation_essence'},
        'ars_nouveau:source_gem',
        '#kubejs:grist/intelligent/basic'
    );

    event.replaceInput(
        {output: 'ars_nouveau:water_essence'},
        'ars_nouveau:source_gem',
        '#kubejs:grist/energetic/basic'
    );
    event.replaceInput(
        {output: 'ars_nouveau:fire_essence'},
        'ars_nouveau:source_gem',
        '#kubejs:grist/energetic/basic'
    );

    event.replaceInput(
        {output: 'ars_nouveau:abjuration_essence'},
        'ars_nouveau:source_gem',
        '#kubejs:grist/agricultural/basic'
    );
    event.replaceInput(
        {output: 'ars_nouveau:conjuration_essence'},
        'ars_nouveau:source_gem',
        '#kubejs:grist/agricultural/basic'
    );
    event.replaceInput(
        {output: 'ars_elemental:anima_essence'},
        'ars_nouveau:source_gem',
        '#kubejs:grist/agricultural/improved'
    );

    event.shaped('ars_nouveau:novice_spell_book', [
        ' A ',
        'ABA',
        ' A '
    ], {
        'A': '#kubejs:grist/intelligent/basic',
        'B': 'minecraft:book'
    });

    event.shaped('ars_nouveau:dominion_wand', [
        ' AC',
        ' BA',
        'B  ',
    ], {
        'A': 'ars_nouveau:source_gem',
        'B': 'minecraft:stick',
        'C': '#kubejs:grist/intelligent/basic'
    });
    
    event.recipes.ars_nouveau.imbuement(
        'kubejs:grist_intelligent_basic_block',
        '2x ars_nouveau:source_gem_block',
        800,
        ['minecraft:gold_block', 'kubejs:insightful_blend', 'minecraft:lapis_block']
    );

    event.replaceInput(
        {output: 'ars_nouveau:arcane_pedestal'},
        'ars_nouveau:source_gem',
        'kubejs:grist_intelligent_basic'
    );

    event.replaceInput(
        {output: 'ars_nouveau:sourcestone'},
        'ars_nouveau:source_gem',
        'minecraft:lapis_lazuli'
    );
});