// priority: 0

onEvent('recipes', event => {
    //removal
    removeRecipeByID(event, [
        MC("crafting_table"),
        MC("furnace"),
        MC("bone_meal"),
        AE2("grinder/bonemeal"),
        MC("end_crystal"),
        "endportalrecipe:craftable_end_portal",
        BT("packed_ice"),
        MC("barrel"),
        MC("arrow"),
        MC("shield"),
		TC('smeltery/melting/metal/iron/small'),
    ])
    event.remove({ type: ENS("sieve"), output: MC("bone_meal") })
    event.remove({ type: ENS("sieve"), output: MC("blaze_powder") })
    
    //stone
    event.shaped(MC("stone"), [
        'SSS',
        'SSS',
        'SSS'
    ], {
        S: KJ('stone_pebble'),
    })

    //crafting table
    event.shaped(MC("crafting_table"), [
        'FF ',
        'PP '
    ], {
        F: MC('flint'),
        P: MC('#planks'),
    })

    //stone
    event.shaped(MC("stone"), [
        'SSS',
        'SSS',
        'SSS'
    ], {
        S: KJ('stone_pebble'),
    })

    //furnace
    event.shaped(MC("furnace"), [
        'SSS',
        'S S',
        'SSS'
    ], {
        S: Q('sturdy_stone')
    })
	
	//oak planks from driftwood
    event.shapeless(Item.of(MC('oak_planks'), 4), [KJ('driftwood')])
	
	//smithing table & stone cutter
	event.replaceInput({ id: MC("smithing_table") }, MC("iron_ingot"), F("#ingots/zinc"))
	event.replaceInput({ id: MC("stonecutter") }, MC("iron_ingot"), F("#ingots/zinc"))

    //flint & steel
    event.replaceInput({ id: MC("flint_and_steel") }, MC("iron_ingot"), F("#ingots/steel"))

    //wet sponge
    event.shapeless(MC('wet_sponge'), [MC('sponge'), MC('water_bucket')])

    //netherite scrap fron nuggets
    event.shapeless(Item.of(TC('debris_nugget'), 9), [MC('netherite_scrap')])
    event.shapeless(MC('netherite_scrap'), [Item.of(TC('debris_nugget'), 9)])

    //nether star
    event.shapeless(Item.of(CM('nether_star_fragment'), 4), [MC('nether_star')])
    event.recipes.createMechanicalCrafting(Item.of(CM('nether_star_fragment'), 4), "A", { A: MC('nether_star') })

    //end crystal
    event.replaceInput({ id: TC("common/glass/vanilla/end_crystal") }, MC("ender_eye"), MC("nether_star"))

    //hopper
    event.replaceInput({ id: MC("hopper") }, F("#chests/wooden"), WH("wooden_hopper"))
    event.replaceInput({ id: MC("hopper") }, F("#ingots/iron"), F("#ingots/zinc"))

    //end portal
    event.shaped(Item.of(MC("end_portal_frame"), 12), [
        'AAA',
        'BCB',
        'DDD'
    ], {
        A: AE2('singularity'),
        B: MC("nether_star"),
        C: M("teleportation_core"),
        D: CR("refined_radiance"),
    })

    //arrow transform
    donutCraft(event, Item.of(MC('arrow'), 8), AE2("singularity"), Item.of(TA('tinkers_arrow')).ignoreNBT())

    //ice
    event.shapeless(MC("ice"), [Item.of(BT("ice_shard"), 4)])

    event.recipes.createDeploying(
        MC('farmland'), [ MC("dirt"), Item.of(TC("mattock")).ignoreNBT() ]
    ).damageIngredient(1)

    //seeds to crops
    const seedToCrop = [
        { seed: ENS("seed_pickle"), crop: MC("sea_pickle") },
        { seed: ENS("seed_large_fern"), crop: MC("large_fern") },
        { seed: ENS("seed_fern"), crop: MC("fern") },
        { seed: ENS("seed_bamboo"), crop: MC("bamboo") },
        { seed: ENS("seed_kelp"), crop: MC("kelp") },
        { seed: ENS("seed_berry"), crop: MC("sweet_berries") },
        { seed: ENS("seed_potato"), crop: MC("potato") },
        { seed: ENS("seed_carrot"), crop: MC("carrot") },
        { seed: ENS("seed_sugarcane"), crop: MC("sugar_cane") },
        { seed: ENS("seed_cactus"), crop: MC("cactus") },
        { seed: MC("beetroot_seeds"), crop: MC("beetroot") },
    ]
    seedToCrop.forEach(obj => {
        const { seed, crop } = obj
        event.shapeless(seed, crop)
    })

    //trident
    event.shaped(MC("trident"), [
        ' BB',
        ' AB',
        'A  '
    ], {
        A: F('#rods/diamond'),
        B: F("#rods/iron"),
    })

    //bottle o'enchanting
    event.shaped(MC("experience_bottle"), [
        'BBB',
        'BAB',
    ], {
        A: MC('glass_bottle'),
        B: MU("experience_pearl"),
    })

    //barrels to MC barrel
    mc_wood_types.forEach(wood => {
        event.shapeless(MC("barrel"), [CH(`${wood}_barrel`)])
    })

    //water mixing
	event.recipes.createMixing([Fluid.of(MC("water"), 1000)], [MC("ice")])
	event.recipes.createMixing([Fluid.of(MC("water"), 500)], [MC("snow_block")])
	event.recipes.createMixing([Fluid.of(MC("water"), 125)], [MC("snow")])
	event.recipes.createMixing([Fluid.of(MC("water"), 125)], [MC("snowball")])
})