public void scanForLocalVersions()
    {
        File versionPath = new File(Util.minecraftDirectory + "/versions");
        if (!versionPath.exists())
        {
            Log.e("Cannot find version directory.");
            return;
        }
        else if (!versionPath.isDirectory())
        {
            Log.e("Attempted to open version directory but found file.");
            return;
        }
        File[] versionDirectories = versionPath.listFiles();
        Stack<MinecraftVersion> versionStack = new Stack<MinecraftVersion>();
        for (int i = 0; i < versionDirectories.length; i++)
        {
            MinecraftVersion version = MinecraftVersion.fromVersionPath(versionDirectories[i]);
            if (version != null)
            {
                versionStack.add(version);
            }
        }
        if (versionStack.size() == 0)
        {
            return;
        }

        localVersions = new MinecraftVersion[versionStack.size()];
        versionStack.toArray(localVersions);
    }