// priority: 0

// Visit the wiki for more info - https://kubejs.com/

// onEvent('recipes', event => {
    
ServerEvents.recipes(event => {

    let siftingRecipe = (mesh, input, timeToProcess, chance, result, count) => {
        event.custom({
            type: "createsifter:sifting",
            ingredients: [
                {
                    item: mesh
                },
                {
                    item: input
                }
            ],
            processingTime: timeToProcess,
            results: [
                {
                    chance: chance,
                    item: result,
                    count: count
                }
            ]
        })
    }

    // freezingRecipeWithAdditionalChance('minecraft:blaze_powder', 'kubejs:lukewarm_powder', 1, 0.15)
    // event.recipes.create.crushing([Item.of('thermal:blizz_powder', 1), Item.of('thermal:blizz_powder', 1).withChance(0.25)], 'kubejs:lukewarm_powder')
    event.recipes.create.compacting([Item.of('minecraft:snowball')], [Fluid.of('kubejs:soft_snow', 500)]).id('bttk:compacting/snowball_from_soft_snow')

    event.smelting('kubejs:obsidian_ingot', 'create:powdered_obsidian')
    event.blasting('kubejs:obsidian_ingot', 'create:powdered_obsidian')

    // siftingRecipe('createsifter:zinc_mesh', 'minecraft:end_stone', 200, 1.0, 'createsifter:crushed_end_stone', 1)
    event.custom({
        type: "createsifter:sifting",
        ingredients: [
            {
                item: 'createsifter:advanced_brass_mesh'
            },
            {
                item: 'createsifter:crushed_end_stone'
            }
        ],
        processingTime: 200,
        results: [
            {
                chance: 0.05,
                item: 'create:crushed_raw_silver',
                count: 1
            },
            {
                chance: 0.15,
                item: 'create:crushed_raw_tin',
                count: 1
            },
            {
                chance: 0.10,
                item: 'create:crushed_raw_nickel',
                count: 1
            },
            {
                chance: 0.10,
                item: 'create:crushed_raw_lead',
                count: 1
            },
            {
                chance: 0.10,
                item: 'thermal:cinnabar',
                count: 1
            },
            {
                chance: 0.05,
                item: 'thermal:niter',
                count: 1
            },
            {
                chance: 0.02,
                item: 'thermal:apatite',
                count: 1
            },
            {
                chance: 0.10,
                item: 'create:experience_nugget',
                count: 1
            }
        ]
    }).id('bttk:sifting/thermal_ores_from_sifting')

    event.shapeless('minecraft:diamond', '9x kubejs:diamond_shard').id('bttk:diamond_from_diamond_shards')
    event.shapeless('9x kubejs:diamond_shard', 'minecraft:diamond').id('bttk:diamond_shards_from_diamond')

    event.remove('create:compat/ae2/milling/ender_pearl')

    event.remove('create_oppenheimered:deploying/precision_mechanism_from_telecore')
    event.remove('create:sequenced_assembly/precision_mechanism')

    event.shaped('kubejs:brass_gear', [
        ' A ',
        'ABA',
        ' A '
    ], {
        A: 'create:brass_ingot',
        B: 'minecraft:iron_nugget'
    }).id('bttk:brass_gear')
    event.recipes.thermal.press('kubejs:brass_gear', ['4x create:brass_ingot', 'thermal:press_gear_die']).id('bttk:thermal/machines/press/press_brass_ingot_into_gear')

    event.shaped('kubejs:gold_hand', [
        ' A ',
        'BBB',
        ' B '
    ], {
        A: 'create:andesite_alloy',
        B: '#forge:plates/gold'
    }).id('bttk:golden_hand')

    event.recipes.create.mixing('kubejs:refined_silicon', ['ae2:silicon', 'ae2:fluix_dust']).id('bttk:mixing/refined_silicon')

    event.recipes.thermal.smelter('garnished:preliminary_nucleus', ['4x minecraft:ender_pearl', '2x garnished:dimmed_scale', 'hibernalherbs:dried_sage']).energy(6000)

    event.recipes.create.crushing([Item.of('minecraft:netherite_scrap', 1), Item.of('minecraft:netherite_scrap', 1).withChance(0.25)], 'minecraft:ancient_debris')

    event.remove('create:sequenced_assembly/sturdy_sheet')
    let incompleteSturdySheet = 'create:unprocessed_obsidian_sheet'
    event.recipes.create.sequenced_assembly([
        Item.of('create:sturdy_sheet', 1)
    ], 'create:powdered_obsidian', [
        event.recipes.create.filling(incompleteSturdySheet, [incompleteSturdySheet, Fluid.of('kubejs:hellish_essence', 500)]),
        event.recipes.create.pressing(incompleteSturdySheet, [incompleteSturdySheet]),
        event.recipes.create.pressing(incompleteSturdySheet, [incompleteSturdySheet])
    ]).transitionalItem(incompleteSturdySheet).loops(1).id('bttk:sequenced_assembly/sturdy_sheet_from_hellish_fuel')
    event.recipes.create.sequenced_assembly([
        Item.of('create:sturdy_sheet', 1)
    ], 'create:powdered_obsidian', [
        event.recipes.create.filling(incompleteSturdySheet, [incompleteSturdySheet, Fluid.of('minecraft:lava', 250)]),
        event.recipes.create.pressing(incompleteSturdySheet, [incompleteSturdySheet]),
        event.recipes.create.pressing(incompleteSturdySheet, [incompleteSturdySheet])
    ]).transitionalItem(incompleteSturdySheet).loops(1).id('bttk:sequenced_assembly/sturdy_sheet_from_lava')

})