Ejemplo n.º 1
0
        /// <summary>
        /// Get All MProfileInfo from mojang server and local
        /// </summary>
        public static MProfileMetadata[] GetProfileMetadatas(Minecraft mc)
        {
            var list = new List <MProfileMetadata>(GetProfileMetadatasFromLocal(mc));

            foreach (var item in GetProfileMetadatasFromWeb())
            {
                if (!list.Contains(item))
                {
                    list.Add(item);
                }
            }
            return(list.ToArray());
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Get All MProfileInfo from local
        /// </summary>
        public static MProfileMetadata[] GetProfileMetadatasFromLocal(Minecraft mc)
        {
            var dirs = new DirectoryInfo(mc.Versions).GetDirectories();
            var arr  = new List <MProfileMetadata>(dirs.Length);

            foreach (var dir in dirs)
            {
                var filepath = Path.Combine(dir.FullName, dir.Name + ".json");
                if (!File.Exists(filepath))
                {
                    continue;
                }
                var info = new MProfileMetadata();
                info.IsWeb = false;
                info.Name  = dir.Name;
                info.Path  = filepath;
                info.Type  = "local";
                info.MType = MProfileType.Custom;
                arr.Add(info);
            }

            return(arr.ToArray());
        }
Ejemplo n.º 3
0
 public MForge(Minecraft mc)
 {
     this.Minecraft = mc;
 }