// Priority: 0

ServerEvents.recipes(event => {

    // ==========================================================================
    // 1. RECIPE REMOVALS
    // ==========================================================================
    
    const recipesByID = [
        // World & Progression
        'incendium:upgrade_elytra', 
        'minecraft:bread',
        'minecraft:cake',
        'chas:leather_horse_armor',

        // RPG & Combat
        'forcemaster_rpg:golden_knuckle',

        // Early Stage & Utility
        'explorerscompass:explorers_compass',
        'explorerscompass:explorers_compass_alternate',

        // No Tree Punching (Processing & Sticks)
        'notreepunching:sticks_from_logs_with_saw',
        'notreepunching:sticks_from_logs_with_flint_axe',
        'notreepunching:sticks_from_planks_with_saw',
        'notreepunching:sticks_from_planks_with_flint_axe',
        'notreepunching:clay_brick_from_blocks',
        'notreepunching:clay_brick_from_balls',
    ];

    recipesByID.forEach(recipeID => {
        event.remove({ id: recipeID });
    });

    // Global Tool Nuke
    event.remove({ input: 'notreepunching:flint_knife' });

    // ==========================================================================
    // 2. SHAPED & SHAPELESS RECIPES
    // ==========================================================================
    event.shaped('minecraft:iron_horse_armor',   ['  H', 'IBI', 'I I'], { H: 'minecraft:iron_helmet', I: 'minecraft:iron_ingot', B: 'minecraft:iron_block' });
    event.shaped('minecraft:golden_horse_armor', ['  H', 'IBI', 'I I'], { H: 'minecraft:golden_helmet', I: 'minecraft:gold_ingot', B: 'minecraft:gold_block' });
    event.shaped('minecraft:diamond_horse_armor', ['  H', 'IBI', 'I I'], { H: 'minecraft:diamond_helmet', I: 'minecraft:diamond', B: 'minecraft:diamond_block' });

    // ==========================================================================
    // 3. SMITHING RECIPES (Knight Sets)
    // ==========================================================================
    const knightSets = [
        { stone: 'death_knights:blood_stone',  output: 'death_knights:crimson_guard_armor' },
        { stone: 'death_knights:unholy_stone', output: 'death_knights:plaguebringer_armor' },
        { stone: 'runes:frost_stone',          output: 'death_knights:frozen_champion_armor' }
    ];
    
    knightSets.forEach(set => {
        ['head', 'chest', 'legs', 'feet'].forEach(piece => {
            event.smithing(`${set.output}_${piece}`, 'minecraft:iron_block', `death_knights:initiate_armor_${piece}`, set.stone);
        });
    });
});