    001    package cpw.mods.fml.relauncher;
    002
    003    import java.io.File;
    004    import java.io.IOException;
    005    import java.io.InputStream;
    006    import java.util.ArrayList;
    007    import java.util.List;
    008    import java.util.Properties;
    009    import java.util.logging.Level;
    010
    011    public class FMLInjectionData
    012    {
    013        static File minecraftHome;
    014        static String major;
    015        static String minor;
    016        static String rev;
    017        static String build;
    018        static String mccversion;
    019        static String mcsversion;
    020        public static List<String> containers = new ArrayList<String>();
    021
    022        static void build(File mcHome, RelaunchClassLoader classLoader)
    023        {
    024            minecraftHome = mcHome;
    025            InputStream stream = classLoader.getResourceAsStream("fmlversion.properties");
    026            Properties properties = new Properties();
    027
    028            if (stream != null)
    029            {
    030                try
    031                {
    032                    properties.load(stream);
    033                }
    034                catch (IOException ex)
    035                {
    036                    FMLRelaunchLog.log(Level.SEVERE, ex, "Could not get FML version information - corrupted installation detected!");
    037                }
    038            }
    039
    040            major = properties.getProperty("fmlbuild.major.number", "missing");
    041            minor = properties.getProperty("fmlbuild.minor.number", "missing");
    042            rev = properties.getProperty("fmlbuild.revision.number", "missing");
    043            build = properties.getProperty("fmlbuild.build.number", "missing");
    044            mccversion = properties.getProperty("fmlbuild.mcclientversion", "missing");
    045            mcsversion = properties.getProperty("fmlbuild.mcserverversion", "missing");
    046
    047
    048        }
    049
    050        public static Object[] data()
    051        {
    052            return new Object[] { major, minor, rev, build, mccversion, mcsversion, minecraftHome, containers };
    053        }
    054    }