    001package net.minecraft.stats;
    002
    003import java.io.BufferedReader;
    004import java.io.InputStreamReader;
    005import java.util.HashMap;
    006import java.util.Map;
    007
    008public class AchievementMap
    009{
    010    /** Holds the singleton instance of AchievementMap. */
    011    public static AchievementMap instance = new AchievementMap();
    012
    013    /** Maps a achievement id with it's unique GUID. */
    014    private Map guidMap = new HashMap();
    015
    016    private AchievementMap()
    017    {
    018        try
    019        {
    020            BufferedReader bufferedreader = new BufferedReader(new InputStreamReader(AchievementMap.class.getResourceAsStream("/achievement/map.txt")));
    021            String s;
    022
    023            while ((s = bufferedreader.readLine()) != null)
    024            {
    025                String[] astring = s.split(",");
    026                int i = Integer.parseInt(astring[0]);
    027                this.guidMap.put(Integer.valueOf(i), astring[1]);
    028            }
    029
    030            bufferedreader.close();
    031        }
    032        catch (Exception exception)
    033        {
    034            exception.printStackTrace();
    035        }
    036    }
    037
    038    /**
    039     * Returns the unique GUID of a achievement id.
    040     */
    041    public static String getGuid(int par0)
    042    {
    043        return (String)instance.guidMap.get(Integer.valueOf(par0));
    044    }
    045}