
ServerEvents.recipes(event => {
    event.shapeless('2x create:cogwheel', [
        'thermal:tin_gear',
        '#minecraft:planks',
    ]);

    // Cart assembler is gated behind mid-game grist
    event.replaceInput({output: 'create:cart_assembler'},
        '#forge:dusts/redstone',
        '#kubejs:grist/build/improved'
    );

    // Gate wireless stuff behind intelligent grist
    event.replaceInput({output: 'create:transmitter'},
        '#forge:dusts/redstone',
        '#kubejs:grist/intelligent/basic'
    );

    // Gate the mixer behind aluminum
    event.replaceInput({output: 'create:whisk'},
        '#forge:plates/iron',
        '#forge:plates/aluminum'
    );

    event.replaceInput({output: 'create:propeller'},
        '#forge:plates/iron',
        '#forge:plates/invar'
    );

    event.remove({output: 'create:windmill_bearing'});
    event.shaped('create:windmill_bearing', [
        ' A ',
        'DBD',
        'DCD'
    ], {
        'A': '#minecraft:wooden_slabs',
        'B': '#forge:stone',
        'C': 'create:shaft',
        'D': '#kubejs:grist/energetic/basic'
    });

    // Gate the backpack behind mid-game energetic grist
    event.replaceInput({output: 'create:copper_backtank'},
        'minecraft:copper_block',
        'kubejs:grist_energetic_basic_block'
    )

    event.replaceInput({output: 'create:schematicannon'},
        'minecraft:iron_block',
        'kubejs:grist_build_basic_block'
    )

    // Allow certus quartz to be used for rose quartz
    event.replaceInput({output: 'create:rose_quartz'},
        'minecraft:quartz',
        '#forge:gems/quartz',
    );
    event.shapeless('create:rose_quartz', [
        'ae2:certus_quartz_crystal',
        '8x minecraft:redstone',
    ]);
    
    // Crushing wheels can come from build grist
    event.remove({output: 'create:crushing_wheel'});
    event.shaped('create:crushing_wheel', [
        'CBC',
        'BAB',
        'CBC'
    ], {
        'A': '#kubejs:grist/build/basic',
        'B': 'thermal:tin_gear',
        'C': 'create:andesite_alloy',
    });

    // Melt down XP nuggets and blocks into raw XP
    // 1 nugget == 60mb cognitium
    event.recipes.createMixing(Fluid.of('experienceobelisk:cognitium', 60), 'create:experience_nugget').heated();
    event.recipes.createMixing(Fluid.of('experienceobelisk:cognitium', 60 * 9), 'create:experience_block').heated();

    // Precision mechanisms should require intelligent grist
    event.recipes.createSequencedAssembly([
        Item.of('create:precision_mechanism'),
    ], '#forge:ingots/brass', [
        event.recipes.createDeploying('create:incomplete_precision_mechanism', ['create:incomplete_precision_mechanism', '#kubejs:grist/intelligent/basic']),
        event.recipes.createDeploying('create:incomplete_precision_mechanism', ['create:incomplete_precision_mechanism', 'create:cogwheel']),
        event.recipes.createDeploying('create:incomplete_precision_mechanism', ['create:incomplete_precision_mechanism', '#forge:gears/copper'])
    ]).transitionalItem('create:incomplete_precision_mechanism').loops(3);

    // Factory automation should require some intelligent grist
    event.replaceInput({output: 'create:stock_ticker'},
        'minecraft:gold_ingot',
        '#kubejs:grist/intelligent/basic'
    );

    event.remove({output: 'create:stock_link'});
    event.shaped('create:stock_link', [
        ' A ',
        ' B ',
        ' C '
    ], {
        'A': 'create:transmitter',
        'B': 'create:item_vault',
        'C': '#kubejs:grist/intelligent/basic',
    });
});