fCraft.Map.MakeFloodBarrier C# (CSharp) Method

MakeFloodBarrier() public method

Makes an admincrete barrier, 1 block thick, around the lower half of the map.
public MakeFloodBarrier ( ) : void
return void
        public void MakeFloodBarrier()
        {
            for ( int x = 0; x < Width; x++ ) {
                for ( int y = 0; y < Length; y++ ) {
                    SetBlock( x, y, 0, Block.Admincrete );
                }
            }

            for ( int x = 0; x < Width; x++ ) {
                for ( int z = 0; z < Height / 2; z++ ) {
                    SetBlock( x, 0, z, Block.Admincrete );
                    SetBlock( x, Length - 1, z, Block.Admincrete );
                }
            }

            for ( int y = 0; y < Length; y++ ) {
                for ( int z = 0; z < Height / 2; z++ ) {
                    SetBlock( 0, y, z, Block.Admincrete );
                    SetBlock( Width - 1, y, z, Block.Admincrete );
                }
            }
        }

Usage Example

Example #1
0
        internal static void GenerateFlatgrass(Map map, bool hollow)
        {
            for (int i = 0; i < map.widthX; i++)
            {
                for (int j = 0; j < map.widthY; j++)
                {
                    if (!hollow)
                    {
                        for (int k = 1; k < map.height / 2 - 1; k++)
                        {
                            if (k < map.height / 2 - 5)
                            {
                                map.SetBlock(i, j, k, Block.Stone);
                            }
                            else
                            {
                                map.SetBlock(i, j, k, Block.Dirt);
                            }
                        }
                    }
                    map.SetBlock(i, j, map.height / 2 - 1, Block.Grass);
                }
            }

            map.MakeFloodBarrier();
        }
All Usage Examples Of fCraft.Map::MakeFloodBarrier