//priority: 0
onEvent('item.tags', event => {

    const tagAdditions = [
        { tag: 'forge:gems/coal', item: 'minecraft:coal' },
        { tag: 'forge:chunks/nebu', item: 'atum:nebu_ore' },
        { tag: 'forge:dusts/coke', item: 'immersivepetroleum:petcoke_dust' },
        { tag: 'forge:chunks/iesnium', item: 'occultism:iesnium_ore' },
        { tag: 'forge:nuggets/dryrubber', item: 'industrialforegoing:tinydryrubber' },
        { tag: 'forge:ingots/dryrubber', item: 'industrialforegoing:dryrubber' },
        { tag: 'botania:generating_primitive_flowers', item: 'botania:hydroangeas' },
        { tag: 'botania:generating_primitive_flowers', item: 'botania:endoflame' },
        { tag: 'forge:gems/dimensional', item: 'rftoolsbase:dimensionalshard' },
        { tag: 'forge:gems', item: 'rftoolsbase:dimensionalshard' }
    ];

    const metalParts = [
        'kubejs:holy_ingot',
        'kubejs:holy_dust',
        'kubejs:holy_plate',
        'kubejs:holy_rod',
        'kubejs:holy_gear',
        'kubejs:holy_block',
        'kubejs:holy_nugget',
        'kubejs:titanium_ingot',
        'kubejs:titanium_dust',
        'kubejs:chromium_ingot',
        'kubejs:chromium_dust',
        'kubejs:vanadium_dust',
        'kubejs:chromium_ore',
        'kubejs:titanium_ore',
        'kubejs:stainless_steel_ingot',
        'kubejs:stainless_steel_dust',
        'kubejs:stainless_steel_plate',
        'kubejs:stainless_steel_rod',
        'kubejs:stainless_steel_gear',
        'kubejs:stainless_steel_block',
        'kubejs:stainless_steel_nugget',
        'kubejs:stainless_steel_sheetmetal',
        'kubejs:aquamarine_block',
        'kubejs:dimension_ingot',
        'kubejs:dimension_plate',
        'kubejs:dimension_rod',
        'kubejs:dimension_gear',
        'kubejs:dimension_block',
        'kubejs:dimension_nugget'
    ]

    const corals = ['tube', 'brain', 'bubble', 'fire', 'horn'];

    tagAdditions.forEach(addition => {
        event.get(addition.tag).add(addition.item);
    });

    metalParts.forEach(metalPart => {
        let index1 = metalPart.indexOf(':');
        let index2 = metalPart.lastIndexOf('_');
        let part = metalPart.substring(index2+1);
        part = part=='block'? 'storage_blocks':part+'s';
        let metal = metalPart.substring(index1+1, index2);
        event.get(`forge:${part}`).add(metalPart);
        event.get(`forge:${part}/${metal}`).add(metalPart);
    });

    corals.forEach(coral => {
        event.get('forge:coral_fans').add(`minecraft:${coral}_coral_fan`);
        event.get('forge:corals').add(`minecraft:${coral}_coral`);
        event.get('forge:coral_blocks').add(`minecraft:${coral}_coral_block`);
    });

    const crushed_ores = ['iron','gold','copper','zinc','osmium','silver','tin','lead','aluminum','uranium','nickel'];
    crushed_ores.forEach(ore => {
        event.get(`create:crushed_ores/${ore}`).add(`create:crushed_${ore}_ore`);
    });

    colors.forEach(color => {
        var id = `quark:${color}_crystal_cluster`;
        if(Item.exists(id)){
            event.get('quark:crystal_cluster').add(id);
        }
    })

})