// priority: 0

ServerEvents.recipes(event => {
    event.replaceInput({ output: 'mekanism:metallurgic_infuser'}, 'minecraft:redstone', 'pncepcb:high_temp_finished_pcb')

    event.replaceInput({ output: 'mekanism:enrichment_chamber'}, 'minecraft:iron_ingot', 'pneumaticcraft:printed_circuit_board')
    event.replaceInput({ output: 'mekanism:enrichment_chamber'}, 'minecraft:redstone', 'minecraft:iron_ingot')

    event.remove({ output: 'mekanism:chemical_oxidizer'})
    event.custom({
        "type": "mekanism:mek_data",
        "key": {
            "#": {
                "item": "mekanism:dynamic_tank"
            },
            "A": {
                "tag": "mekanism:alloys/infused"
            },
            "C": {
                "tag": "forge:circuits/basic"
            },
            "S": {
                "tag": "mekanism:personal_storage"
            },
            "T": {
                "item": "mekanism:basic_chemical_tank"
            },
            "P": {
                "item": "pneumaticcraft:printed_circuit_board"
            }
         },
        "pattern": [
            "PCA",
            "S#T",
            "ACP"
        ],
        "result": {
            "item": "mekanism:chemical_oxidizer"
        }
    })

    event.remove({ output: 'mekanism:chemical_infuser'})
    event.custom({
        "type": "mekanism:mek_data",
        "key": {
            "A": {
                "tag": "mekanism:alloys/infused"
            },
            "C": {
                "tag": "forge:circuits/basic"
            },
            "T": {
                "item": "mekanism:basic_chemical_tank"
            },
            "X": {
                "item": "mekanism:steel_casing"
            },
            "P": {
                "item": "pneumaticcraft:printed_circuit_board"
            }
        },
        "pattern": [
            "PCA",
            "TXT",
            "ACP"
        ],
        "result": {
            "item": "mekanism:chemical_infuser"
        }
    })

    event.replaceInput({ output: 'mekanism:isotopic_centrifuge'}, 'mekanism:ultimate_control_circuit', 'pncepcb:radiation_hardened_finished_pcb')

    event.remove({ output: 'mekanismgenerators:fission_reactor_port'})
    event.custom({
        "type": "minecraft:crafting_shaped",
        "key": {
            "C": {
                "tag": "forge:circuits/elite"
            },
            "F": {
                "item": "mekanismgenerators:fission_reactor_casing"
            },
            "P": {
                "item": "pncepcb:radiation_hardened_finished_pcb"
            }
        },
        "pattern": [
            "PFP",
            "FCF",
            "PFP"
        ],
        "result": {
            "count": 2,
            "item": "mekanismgenerators:fission_reactor_port"
        }
    })

    event.replaceInput({ output: 'mekanism:solar_neutron_activator'}, 'mekanism:alloy_reinforced', 'pncepcb:radiation_hardened_finished_pcb')

    event.replaceInput({ output: 'mekanism:pressurized_reaction_chamber'}, 'mekanism:alloy_infused', 'pncepcb:high_temp_finished_pcb')

    event.replaceInput({ output: 'mekanism:crusher'}, 'minecraft:lava_bucket', 'pncepcb:high_temp_finished_pcb')

    event.remove({ output: 'mekanism:energized_smelter'})
    event.custom({
        "type": "minecraft:crafting_shaped",
        "key": {
            "A": {
                "tag": "mekanism:alloys/basic"
            },
            "C": {
                "tag": "forge:circuits/basic"
            },
            "G": {
                "tag": "forge:glass/silica"
            },
            "X": {
                "item": "mekanism:steel_casing"
            },
            "P": {
                "item": "pncepcb:high_temp_finished_pcb"
            }
        },
        "pattern": [
            "PCA",
            "GXG",
            "ACP"
        ],
        "result": {
            "item": "mekanism:energized_smelter"
        }
    })

    event.remove({ output: 'mekanism:osmium_compressor'})
    event.custom({
        "type": "minecraft:crafting_shaped",
        "key": {
            "A": {
                "tag": "mekanism:alloys/infused"
            },
            "B": {
                "item": "minecraft:bucket"
            },
            "C": {
                "tag": "forge:circuits/advanced"
            },
            "X": {
                "item": "mekanism:steel_casing"
            },
            "P": {
                "item": "pneumaticcraft:printed_circuit_board"
            }
        },
        "pattern": [
            "PCA",
            "BXB",
            "ACP"
        ],
        "result": {
            "item": "mekanism:osmium_compressor"
        }
    })

    event.replaceInput({ output: 'mekanism:combiner'}, 'minecraft:cobblestone', 'pneumaticcraft:printed_circuit_board')

    event.replaceInput({ output: 'mekanism:precision_sawmill'}, 'mekanism:alloy_infused', 'pneumaticcraft:printed_circuit_board')

    event.replaceInput({ output: 'mekanism:energy_tablet'}, 'mekanism:alloy_infused', 'pncepcb:high_power_finished_pcb')

    event.remove({ output: 'mekanism:chemical_dissolution_chamber'})
    event.custom({
        "type": "mekanism:mek_data",
        "key": {
            "C": {
                "tag": "forge:circuits/ultimate"
            },
            "I": {
                "tag": "forge:ingots/refined_obsidian"
            },
            "T": {
                "item": "mekanism:basic_chemical_tank"
            },
            "X": {
                "item": "mekanism:steel_casing"
            },
            "P": {
                "item": "pncepcb:high_power_finished_pcb"
            }
        },
        "pattern": [
            "PTI",
            "CXC",
            "ITP"
        ],
        "result": {
            "item": "mekanism:chemical_dissolution_chamber"
        }
    })

    event.remove({ output: 'mekanism:chemical_washer'})
    event.custom({
        "type": "mekanism:mek_data",
        "key": {
            "C": {
                "tag": "forge:circuits/ultimate"
            },
            "I": {
                "tag": "forge:ingots/refined_obsidian"
            },
            "T": {
                "item": "mekanism:basic_chemical_tank"
            },
            "X": {
                "item": "mekanism:steel_casing"
            },
            "P": {
                "item": "pncepcb:waterproof_finished_pcb"
            },
            "F": {
                "item": "mekanism:basic_fluid_tank"
            }
        },
        "pattern": [
            "PFI",
            "CXC",
            "ITP"
        ],
        "result": {
            "item": "mekanism:chemical_washer"
        }
    })

    event.remove({ output: 'mekanism:chemical_crystalizer'})
    event.custom({
        "type": "mekanism:mek_data",
        "key": {
            "C": {
                "tag": "forge:circuits/ultimate"
            },
            "I": {
                "tag": "forge:ingots/refined_obsidian"
            },
            "X": {
                "item": "mekanism:steel_casing"
            },
            "P": {
                "item": "pncepcb:high_power_finished_pcb"
            },
            "F": {
                "item": "mekanism:fluorite_gem"
            }
        },
        "pattern": [
            "PFI",
            "CXC",
            "IFP"
        ],
        "result": {
            "item": "mekanism:chemical_crystalizer"
        }
    })

    event.remove({ output: 'mekanism:isotopic_centrifuge'})
    event.custom({
        "type": "mekanism:mek_data",
        "key": {
            "C": {
                "tag": "forge:circuits/ultimate"
            },
            "I": {
                "tag": "forge:ingots/lead"
            },
            "T": {
                "item": "mekanism:basic_chemical_tank"
            },
            "P": {
                "item": "pncepcb:radiation_hardened_finished_pcb"
            }
        },
        "pattern": [
            "IPI",
            "CTC",
            "IPI"
        ],
        "result": {
            "item": "mekanism:isotopic_centrifuge"
        }
    })

    event.remove({ output: 'mekanism:nutritional_liquifier'})
    event.custom({
        "type": "minecraft:crafting_shaped",
        "key": {
            "#": {
                "item": "minecraft:bowl"
            },
            "C": {
                "tag": "forge:circuits/basic"
            },
            "R": {
                "tag": "forge:dusts/redstone"
            },
            "X": {
                "item": "mekanism:steel_casing"
            },
            "P": {
                "item": "pneumaticcraft:printed_circuit_board"
            }
        },
        "pattern": [
            "PCR",
            "#X#",
            "RCP"
        ],
        "result": {
            "item": "mekanism:nutritional_liquifier"
        }
    })

    event.custom({
        "type": "extendedcrafting:shaped_table",
        "pattern": [
            "ABBCBBA",
            "BDDDDDB",
            "BDEEEDB",
            "CDEFEDC",
            "BDEEEDB",
            "BDDDDDB",
            "ABBCBBA"
        ],
        "key": {
            "A": {
                "type": "forge:nbt",
                "item": "mekanism:ultimate_energy_cube",
                "count": 1,
                "nbt": "{mekData:{EnergyContainers:[{Container:0b,stored:\"256000000\"}]}}"
            },
            "B": {
                "item": "mekanism:sps_casing"
            },
            "C": {
                "item": "mekanismgenerators:fission_reactor_casing"
            },
            "D": {
                "item": "minecraft:purple_concrete"
            },
            "E": {
                "item": "minecraft:purple_wool"
            },
            "F": {
                "item": "mekanism:pellet_antimatter"
            }
        },
        "result": {
            "item": "kubejs:antimatter_stabilizer_core"
        }
    })
})