Mojang official mappings file to Yaml icon

Mojang official mappings file to Yaml -----

Convert original mappings .txt file to .yml file, and load it as config to get obfuscated name.



As the tool name, this tool will generate a .yml file from a input official Mojang mappings file. This tool is very helpful for developers to manipulate NMS object using Mojang offical Mappings via Reflect or Handle.
Exported file is just like this:
exported-sample-3.png exported-sample-2.png exported-sample-1.png
Format is defined in README.MD in github project.
And here is a sample usage in my library CrescentLib( https://github.com/awa-crescent/CrescentLib)
Code (Java):
public abstract class MappingsEntry {
    private static YamlConfiguration mappings_entries ;

    static {
        mappings_entries = new YamlConfiguration ( ) ;
        InputStream mappings_stream ;
        try {
            mappings_stream = MappingsEntry. class. getClassLoader ( ). getResource ( "lib/crescent/nms/Mappings.yml" ). openStream ( ) ;
            if (mappings_stream == null ) {
                Bukkit. getLogger ( ). log (Level. SEVERE, "Cannot find embeded mappings file" ) ;
            }
            InputStreamReader mappings_stream_reader = new InputStreamReader (mappings_stream ) ;
            mappings_entries. load (mappings_stream_reader ) ;
            mappings_stream_reader. close ( ) ;
            mappings_stream. close ( ) ;
        } catch ( IOException | InvalidConfigurationException ex ) {
            Bukkit. getLogger ( ). log (Level. SEVERE, "Parsing mappings file failed", ex ) ;
        }
    }

    public static String getObfuscatedName ( String mojang_name ) {
        return mappings_entries. getString (mojang_name ) ;
    }
}
Resource Information
Author:
----------
Total Downloads: 15
First Release: Sep 27, 2024
Last Update: Sep 27, 2024
Category: ---------------
All-Time Rating:
0 ratings
Version -----
Released: --------------------
Downloads: ------
Version Rating:
----------------------
-- ratings