// priority: 0

onEvent('recipes', event => {
    removeRecipeByOutput(event, [
        //upgrades
        PZ("basic_upgrade"),
        PZ("improved_upgrade"),
        PZ("advanced_upgrade"),
        PZ("ultimate_upgrade"),
        PZ("wrench"),

        //w/o replace
        PZ("gas_pipe"),
    ])

    //upgrades
    event.shaped(PZ("basic_upgrade"), [
        'BCB',
        'CAC',
        'BBB'
    ], {
        A: KJ('blank_upgrade'),
        B: CP('iron_1'),
        C: CP('emerald_1'),
    })

    event.shaped(PZ("improved_upgrade"), [
        'BCB',
        'CAC',
        'BBB'
    ], {
        A: PZ("basic_upgrade"),
        B: CP('gold_1'),
        C: CP('emerald_1'),
    })

    event.shaped(PZ("advanced_upgrade"), [
        'BCB',
        'CAC',
        'BBB'
    ], {
        A: PZ("improved_upgrade"),
        B: CP('diamond_1'),
        C: CP('emerald_1'),
    })

    event.shaped(PZ("ultimate_upgrade"), [
        'BCB',
        'CAC',
        'BBB'
    ], {
        A: PZ("advanced_upgrade"),
        B: CP('netherite_1'),
        C: CP('emerald_1'),
    })

    //universal pipe
    event.replaceInput({ id: PZ("universal_pipe") }, MC("iron_ingot"), F("#ingots/red_alloy"))

    //filter destination tool
    event.replaceInput({ id: PZ("filter_destination_tool") }, MC("redstone"), PR_T("red_alloy_wire"))
    
    //wrench
	event.smithing(PZ("wrench"), Item.of(MAT('wrench')).ignoreNBT(), KJ('blank_upgrade'))
})