ServerEvents.recipes(event => {
    event.remove({id: 'modern_industrialization:vanilla_recipes/steel_forge_hammer_asbl'})
    event.remove({id: 'modern_industrialization:forge_hammer'})

    event.remove({output: 'createdeco:cast_iron_ingot'})
    event.recipes.createCompacting(['createdeco:cast_iron_ingot'], ['create:iron_sheet']).heated()
    event.recipes.createMilling(['minecraft:tuff'],['minecraft:stone'])

    event.shaped('modern_industrialization:forge_hammer', [
        'CCC',
        ' R ',
        'RRR'
    ], {
        C: 'createdeco:cast_iron_block',
        R: 'create:sturdy_sheet'
    })

    // Flint -> Flint Dust via Milling, with a chance of extra Flint Dust
    event.recipes.create.milling([
        'kubejs:flint_dust', 
        Item.of('kubejs:flint_dust').withChance(0.15) // 15% chance of extra flint_dust
    ], 'minecraft:flint')

    // Flint Dust -> Clean Flint Dust via Washing/Splashing, with a chance of Iron / Zinc nuggets
    event.recipes.create.splashing([
        'kubejs:cleaned_flint_dust', 
        Item.of('kubejs:cleaned_flint_dust').withChance(0.1), // 10% chance of extra clean_flint_dust
        Item.of('minecraft:iron_nugget').withChance(0.25), // 25% chance of iron nugget
        Item.of('create:zinc_nugget').withChance(0.25) // 25% chance of zinc nugget
    ], 'kubejs:flint_dust')

    // Clean Flint Dust -> Silicon via Smelting
    event.smelting('ae2:silicon', 'kubejs:cleaned_flint_dust')

    // Silicon Dust -> Silicon via Pressing
    event.recipes.create.pressing('ae2:silicon', 'modern_industrialization:silicon_dust')

    let inter = 'kubejs:incomplete_processor' // transitional item

    event.recipes.create.sequenced_assembly([
        Item.of('ae2:logic_processor').withChance(1.0), // Final product
    ], 'ae2:printed_silicon', [ // Initial input
        event.recipes.create.deploying(inter, [inter, 'minecraft:redstone']), // Apply the minecraft:redstone
        event.recipes.create.deploying(inter, [inter, 'ae2:printed_logic_processor']), // Apply the Logic Circuit
    ]).transitionalItem(inter).loops(1)

    event.recipes.create.sequenced_assembly([
        Item.of('ae2:calculation_processor').withChance(1.0), // Final product
    ], 'ae2:printed_silicon', [ // Initial input
        event.recipes.create.deploying(inter, [inter, 'minecraft:redstone']), // Apply the minecraft:redstone
        event.recipes.create.deploying(inter, [inter, 'ae2:printed_calculation_processor']), // Apply the Calculation Circuit
    ]).transitionalItem(inter).loops(1)
    
    event.recipes.create.sequenced_assembly([
        Item.of('ae2:engineering_processor').withChance(1.0), // Final product
    ], 'ae2:printed_silicon', [ // Initial input
        event.recipes.create.deploying(inter, [inter, 'minecraft:redstone']), // Apply the Redstone
        event.recipes.create.deploying(inter, [inter, 'ae2:printed_engineering_processor']), // Apply the Engineering Circuit
    ]).transitionalItem(inter).loops(1)
})
