// Made by the Project Minecolonies Developers – please don't use, share, or modify in other modpacks without our permission.  
// For questions or permissions, reach out to the Project Minecolonies team on Discord or Github.  

ClientEvents.lang('en_us', event => {
    console.info('Refined Storage rename script loaded');
    
    const colors = [
        'white','orange','magenta','light_blue','yellow','lime','pink','gray',
        'light_gray','cyan','purple','blue','brown','green','red','black'
    ];

    // === Controllers ===
    try {
        event.renameItem('refinedstorage:creative_controller', 'Controller');
        console.info('Renamed creative_controller');
    } catch (e) {
        console.warn('Failed to rename creative_controller: ' + e);
    }
    
    colors.forEach(color => {
        try {
            event.renameItem(`refinedstorage:${color}_creative_controller`, 'Controller');
        } catch (e) {
            // Silently skip missing colored controllers
        }
    });

    // === Processors ===
    try {
        event.renameItem('refinedstorage:basic_processor', 'Apprentice Core');
        event.renameItem('refinedstorage:improved_processor', 'Journeyman Core');
        event.renameItem('refinedstorage:advanced_processor', 'Masterwork Core');
        console.info('Renamed processors');
    } catch (e) {
        console.warn('Failed to rename processors: ' + e);
    }

    // === Raw Processors ===
    try {
        event.renameItem('refinedstorage:raw_basic_processor', 'Unfinished Apprentice Core');
        event.renameItem('refinedstorage:raw_improved_processor', 'Unfinished Journeyman Core');
        event.renameItem('refinedstorage:raw_advanced_processor', 'Unfinished Masterwork Core');
        console.info('Renamed raw processors');
    } catch (e) {
        console.warn('Failed to rename raw processors: ' + e);
    }

    // === Other Components ===
    try {
        event.renameItem('refinedstorage:processor_binding', 'Slimey Fittings');
        event.renameItem('refinedstorage:silicon', 'Polished Quartz');
        console.info('Renamed other components');
    } catch (e) {
        console.warn('Failed to rename other components: ' + e);
    }

    // === Functional Cores ===
    try {
        event.renameItem('refinedstorage:construction_core', "Builder's Seal");
        event.renameItem('refinedstorage:destruction_core', "Miner's Seal");
        console.info('Renamed functional cores');
    } catch (e) {
        console.warn('Failed to rename functional cores: ' + e);
    }
    
    console.info('Refined Storage rename script finished');
});

// Made by the Project Minecolonies Developers – please don't use, share, or modify in other modpacks without our permission.  
// For questions or permissions, reach out to the Project Minecolonies team on Discord or Github.