fCraft.FloatingIslandMapGenState.ExpandGround C# (CSharp) Method

ExpandGround() public method

public ExpandGround ( ) : void
return void
        void ExpandGround() {
            Map newMap = new Map( null, map.Width, map.Length, map.Height, false ) {Blocks = (byte[])map.Blocks.Clone()};
            for( int x = 2; x < genParams.MapWidth - 2; x++ ) {
                for( int y = 2; y < genParams.MapLength - 2; y++ ) {
                    for( int z = 2; z < genParams.MapHeight - 2; z++ ) {
                        if( map.GetBlock( x, y, z ) == Block.Air ) {
                            if( HasNeighbors( x, y, z ) ) {
                                newMap.SetBlock( x, y, z, Block.Dirt );
                            }
                        } else {
                            newMap.SetBlock( x, y, z, Block.Stone );
                        }
                    }
                }
                if( x%4 == 0 ) {
                    int percent = x*100/map.Width;
                    ReportProgress( percent/2 + 30, "Expanding (" + percent + "%)..." );
                }
            }
            map = newMap;
        }