コード例 #1
0
        /// <summary>
        /// Converts the specified map to the new map format. Args: worldName, loadingScreen
        /// </summary>
        public override bool ConvertMapFormat(string par1Str, IProgressUpdate par2IProgressUpdate)
        {
            par2IProgressUpdate.SetLoadingProgress(0);
            List <string> arraylist  = new List <string>();
            List <string> arraylist1 = new List <string>();
            List <string> arraylist2 = new List <string>();
            string        file       = IOPath.Combine(SavesDirectory, par1Str);
            string        file1      = IOPath.Combine(file, "DIM-1");
            string        file2      = IOPath.Combine(file, "DIM1");

            Console.WriteLine("Scanning folders...");
            Func_48432_a(file, arraylist);

            if (File.Exists(file1))
            {
                Func_48432_a(file1, arraylist1);
            }

            if (File.Exists(file2))
            {
                Func_48432_a(file2, arraylist2);
            }

            int i = arraylist.Count + arraylist1.Count + arraylist2.Count;

            Console.WriteLine((new StringBuilder()).Append("Total conversion count is ").Append(i).ToString());
            WorldInfo worldinfo = GetWorldInfo(par1Str);
            object    obj       = null;

            if (worldinfo.GetTerrainType() == WorldType.FLAT)
            {
                obj = new WorldChunkManagerHell(BiomeGenBase.Plains, 0.5F, 0.5F);
            }
            else
            {
                obj = new WorldChunkManager(worldinfo.GetSeed(), worldinfo.GetTerrainType());
            }

            Func_48428_a(IOPath.Combine(file, "region"), arraylist, ((WorldChunkManager)(obj)), 0, i, par2IProgressUpdate);
            Func_48428_a(IOPath.Combine(file1, "region"), arraylist1, new WorldChunkManagerHell(BiomeGenBase.Hell, 1.0F, 0.0F), arraylist.Count, i, par2IProgressUpdate);
            Func_48428_a(IOPath.Combine(file2, "region"), arraylist2, new WorldChunkManagerHell(BiomeGenBase.Sky, 0.5F, 0.0F), arraylist.Count + arraylist1.Count, i, par2IProgressUpdate);
            worldinfo.SetSaveVersion(19133);

            if (worldinfo.GetTerrainType() == WorldType.DEFAULT_1_1)
            {
                worldinfo.SetTerrainType(WorldType.DEFAULT);
            }

            createFile(par1Str);
            ISaveHandler isavehandler = GetSaveLoader(par1Str, false);

            isavehandler.SaveWorldInfo(worldinfo);
            return(true);
        }
コード例 #2
0
 /// <summary>
 /// creates a new world chunk manager for WorldProvider
 /// </summary>
 public override void RegisterWorldChunkManager()
 {
     WorldChunkMgr = new WorldChunkManagerHell(BiomeGenBase.Sky, 0.5F, 0.0F);
     TheWorldType  = 1;
     HasNoSky      = true;
 }