ServerEvents.recipes(event => {
    event.smelting('2x minecraft:gold_nugget', 'gtceu:precious_alloy_ingot')
    event.replaceOutput({ id: 'gtceu:centrifuge/centrifuge_magnetite_pure_dust_to_dust' }, 'gtceu:tiny_gold_dust', 'gtceu:tiny_precious_alloy_dust')
    event.replaceOutput({ id: 'gtceu:centrifuge/centrifuge_copper_pure_dust_to_dust' }, 'gtceu:tiny_gold_dust', 'gtceu:tiny_precious_alloy_dust')
    event.replaceOutput({ id: 'gtceu:centrifuge/netherrack_separation' }, 'gtceu:tiny_gold_dust', 'gtceu:tiny_precious_alloy_dust')
    event.replaceOutput({ id: 'gtceu:thermal_centrifuge/centrifuge_magnetite_purified_ore_to_refined_ore' }, 'gtceu:tiny_gold_dust', 'gtceu:tiny_precious_alloy_dust')
    event.replaceOutput({ id: 'gtceu:thermal_centrifuge/centrifuge_magnetite_crushed_ore_to_refined_ore' }, 'gtceu:tiny_gold_dust', 'gtceu:tiny_precious_alloy_dust')
    event.replaceOutput({ id: 'gtceu:thermal_centrifuge/centrifuge_copper_purified_ore_to_refined_ore' }, 'gtceu:tiny_gold_dust', 'gtceu:tiny_precious_alloy_dust')
    event.replaceOutput({ id: 'gtceu:thermal_centrifuge/centrifuge_copper_crushed_ore_to_refined_ore' }, 'gtceu:tiny_gold_dust', 'gtceu:tiny_precious_alloy_dust')
    event.replaceOutput({ id: 'gtceu:macerator/macerate_copper_crushed_ore_to_dust' }, 'gtceu:gold_dust', 'gtceu:precious_alloy_dust')
    event.replaceOutput({ id: 'gtceu:macerator/macerate_magnetite_refined_ore_to_dust' }, 'gtceu:gold_dust', 'gtceu:precious_alloy_dust')
    event.replaceOutput({ id: 'gtceu:macerator/macerate_magnetite_crushed_ore_to_dust' }, 'gtceu:gold_dust', 'gtceu:precious_alloy_dust')
    event.replaceOutput({ id: 'gtceu:chemical_bath/bathe_silver_crushed_ore_to_purified_ore' }, 'gtceu:gold_dust', 'gtceu:precious_alloy_dust')
    event.replaceOutput({ id: 'gtceu:chemical_bath/bathe_magnetite_crushed_ore_to_purified_ore' }, 'gtceu:gold_dust', 'gtceu:precious_alloy_dust')
    event.replaceOutput({ id: 'gtceu:chemical_bath/bathe_iron_crushed_ore_to_purified_ore' }, 'gtceu:gold_dust', 'gtceu:precious_alloy_dust')
    event.replaceOutput({ id: 'gtceu:chemical_bath/bathe_copper_crushed_ore_to_purified_ore' }, 'gtceu:gold_dust', 'gtceu:precious_alloy_dust')
    event.replaceOutput({ id: 'gtceu:chemical_bath/bathe_chalcopyrite_crushed_ore_to_purified_ore' }, 'gtceu:gold_dust', 'gtceu:precious_alloy_dust')
    event.replaceOutput({ id: 'gtceu:chemical_bath/bathe_bornite_crushed_ore_to_purified_ore' }, 'gtceu:gold_dust', 'gtceu:precious_alloy_dust')
    event.replaceOutput({ id: 'gtceu:electromagnetic_separator/separate_vanadium_magnetite_pure_dust_to_dust' }, 'gtceu:small_gold_dust', 'gtceu:small_precious_alloy_dust')
    event.replaceOutput({ id: 'gtceu:electromagnetic_separator/separate_magnetite_pure_dust_to_dust' }, 'gtceu:small_gold_dust', 'gtceu:small_precious_alloy_dust')
    event.replaceOutput({ id: 'gtceu:electromagnetic_separator/separate_granitic_mineral_sand_pure_dust_to_dust' }, 'gtceu:small_gold_dust', 'gtceu:small_precious_alloy_dust')
    event.replaceOutput({ id: 'gtceu:electromagnetic_separator/separate_basaltic_mineral_sand_pure_dust_to_dust' }, 'gtceu:small_gold_dust', 'gtceu:small_precious_alloy_dust')
})
ServerEvents.recipes(event => {
    event.recipes.gtceu.centrifuge('tier1_gold_processing')
        .itemInputs('4x gtceu:gold_alloy_dust')
        .itemOutputs('4x gtceu:tiny_gold_dust', '3x gtceu:copper_dust')
        .duration(500)
        .EUt(30)
    event.recipes.gtceu.electrolyzer('tier2_gold_processing')
        .itemInputs('4x gtceu:gold_leach_dust')
        .inputFluids(Fluid.of('gtceu:hydrogen', 1000))
        .outputFluids(Fluid.of('minecraft:water', 1000))
        .itemOutputs('3x gtceu:copper_dust')
        .itemOutputs('8x gtceu:tiny_gold_dust')
        .duration(300)
        .EUt(30)
    event.recipes.gtceu.sifter('tier3_gold_processing')
        .EUt(30).duration(80)
        .itemInputs('4x gtceu:copper_leach_dust')
        .itemOutputs('3x gtceu:copper_dust')
        .chancedOutput('gtceu:lead_dust', 1500, 500)
        .chancedOutput('gtceu:iron_dust', 1200, 400)
        .chancedOutput('gtceu:gallium_dust', 1200, 400)
        .chancedOutput('gtceu:nickel_dust', 1000, 300)
        .chancedOutput('gtceu:silver_dust', 800, 200)
    //main chain
    //step 1
    event.recipes.gtceu.alloy_smelter('gold_alloy1')
        .EUt(30).duration(100)
        .itemInputs('gtceu:precious_alloy_dust')
        .itemInputs('3x gtceu:copper_dust')
        .itemOutputs('4x gtceu:gold_alloy_ingot')
    event.recipes.gtceu.alloy_smelter('gold_alloy2')
        .EUt(30).duration(100)
        .itemInputs('gtceu:precious_alloy_ingot')
        .itemInputs('3x gtceu:copper_dust')
        .itemOutputs('4x gtceu:gold_alloy_ingot')
    event.recipes.gtceu.alloy_smelter('gold_alloy3')
        .EUt(30).duration(100)
        .itemInputs('gtceu:precious_alloy_dust')
        .itemInputs('3x minecraft:copper_ingot')
        .itemOutputs('4x gtceu:gold_alloy_ingot')
    event.recipes.gtceu.alloy_smelter('gold_alloy4')
        .EUt(30).duration(100)
        .itemInputs('gtceu:precious_alloy_ingot')
        .itemInputs('3x minecraft:copper_ingot')
        .itemOutputs('4x gtceu:gold_alloy_ingot')
    //step 2
    event.recipes.gtceu.chemical_reactor('gold_leach_dust')
        .duration(80)
        .itemInputs('4x gtceu:gold_alloy_ingot')
        .inputFluids('gtceu:nitric_acid 1000')
        .itemOutputs('4x gtceu:gold_leach_dust')
        .outputFluids('gtceu:nitrogen_dioxide 1000')
    event.recipes.gtceu.chemical_reactor('copper_leach_dust')
        .duration(80)
        .EUt(120)
        .itemInputs('4x gtceu:gold_leach_dust')
        .inputFluids('gtceu:hydrochloric_acid 1000')
        .itemOutputs('4x gtceu:copper_leach_dust')
        .outputFluids('gtceu:chloroauric_acid 1000')
    //氯金酸回收
    event.recipes.gtceu.chemical_reactor('chloroauricacid_to_gold')
        .duration(100)
        .inputFluids('gtceu:chloroauric_acid 1000')
        .notConsumable('gtceu:potassium_metabi_sulfite_dust')
        .itemOutputs('2x gtceu:gold_dust')
        .outputFluids('minecraft:water 1000')
        .outputFluids('gtceu:chlorine 1000')
    //焦亚硫酸钾生产
    event.recipes.gtceu.mixer('potassium_metabi_sulfite_dust')
        .duration(100).EUt(30)
        .circuit(1)
        .itemInputs('2x gtceu:potassium_dust')
        .itemInputs('2x gtceu:sulfur_dust')
        .inputFluids('gtceu:oxygen 5000')
        .itemOutputs('9x gtceu:potassium_metabi_sulfite_dust')

    //gold catalyst
    event.recipes.create.mixing(['minecraft:gold_ingot','kubejs:metallurgical_catalyst'],['gtceu:precious_alloy_ingot','kubejs:metallurgical_catalyst']).heated()
})