// priority: 0

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

// onEvent('recipes', event => {
    
ServerEvents.recipes(event => {
    let nuts = ['cashew', 'walnut', 'almond', 'pecan', 'pistachio', 'macadamia', 'peanut', 'hazelnut', 'chestnut']
    nuts.forEach(i => {
        event.remove(`garnished_additions:deploying/salted_${i}`)
        event.recipes.create.deploying(`garnished_additions:salted_${i}`, [`garnished:${i}`, 'garnished:salt_compound']).id(`bttk:deploying/salted_${i}`)
    })
    
    event.recipes.thermal.insolator([Item.of('garnished_additions:ethereal_berries', 2), Item.of('garnished_additions:ethereal_roots', 1).withChance(0.10)], 'garnished_additions:ethereal_berries')

    event.recipes.create.milling([Item.of('createsifter:crushed_end_stone').withChance(0.15), Item.of('garnished_additions:ethereal_roots', 1).withChance(0.45)], 'garnished_additions:rooted_end_stone')
    event.recipes.create.crushing(['createsifter:crushed_end_stone', Item.of('garnished_additions:ethereal_roots', 1), Item.of('garnished_additions:ethereal_roots', 1).withChance(0.15)], 'garnished_additions:rooted_end_stone')

    event.remove('garnished_additions:melted_cinder_flour_nut_mix')
    event.recipes.create.mixing('garnished_additions:melted_cinder_flour_nut_mix', [
        `garnished:melted_cinder_cashew`,
        'garnished:melted_cinder_walnut',
        'garnished:melted_cinder_almond',
        'garnished:melted_cinder_pecan',
        'garnished:melted_cinder_pistachio',
        'garnished:melted_cinder_macadamia',
        'garnished:melted_cinder_peanut',
        'garnished:melted_cinder_hazelnut',
        'garnished:melted_cinder_chestnut']).heated()

    event.remove('garnished_additions:mixing/shadow_steel')
    event.remove('garnished_additions:mixing/refined_radiance')
    event.remove('garnished_additions:mixing/chromatic_compound')
    event.remove('garnished_additions:mixing/nutium_ingot')
    event.remove('garnished_additions:mixing/honey_block')
	event.remove({ output: 'create:shadow_steel_casing' })
	event.remove({ output: 'create:refined_radiance_casing' })

    event.recipes.thermal.pulverizer([Item.of('kubejs:cursed_essence', 1).withChance(0.4), Item.of('kubejs:cursed_essence', 1).withChance(0.2), Item.of('kubejs:blessed_essence', 1).withChance(0.4), Item.of('kubejs:blessed_essence', 1).withChance(0.2)], 'create:chromatic_compound')

    event.recipes.create.mixing(Fluid.of('kubejs:peculiar_substance', 100), [Fluid.of('garnished:dragon_breath', 100), Fluid.of('thermal:ender', 100)]).heated().id('bttk:mixing/peculiar_substance')

    event.recipes.thermal.chiller('create:chromatic_compound', [Fluid.of('kubejs:peculiar_substance', 1000), 'kubejs:chiller_compound_cast']).id('bttk:blast_chiller/chromatic_compound')

    event.recipes.create.deploying('create:shadow_steel', ['create:chromatic_compound', 'kubejs:cursed_essence'])
    event.recipes.create.deploying('create:refined_radiance', ['create:chromatic_compound', 'kubejs:blessed_essence'])

    event.recipes.create.compacting('kubejs:corrupted_alloy', ['create:refined_radiance', 'create:shadow_steel']).superheated().id('bttk:compacting/corrupted_alloy')

    let incompleteBotanicalAlloy = 'kubejs:incomplete_botanical_alloy'
    event.recipes.create.sequenced_assembly([
        Item.of('kubejs:botanical_alloy', 1)
    ], 'kubejs:corrupted_alloy', [
        event.recipes.create.deploying(incompleteBotanicalAlloy, [incompleteBotanicalAlloy, '#garnished:garnished_nuts'])
    ]).transitionalItem(incompleteBotanicalAlloy).loops(64).id('bttk:sequenced_assembly/botanical_alloy')
    let incompleteHellfireAlloy = 'kubejs:incomplete_hellfire_alloy'
    event.recipes.create.sequenced_assembly([
        Item.of('kubejs:hellfire_alloy', 1)
    ], 'kubejs:corrupted_alloy', [
        event.recipes.create.deploying(incompleteHellfireAlloy, [incompleteHellfireAlloy, 'minecraft:crimson_fungus']),
        event.recipes.create.deploying(incompleteHellfireAlloy, [incompleteHellfireAlloy, 'minecraft:warped_fungus']),
        event.recipes.create.deploying(incompleteHellfireAlloy, [incompleteHellfireAlloy, 'garnished:sepia_fungus'])
    ]).transitionalItem(incompleteHellfireAlloy).loops(64).id('bttk:sequenced_assembly/hellfire_alloy')
    let incompleteSpectralAlloy = 'kubejs:incomplete_spectral_alloy'
    event.recipes.create.sequenced_assembly([
        Item.of('kubejs:spectral_alloy', 1)
    ], 'kubejs:corrupted_alloy', [
        event.recipes.create.deploying(incompleteSpectralAlloy, [incompleteSpectralAlloy, 'garnished:aureate_shrub']),
        event.recipes.create.deploying(incompleteSpectralAlloy, [incompleteSpectralAlloy, 'garnished:aureate_shrub']),
        event.recipes.create.filling(incompleteSpectralAlloy, [incompleteSpectralAlloy, Fluid.of('garnished:dragon_breath', 100)])
    ]).transitionalItem(incompleteSpectralAlloy).loops(64).id('bttk:sequenced_assembly/spectral_alloy')

    event.recipes.thermal.smelter('garnished_additions:nutium_ingot', ['4x kubejs:botanical_alloy', '4x kubejs:hellfire_alloy', '4x kubejs:spectral_alloy']).energy(64000)
    
    event.shapeless('1x kubejs:nutium_template', ['garnished:garnished_nut_block', 'minecraft:netherite_upgrade_smithing_template']).id('bttk:nutium_template')

    event.shaped('2x kubejs:nutium_template', [
        'ABA',
        'ACA',
        'AAA'
    ], {
        A: 'minecraft:diamond',
        B: 'kubejs:nutium_template',
        C: 'garnished:garnished_nut_block'
    }).id('bttk:nutium_template_duplication')

    event.remove('garnished_additions:sequenced_assembly/nutium_sword')
    event.remove('garnished_additions:sequenced_assembly/nutium_pickaxe')
    event.remove('garnished_additions:sequenced_assembly/nutium_axe')
    event.remove('garnished_additions:sequenced_assembly/nutium_shovel')
    event.remove('garnished_additions:sequenced_assembly/nutium_hoe')
    event.remove('garnished_additions:sequenced_assembly/nutium_helmet')
    event.remove('garnished_additions:sequenced_assembly/nutium_chestplate')
    event.remove('garnished_additions:sequenced_assembly/nutium_leggings')
    event.remove('garnished_additions:sequenced_assembly/nutium_boots')
    event.smithing('garnished_additions:nutium_sword', 'kubejs:nutium_template', 'minecraft:netherite_sword', 'garnished_additions:nutium_ingot').id('bttk:nutium_sword')
    event.smithing('garnished_additions:nutium_pickaxe', 'kubejs:nutium_template', 'minecraft:netherite_pickaxe', 'garnished_additions:nutium_ingot').id('bttk:nutium_pickaxe')
    event.smithing('garnished_additions:nutium_axe', 'kubejs:nutium_template', 'minecraft:netherite_axe', 'garnished_additions:nutium_ingot').id('bttk:nutium_axe')
    event.smithing('garnished_additions:nutium_shovel', 'kubejs:nutium_template', 'minecraft:netherite_shovel', 'garnished_additions:nutium_ingot').id('bttk:nutium_shovel')
    event.smithing('garnished_additions:nutium_hoe', 'kubejs:nutium_template', 'minecraft:netherite_hoe', 'garnished_additions:nutium_ingot').id('bttk:nutium_hoe')
    event.smithing('kubejs:nutium_hatchet', 'kubejs:nutium_template', 'garnished:netherite_hatchet', 'garnished_additions:nutium_ingot').id('bttk:nutium_hatchet')
    event.smithing('garnished_additions:nutium_helmet', 'kubejs:nutium_template', 'minecraft:netherite_helmet', 'garnished_additions:nutium_ingot').id('bttk:nutium_helmet')
    event.smithing('garnished_additions:nutium_chestplate', 'kubejs:nutium_template', 'minecraft:netherite_chestplate', 'garnished_additions:nutium_ingot').id('bttk:nutium_chestplate')
    event.smithing('garnished_additions:nutium_leggings', 'kubejs:nutium_template', 'minecraft:netherite_leggings', 'garnished_additions:nutium_ingot').id('bttk:nutium_leggings')
    event.smithing('garnished_additions:nutium_boots', 'kubejs:nutium_template', 'minecraft:netherite_boots', 'garnished_additions:nutium_ingot').id('bttk:nutium_boots')
    
})