// Copyright © 2023 Kerberus. All rights reserved.
ServerEvents.tags('item', event => {
    // Disable Iron's Jewelry items from curios slots
    console.log('Disabling Iron\'s Jewelry items...')
    
    const jewelryItems = [
        'irons_jewelry:copper_ring',
        'irons_jewelry:gold_ring', 
        'irons_jewelry:silver_ring',
        'irons_jewelry:copper_necklace',
        'irons_jewelry:gold_necklace',
        'irons_jewelry:silver_necklace'
    ]
    
    jewelryItems.forEach(item => {
        event.remove('curios:ring', item)
        event.remove('curios:necklace', item)
    })
})

ServerEvents.recipes(event => {
    console.log('Fixing broken recipes and adding alternatives...')
    
    const brokenRecipes = [
        'unusual_furniture:service_bench',
        'unusual_furniture:spruce_bench_craft',
        'create_things_and_misc:raboutan_sail_c_raft',
        'create_things_and_misc:jaboticaba_sail_craft', 
        'create_things_and_misc:schematic_chair',
        'create_things_and_misc:copper_scaffolding_craft',
        'dustydecorations:bucket_o_coins_recipe',
        'dustydecorations:gold_pile_reverse_recipe'
    ]
    
    brokenRecipes.forEach(recipe => {
        event.remove({ id: recipe })
    })
    
    // Gold Dragon Treasure
    event.shaped('dragonsurvival:gold_dragon_treasure', ['gN'], {
        'g': 'minecraft:gold_ingot',
        'N': 'numismatics:sprocket'
    }).id('kubejs:alt_gold_dragon_treasure')
    
    // Iron Dragon Treasure  
    event.shaped('dragonsurvival:iron_dragon_treasure', ['iN'], {
        'i': 'minecraft:iron_ingot',
        'N': 'numismatics:bevel'
    }).id('kubejs:alt_iron_dragon_treasure')
    
    // Copper Dragon Treasure
    event.shaped('dragonsurvival:copper_dragon_treasure', ['cN'], {
        'c': 'minecraft:copper_ingot',
        'N': 'numismatics:spur'
    }).id('kubejs:alt_copper_dragon_treasure')
    
    // Chocolate Dragon Treasure
    event.shaped('dragonsurvival:chocolate_dragon_treasure', ['#N'], {
        '#': 'create:bar_of_chocolate',
        'N': 'numismatics:spur'
    }).id('kubejs:alt_chocolate_dragon_treasure')
    
    // Debris Dragon Treasure
    event.shaped('dragonsurvival:debris_dragon_treasure', ['#N'], {
        '#': 'minecraft:netherite_scrap',
        'N': 'numismatics:sun'
    }).id('kubejs:alt_debris_dragon_treasure')
    
    // Diamond Dragon Treasure
    event.shaped('dragonsurvival:diamond_dragon_treasure', ['#N'], {
        '#': 'minecraft:diamond',
        'N': 'numismatics:cog'
    }).id('kubejs:alt_diamond_dragon_treasure')
    
    // Emerald Dragon Treasure
    event.shaped('dragonsurvival:emerald_dragon_treasure', ['#N'], {
        '#': 'minecraft:emerald',
        'N': 'numismatics:cog'
    }).id('kubejs:alt_emerald_dragon_treasure')
    
    console.log('All fixes applied successfully!')
})