fCraft.MapGeneratorOld.SealLiquids C# (CSharp) Method

SealLiquids() private static method

private static SealLiquids ( Map map, byte sealantType ) : void
map Map
sealantType byte
return void
        private static void SealLiquids( Map map, byte sealantType )
        {
            for ( int x = 1; x < map.Width - 1; x++ ) {
                for ( int z = 1; z < map.Height; z++ ) {
                    for ( int y = 1; y < map.Length - 1; y++ ) {
                        int index = map.Index( x, y, z );
                        if ( ( map.Blocks[index] == 10 || map.Blocks[index] == 11 || map.Blocks[index] == 8 || map.Blocks[index] == 9 ) &&
                            ( map.GetBlock( x - 1, y, z ) == Block.Air || map.GetBlock( x + 1, y, z ) == Block.Air ||
                            map.GetBlock( x, y - 1, z ) == Block.Air || map.GetBlock( x, y + 1, z ) == Block.Air ||
                            map.GetBlock( x, y, z - 1 ) == Block.Air ) ) {
                            map.Blocks[index] = sealantType;
                        }
                    }
                }
            }
        }