OpenMinecraft.InfdevHandler.ForEachChunk C# (CSharp) Method

ForEachChunk() public method

public ForEachChunk ( ChunkIteratorDelegate cmd ) : void
cmd ChunkIteratorDelegate
return void
        public override void ForEachChunk(ChunkIteratorDelegate cmd)
        {
            string[] f = Directory.GetFiles(mFolder, "c*.*.dat", SearchOption.AllDirectories);
            int Complete = 0;
            foreach (string file in f)
            {

                if (ForEachProgress != null)
                    ForEachProgress(f.Length, Complete++);
                //if(_DEBUG) Console.WriteLine(Path.GetExtension(file));
                if (Path.GetExtension(file) == "dat") continue;
                if (file.EndsWith(".genlock")) continue;
                NbtFile nf = new NbtFile(file);
                try
                {
                    nf.LoadFile();
                    NbtCompound Level = (NbtCompound)nf.RootTag["Level"];
                    long x = (Level["xPos"] as NbtInt).Value;
                    long y = (Level["zPos"] as NbtInt).Value;
                    nf.Dispose();
                    cmd(this, x, y);
                }
                catch (Exception e)
                {
                    if (CorruptChunk != null)
                    {
                        Vector2i pos = GetChunkCoordsFromFile(file);
                        if(pos!=null)
                            CorruptChunk(pos.X, pos.Y, "[" + Complete.ToString() + "]" + e.ToString(), file);
                    }
                    //    continue;
                }
            }
            // This MUST be done.
            ForEachProgress = null;
        }
        public override void ForEachChunkFile(int dimension, ChunkFileIteratorDelegate cmd)