// priority: 0

onEvent('recipes', event => {
    removeRecipeByOutput(event, [
        //pipez
        PZ("item_pipe"),
        PZ("fluid_pipe"),
        PZ("energy_pipe"),

        //upgrades
        PZ("basic_upgrade"),
        PZ("improved_upgrade"),
        PZ("advanced_upgrade"),
        PZ("ultimate_upgrade"),
        PZ("wrench"),

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

    //pipez
    donutCraft(event, Item.of(PZ("item_pipe"), 8), KJ("blank_upgrade"), Q("pipe"))
    donutCraft(event, Item.of(PZ("fluid_pipe"), 8), KJ("blank_upgrade"), CR("fluid_pipe"))
    donutCraft(event, Item.of(PZ("energy_pipe"), 8), KJ("blank_upgrade"), AE2('fluix_glass_cable'))

    //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'),
    })

    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'))
})