/*
██╗  ██╗ █████╗ ██╗   ██╗███████╗███╗   ██╗    ███╗   ███╗ ██████╗ ██████╗ ██████╗  █████╗  ██████╗██╗  ██╗███████╗
██║  ██║██╔══██╗██║   ██║██╔════╝████╗  ██║    ████╗ ████║██╔═══██╗██╔══██╗██╔══██╗██╔══██╗██╔════╝██║ ██╔╝██╔════╝
███████║███████║██║   ██║█████╗  ██╔██╗ ██║    ██╔████╔██║██║   ██║██║  ██║██████╔╝███████║██║     █████╔╝ ███████╗
██╔══██║██╔══██║╚██╗ ██╔╝██╔══╝  ██║╚██╗██║    ██║╚██╔╝██║██║   ██║██║  ██║██╔═══╝ ██╔══██║██║     ██╔═██╗ ╚════██║
██║  ██║██║  ██║ ╚████╔╝ ███████╗██║ ╚████║    ██║ ╚═╝ ██║╚██████╔╝██████╔╝██║     ██║  ██║╚██████╗██║  ██╗███████║
╚═╝  ╚═╝╚═╝  ╚═╝  ╚═══╝  ╚══════╝╚═╝  ╚═══╝    ╚═╝     ╚═╝ ╚═════╝ ╚═════╝ ╚═╝     ╚═╝  ╚═╝ ╚═════╝╚═╝  ╚═╝╚══════╝
*/
ServerEvents.recipes(e => 
{
    let heatSource = (block, heatValue) => {
        e.custom({
            type: "exdeorum:crucible_heat_source",
            block_predicate: {
                block: block
            },
            heat_value: heatValue
        }).id(`haven:crucible_heat_source/${block.replace(":", "_")}`)
    }
    let lavaCrucible = (amount, fluid, ingredientItem) => {
        e.custom({
            type: "exdeorum:lava_crucible",
            fluid: {
                amount: amount,
                fluid: fluid
            },
            ingredient: {
                item: ingredientItem
            }
        }).id(`haven:lava_crucible/${fluid.replace(":", "_")}`)
    }
    let barrelMixing = (fluid, fluidAmount, ingredientItem, result) => {
        e.custom({
            type: "exdeorum:barrel_mixing",
            fluid: fluid,
            fluid_amount: fluidAmount,
            ingredient: {
                item: ingredientItem
            },
            result: result
        }).id(`kjs:barrel_mixing/${result.replace(":", "_")}`)
    }

    e.remove({ id: 'exdeorum:oak_compressed_sieve' })
    e.remove({ id: 'exdeorum:spruce_compressed_sieve' })
    e.remove({ id: 'exdeorum:birch_compressed_sieve' })
    e.remove({ id: 'exdeorum:jungle_compressed_sieve' })
    e.remove({ id: 'exdeorum:acacia_compressed_sieve' })
    e.remove({ id: 'exdeorum:dark_oak_compressed_sieve' })
    e.remove({ id: 'exdeorum:mangrove_compressed_sieve' })
    e.remove({ id: 'exdeorum:cherry_compressed_sieve' })
    e.remove({ id: 'exdeorum:bamboo_compressed_sieve' })
    e.remove({ id: 'exdeorum:warped_compressed_sieve' })
    e.remove({ id: 'exdeorum:crimson_compressed_sieve' })
    e.remove({ id: 'exdeorum:oak_sieve' })
    e.remove({ id: 'exdeorum:spruce_sieve' })
    e.remove({ id: 'exdeorum:birch_sieve' })
    e.remove({ id: 'exdeorum:jungle_sieve' })
    e.remove({ id: 'exdeorum:acacia_sieve' })
    e.remove({ id: 'exdeorum:dark_oak_sieve' })
    e.remove({ id: 'exdeorum:mangrove_sieve' })
    e.remove({ id: 'exdeorum:cherry_sieve' })
    e.remove({ id: 'exdeorum:bamboo_sieve' })
    e.remove({ id: 'exdeorum:warped_sieve' })
    e.remove({ id: 'exdeorum:crimson_sieve' })
    e.remove({ id: 'exdeorum:mechanical_sieve' })

    e.remove({ id: 'exdeorum:string_mesh' })
    e.remove({ id: 'exdeorum:flint_mesh' })
    e.remove({ id: 'exdeorum:iron_mesh' })
    e.remove({ id: 'exdeorum:golden_mesh' })
    e.remove({ id: 'exdeorum:diamond_mesh' })
    e.remove({ id: 'exdeorum:netherite_mesh' })
    e.remove({ id: 'exdeorum:wooden_hammer' })
    e.remove({ id: 'exdeorum:stone_hammer' })
    e.remove({ id: 'exdeorum:golden_hammer' })
    e.remove({ id: 'exdeorum:iron_hammer' })
    e.remove({ id: 'exdeorum:diamond_hammer' })
    e.remove({ id: 'exdeorum:netherite_hammer' })
    e.remove({ id: 'exdeorum:compressed_wooden_hammer' })
    e.remove({ id: 'exdeorum:compressed_stone_hammer' })
    e.remove({ id: 'exdeorum:compressed_golden_hammer' })
    e.remove({ id: 'exdeorum:compressed_iron_hammer' })
    e.remove({ id: 'exdeorum:compressed_diamond_hammer' })
    e.remove({ id: 'exdeorum:compressed_netherite_hammer' })
    e.remove({ id: 'exdeorum:hammer/horn_coral' })
    e.remove({ id: 'exdeorum:hammer/crushing_sandstone' })
    e.remove({ id: 'exdeorum:hammer/fire_coral' })
    e.remove({ id: 'exdeorum:hammer/basalt' })
    e.remove({ id: 'exdeorum:hammer/dust' })
    e.remove({ id: 'exdeorum:hammer/brain_coral_fan' })
    e.remove({ id: 'exdeorum:hammer/prismarine' })
    e.remove({ id: 'exdeorum:hammer/tube_coral_fan' })
    e.remove({ id: 'exdeorum:hammer/sand' })
    e.remove({ id: 'exdeorum:hammer/pointed_dripstone' })
    e.remove({ id: 'exdeorum:hammer/brain_coral' })
    e.remove({ id: 'exdeorum:hammer/crushed_blackstone' })
    e.remove({ id: 'exdeorum:hammer/wood_chippings' })
    e.remove({ id: 'exdeorum:hammer/crushed_deepslate' })
    e.remove({ id: 'exdeorum:hammer/crushed_netherrack' })
    e.remove({ id: 'exdeorum:hammer/crushing_red_sandstone' })
    e.remove({ id: 'exdeorum:hammer/crushing_stone_bricks' })
    e.remove({ id: 'exdeorum:hammer/fire_coral_fan' })
    e.remove({ id: 'exdeorum:hammer/bubble_coral_fan' })
    e.remove({ id: 'exdeorum:hammer/crushed_end_stone' })
    e.remove({ id: 'exdeorum:hammer/horn_coral_fan' })
    e.remove({ id: 'exdeorum:hammer/gravel' })
    e.remove({ id: 'exdeorum:hammer/stone_pebbles' })
    e.remove({ id: 'exdeorum:hammer/red_sand' })
    e.remove({ id: 'exdeorum:hammer/tube_coral' })
    e.remove({ id: 'exdeorum:hammer/bubble_coral' })
    e.remove({ id: 'exdeorum:compressed_hammer/crushed_blackstone' })
    e.remove({ id: 'exdeorum:compressed_hammer/crushed_end_stone' })
    e.remove({ id: 'exdeorum:compressed_hammer/gravel' })
    e.remove({ id: 'exdeorum:compressed_hammer/crushed_netherrack' })
    e.remove({ id: 'exdeorum:compressed_hammer/crushed_deepslate' })
    e.remove({ id: 'exdeorum:compressed_hammer/red_sand' })
    e.remove({ id: 'exdeorum:compressed_hammer/sand' })
    e.remove({ id: 'exdeorum:compressed_hammer/dust' })
    e.remove({ id: 'exdeorum:mechanical_hammer' })
    e.remove({ id: 'exdeorum:cobblestone' })
    e.remove({ id: 'exdeorum:diorite' })
    e.remove({ id: 'exdeorum:granite' })
    e.remove({ id: 'exdeorum:andesite' })
    e.remove({ id: 'exdeorum:deepslate' })
    e.remove({ id: 'exdeorum:tuff' })
    e.remove({ id: 'exdeorum:calcite' })
    e.remove({ id: 'exdeorum:blackstone' })
    e.remove({ id: 'exdeorum:basalt' })
    e.remove({ id: 'exdeorum:iron_ore' })
    e.remove({ id: 'exdeorum:copper_ore' })
    e.remove({ id: 'exdeorum:gold_ore' })
    e.remove({ id: 'exdeorum:aluminum_ore' })
    e.remove({ id: 'exdeorum:silver_ore' })
    e.remove({ id: 'exdeorum:lead_ore' })
    e.remove({ id: 'exdeorum:nickel_ore' })
    e.remove({ id: 'exdeorum:uranium_ore' })
    e.remove({ id: 'exdeorum:osmium_ore' })
    e.remove({ id: 'exdeorum:tin_ore' })
    e.remove({ id: 'exdeorum:zinc_ore' })
    e.remove({ id: "exdeorum:barrel_mixing/clay" })
    e.remove({ id: 'exdeorum:crucible_heat_source/fire' })

    e.remove({ type: 'exdeorum:compressed_sieve' })
    e.remove({ type: 'exdeorum:sieve' })
    e.remove({ type: 'exdeorum:hammer' })
    e.remove({ type: 'exdeorum:compressed_hammer' })

    e.replaceInput({ id: 'exdeorum:end_cake'}, 'exdeorum:crushed_end_stone', 'havenalchemy:crushed_end_stone')

    heatSource("havenalchemy:aether_fuel_block", 10)
    heatSource("havenalchemy:havenite_block", 12)
    heatSource("mekanism:block_uranium", 6)
    heatSource("havenalchemy:neosphore_block", 15)

    lavaCrucible(350, "minecraft:lava", "havenalchemy:basphalt_stone")
    
    barrelMixing("minecraft:water", 1000, "havenalchemy:dust", "minecraft:clay")
})