Example #1
0
 public virtual void Func_22094_a(net.minecraft.src.WorldInfo worldinfo)
 {
     net.minecraft.src.NBTTagCompound nbttagcompound  = worldinfo.Func_22185_a();
     net.minecraft.src.NBTTagCompound nbttagcompound1 = new net.minecraft.src.NBTTagCompound
                                                            ();
     nbttagcompound1.SetTag("Data", nbttagcompound);
     try
     {
         string file  = System.IO.Path.Combine(worldDir, "level.dat_new");
         string file1 = System.IO.Path.Combine(worldDir, "level.dat_old");
         string file2 = System.IO.Path.Combine(worldDir, "level.dat");
         using (FileStream fs = File.OpenWrite(file))
             net.minecraft.src.CompressedStreamTools.WriteGzippedCompoundToOutputStream(nbttagcompound1, fs);
         if (File.Exists(file1))
         {
             File.Delete(file1);
         }
         File.Move(file2, file1);
         if (File.Exists(file2))
         {
             File.Delete(file2);
         }
         File.Move(file, file2);
         if (File.Exists(file))
         {
             File.Delete(file);
         }
     }
     catch (System.Exception exception)
     {
         Sharpen.Runtime.PrintStackTrace(exception);
     }
 }