// 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('Adding alternative recipes...')

    // Gold Dragon Treasure
    event.shaped(
        'dragonsurvival:gold_dragon_treasure', // output
        ['gN'], // shape
        {
            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:crown'
        }
    ).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')

    // Dragonskin Spell Book (shaped recipe - without dragonskin)
    event.shaped(
        'irons_spellbooks:dragonskin_spell_book', // output
        [
            'O O',
            'NBN', // shape
            'O O'
        ],
        {
            O: 'minecraft:obsidian', // Accepts both regular and crying obsidian
            B: 'irons_spellbooks:ruined_book',
            N: 'minecraft:netherite_ingot'
        }
    ).id('kubejs:dragonskin_spell_book')

    // Dragon Soul (simple diamond recipe)
    event.shapeless('dragonsurvival:dragon_soul', [
        'minecraft:diamond'
    ]).id('kubejs:dragon_soul')

    console.log('All alternative recipes added successfully!')
})