// 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")
    ])
    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"))

    //diamond
    event.recipes.createCompacting(MC("diamond"), [[F("#storage_blocks/coal"), F("#storage_blocks/charcoal")]]).superheated()
    event.shapeless(Item.of(EE('diamond_fragment'), 9), [MC('diamond')])
    event.shapeless(MC('diamond'), [Item.of(EE('diamond_fragment'), 9)])

    //magma block
    event.recipes.createFilling(MC("magma_block"), [MC("netherrack"), Fluid.of(MC("lava"), 250)])
    event.custom({
		"type": TC("casting_basin"),
        "cast": {
            "item": MC("netherrack")
          },
        "cast_consumed": true,
		"fluid": {
			"name": MC("lava"),
			"amount": 250
		},
		"result": Item.of(MC("magma_block")).toResultJson(),
		"cooling_time": 60
	})

    //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"))

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

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

    //farmland
    event.recipes.createDeploying(
        MC('farmland'),
        [
            MC("dirt"),
            [
                MC("wooden_hoe"),
                MC("stone_hoe"),
                MC("golden_hoe"),
                MC("iron_hoe"),
                MC("diamond_hoe"),
                MC("netherite_hoe"),
                PRE("dm_hoe"),
                PRE("rm_hoe"),
                AE2("certus_quartz_hoe"),
                AE2("nether_quartz_hoe"),
                BT("steel_hoe"),
                MU("reversing_hoe"),
                AV("hoeofthe_green_earth"),
            ]
        ]
    )

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