Пример #1
0
        private void Func_22107_a(string file, List <ChunkFile> arraylist, int i, int j, net.minecraft.src.IProgressUpdate iprogressupdate)
        {
            arraylist.Sort();
            byte[] abyte0 = new byte[4096];
            int    i1;

            for (System.Collections.IEnumerator iterator = arraylist.GetEnumerator(); iterator
                 .MoveNext(); iprogressupdate.SetLoadingProgress(i1))
            {
                net.minecraft.src.ChunkFile chunkfile = (net.minecraft.src.ChunkFile)iterator.Current;
                int k = chunkfile.Func_22205_b();
                int l = chunkfile.Func_22204_c();
                net.minecraft.src.RegionFile regionfile = net.minecraft.src.RegionFileCache.Func_22123_a
                                                              (file, k, l);
                if (!regionfile.IsChunkSaved(k & 0x1f, l & 0x1f))
                {
                    try
                    {
                        using (FileStream fs = File.OpenRead(chunkfile.Func_22207_a()))
                            using (GZipStream ds = new GZipStream(fs, CompressionMode.Decompress))
                            {
                                java.io.DataInputStream datainputstream = new java.io.DataInputStream(ds);
                                //java.io.DataInputStream datainputstream = new java.io.DataInputStream(new java.util.zip.GZIPInputStream(new java.io.FileInputStream(chunkfile.Func_22207_a())));
                                java.io.DataOutputStream dataoutputstream = regionfile.GetChunkDataOutputStream(k & 0x1f, l & 0x1f);
                                for (int j1 = 0; (j1 = datainputstream.Read(abyte0)) != -1;)
                                {
                                    dataoutputstream.Write(abyte0, 0, j1);
                                }
                                dataoutputstream.Close();
                                datainputstream.Close();
                            }
                    }
                    catch (System.IO.IOException ioexception)
                    {
                        Sharpen.Runtime.PrintStackTrace(ioexception);
                    }
                }
                i++;
                i1 = (int)System.Math.Round((100D * (double)i) / (double)j);
            }
            net.minecraft.src.RegionFileCache.Func_22122_a();
        }
Пример #2
0
 public static java.io.DataOutputStream Func_22120_d(string file, int i, int
                                                     j)
 {
     net.minecraft.src.RegionFile regionfile = Func_22123_a(file, i, j);
     return(regionfile.GetChunkDataOutputStream(i & 0x1f, j & 0x1f));
 }