ServerEvents.recipes(event => {
    event.remove({ id: 'tfmg:industrial_blasting/silicon' })
    event.remove({ id: 'tfmg:coking/coal' })
    event.remove({ id: 'tfmg:compacting/cast_iron' })
    event.remove({ id: 'tfmg:crafting/kinetics/accumulator' })


    event.remove({ output: 'thermal:bitumen' })
    event.remove({ output: 'thermal:tar' })
    event.remove({ output: 'thermal:creosote_bucket' })
    event.remove({ output: 'ae2:chest' })
    event.remove({ output: 'ae2:silicon' })
    event.remove({ output: 'tfmg:copper_spool' })
    event.remove({ output: 'tfmg:aluminum_spool' })
    event.remove({ output: 'tfmg:constantan_spool' })
    event.remove({ output: 'tfmg:pumpjack_crank' })
    event.remove({ output: 'tfmg:pumpjack_base' })
    event.remove({ output: 'createadditions:alternator' })

    event.replaceInput(
        { input: 'ae2:silicon' },
        'ae2:silicon',
        'tfmg:silicon_ingot'
    )
    event.replaceInput(
        { input: '#forge:silicon' },
        '#forge:silicon',
        'tfmg:silicon_ingot'
    )

    event.replaceInput(
        { input: 'thermal:sulfur_dust' },
        'thermal:sulfur_dust',
        'tfmg:sulfur_dust'
    )
    event.replaceOutput(
        { output: 'thermal:sulfur_dust' },
        'thermal:sulfur_dust',
        'tfmg:sulfur_dust'
    )
    event.replaceOutput(
        { output: 'thermal:sulfur_dust' },
        'thermal:sulfur_dust',
        'tfmg:sulfur_dust'
    )
    event.replaceInput(
        { id: 'tfmg:crafting/kinetics/industrial_mixer' },
        'tfmg:steel_mechanism',
        'create:mechanical_mixer'
    )
    event.replaceInput(
        { output: 'powergrid:portable_battery' },
        'tfmg:steel_mechanism',
        'create:mechanical_mixer'
    )

    event.replaceInput(
        { input: 'createaddition:iron_wire' },
        'createaddition:',
        'powergrid:'
    )
    event.replaceOutput(
        { output: 'createaddition:iron_wire' },
        'createaddition:',
        'powergrid:'
    )

    event.replaceInput(
        { input: 'powergrid:golden_wire' },
        'powergrid:',
        'createaddition:'
    )
    event.replaceOutput(
        { output: 'powergrid:golden_wire' },
        'powergrid:',
        'createaddition:gold_wire'
    )



    event.replaceInput(
        { id: 'tfmg:crafting/kinetics/steel_distillation_controller' },
        'tfmg:steel_mechanism',
        'kubejs:quartz_timer_circuit'
    )

    event.replaceInput(
        { input: 'ae2:silicon' },
        'ae2:silicon',
        'tfmg:silicon_ingot'
    )

    event.replaceOutput(
        { id: 'thermal:machines/pyrolyzer/pyrolyzer_logs' },
        Fluid.of('thermal:creosote'),
        Fluid.of('tfmg:creosote')
    )
	event.remove({output: 'dustrial_decor:cast_iron_billet'})
	event.remove({input: 'dustrial_decor:cast_iron_billet'})
    event.remove({output: 'tfmg:stator'})
    event.recipes.create.mechanical_crafting(Item.of('tfmg:stator', 4), [
        'AB  ',
        'CAB ',
        'CDAB',
        'ECCA'
    ], {
        A: 'tfmg:electromagnetic_coil',
        B: 'powergrid:magnet',
        C: '#forge:plates/aluminum',
        D: '#forge:storage_blocks/steel',
        E: '#forge:wires/copper'
    })

    event.shaped('tfmg:accumulator', [
        'A',
    ], {
        A: 'tfmg:accumulator'
    })
    event.shaped('tfmg:pumpjack_crank', [
        'A A',
        'BCB',
        'DED'
    ], {
        A: 'tfmg:synthetic_string',
        B: 'tfmg:heavy_plate',
        C: 'tfmg:steel_mechanism',
        D: 'tfmg:rebar',
        E: 'tfmg:heavy_machinery_casing'
    })
    event.shaped('kubejs:ironclad_propeller', [
        ' A ',
        'ABA',
        ' A '
    ], {
        A: 'minecraft:iron_ingot',
        B: 'create:propeller'
    })
    event.shaped('ae2:chest', [
        'ABA',
        'CDC',
        'EFE'
    ], {
        A: '#forge:glass',
        B: 'ae2:terminal',
        C: 'ae2:fluix_glass_cable',
        D: 'kubejs:industrial_engineering_block',
        E: 'tfmg:steel_ingot',
        F: 'tfmg:lithium_ingot'
    })
    event.shaped('tfmg:pumpjack_base', [
        'ABA',
        'CDC',
        'EFE'
    ], {
        A: 'tfmg:synthetic_string',
        B: 'tfmg:steel_fluid_tank',
        C: 'tfmg:steel_mechanism',
        D: 'tfmg:heavy_machinery_casing',
        E: 'tfmg:steel_pipe',
        F: 'tfmg:industrial_pipe'
    })
    event.shaped(Item.of('powergrid:battery', '{BlockEntityTag:{Energy:10000}}'), [
        'ABA',
        'CCC',
        'ADA'
    ], {
        A: 'brass_ingot',
        B: 'powergrid:copper_coil',
        C: 'kubejs:lithium_battery',
        D: 'kubejs:quartz_timer_circuit'
    })
    

    event.recipes.createMixing(Item.of('minecraft:lapis_lazuli', 5), [
        Fluid.of('minecraft:water', 1000),
        'minecraft:blue_dye',
        'tfmg:sulfur_dust'
    ]).heated()

    event.recipes.create.compacting(['tfmg:cast_iron_ingot'], ['minecraft:iron_ingot', 'minecraft:charcoal']).lowheated()

    function coiling(output, wireInput) {
        event.shaped(output, [
            'WWW',
            'WSW',
            'WWW'
        ], {
            S: 'tfmg:empty_spool',
            W: wireInput
        })
    }
    coiling(Item.of('tfmg:copper_spool', '{Amount:1000}'), 'powergrid:wire')
    coiling(Item.of('tfmg:aluminum_spool', '{Amount:1000}'), 'tfmg:aluminum_wire')
    coiling(Item.of('tfmg:constantan_spool', '{Amount:1000}'), 'tfmg:constantan_wire')

    event.custom({
        "type": "tfmg:winding",
        "ingredients": [
            {
                "item": "tfmg:empty_spool"  
            },
            {
                "item": "tfmg:copper_spool"
            }
        ],
        "processingTime": 1000,
        "results": [
            {
                "item": "tfmg:copper_spool",
                "nbt": {
                    "Amount": 1000
                }
            }
        ]
    })
    event.custom({
        "type": "tfmg:winding",
        "ingredients": [
            {
                "item": "tfmg:empty_spool"
            },
            {
                "item": "tfmg:constantan_spool"
            }
        ],
        "processingTime": 1000,
        "results": [
            {
                "item": "tfmg:constantan_spool",
                "nbt": {
                    "Turns": 1000
                }
            }
        ]
    })
    event.custom({
        "type": "tfmg:winding",
        "ingredients": [
            {
                "item": "tfmg:empty_spool"
            },
            {
                "item": "tfmg:aluminum_spool"
            }
        ],
        "processingTime": 1000,
        "results": [
            {
                "item": "tfmg:aluminum_spool",
                "nbt": {
                    "Turns": 1000
                }
            }
        ]
    })
    event.custom(
        {
            "type": "tfmg:coking",
            "ingredients": [
                {
                    "item": "minecraft:charcoal"
                }
            ],
            "processingTime": 1200,
            "results": [
                {
                    "item": "tfmg:coal_coke"
                },
                {
                    "amount": 1,
                    "fluid": "tfmg:creosote"
                },
                {
                    "amount": 30,
                    "fluid": "tfmg:carbon_dioxide"
                }
            ]
        })

    event.custom(
        {
            "type": "tfmg:coking",
            "ingredients": [
                {
                    "item": "minecraft:charcoal"
                }
            ],
            "processingTime": 1200,
            "results": [
                {
                    "item": "tfmg:coal_coke"
                },
                {
                    "amount": 1,
                    "fluid": "tfmg:creosote"
                },
                {
                    "amount": 30,
                    "fluid": "tfmg:carbon_dioxide"
                }
            ]
        })

    event.custom(
        {
            "type": "tfmg:coking",
            "ingredients": [
                {
                    "item": "mekanism:block_charcoal"
                }
            ],
            "processingTime": 10800,
            "results": [
                {
                    "item": "tfmg:coal_coke_block"
                },
                {
                    "amount": 1,
                    "fluid": "tfmg:creosote"
                },
                {
                    "amount": 30,
                    "fluid": "tfmg:carbon_dioxide"
                }
            ]
        })

    event.custom(
        {
            "type": "tfmg:coking",
            "ingredients": [
                {
                    "tag": "mekanism:block_charcoal"
                }
            ],
            "processingTime": 1200,
            "results": [
                {
                    "item": "mekanism:block_charcoal"
                },
                {
                    "amount": 1,
                    "fluid": "tfmg:creosote"
                },
                {
                    "amount": 30,
                    "fluid": "tfmg:carbon_dioxide"
                }
            ]
        })

    event.custom(
        {
            "type": "tfmg:industrial_blasting",
            "hotAirUsage": 0,
            "ingredients": [
                {
                    "item": "ae2:certus_quartz_crystal"
                }
            ],
            "processingTime": 5,
            "results": [
                {
                    "amount": 40,
                    "fluid": "tfmg:liquid_silicon"
                }
            ]
        }
    )
    event.custom(
        {
            "type": "tfmg:industrial_blasting",
            "hotAirUsage": 0,
            "ingredients": [
                {
                    "item": "ae2:certus_quartz_dust"
                }
            ],
            "processingTime": 5,
            "results": [
                {
                    "amount": 40,
                    "fluid": "tfmg:liquid_silicon"
                }
            ]
        }
    )
    event.custom(
        {
            "type": "tfmg:industrial_blasting",
            "hotAirUsage": 20,
            "ingredients": [
                {
                    "item": "minecraft:iron_ingot"
                },
                {
                    "tag": "tfmg:flux"
                }
            ],
            "processingTime": 20,
            "results": [
                {
                    "amount": 144,
                    "fluid": "tfmg:molten_steel"
                },
                {
                    "amount": 144,
                    "fluid": "tfmg:molten_slag"
                },
                {
                    "amount": 200,
                    "fluid": "tfmg:furnace_gas"
                }
            ]
        }
    )
})