private void GenerateMountainPlains(int bix, int biz, int baseLandHeight, int x, int z)
        {
            float caveMask = noise.GetSimplex(bix * 0.3f, biz * 0.3f) + 0.3f;

            BlockType lastBlock = BlockType.AIR;

            for (int y = 0; y < ChunkSizeY; y++)
            {
                float     caveNoise = noise.GetPerlinFractal(bix * 7.5f, y * 15f, biz * 7.5f);
                BlockType blockType = BlockType.AIR;

                if (caveNoise > math.max(caveMask, 0.2f))
                {
                    blockType = BlockType.AIR;
                }
                else if (y < baseLandHeight && caveNoise > math.max(caveMask, 0.2f) * 0.9f)
                {
                    blockType = BlockType.COBBLESTONE;
                }
                else if (y <= baseLandHeight)
                {
                    if (y == baseLandHeight && y > WaterLevelY - 1)
                    {
                        blockType = WorldData.CanPlaceGrass(lastBlock) && random.NextFloat() < 0.025f ? BlockType.GRASS : BlockType.AIR;
                    }
                    else if (y > baseLandHeight * 0.95)
                    {
                        blockType = BlockType.GRASS_BLOCK;
                    }
                    else
                    {
                        blockType = BlockType.STONE;
                    }
                }

                if (y >= baseLandHeight && y <= WaterLevelY)
                {
                    blockType = BlockType.WATER;
                }

                if (y <= noise.GetWhiteNoise(bix, biz) * 3)
                {
                    blockType = BlockType.OBSIDIAN;
                }

                lastBlock = blockData[Utils.BlockPosition3DtoIndex(x, y, z)] = blockType;

                if (lastBlock == BlockType.GRASS)       // assing random block type to grass
                {
                    blockParameters.TryAdd(new BlockParameter(new int3(x, y, z), ParameterType.BLOCK_TYPE), (short)random.NextInt(0, 3));
                }
                else if (lastBlock == BlockType.WATER)  // set source distance to 8 (full water block)
                {
                    blockParameters.TryAdd(new BlockParameter(new int3(x, y, z), ParameterType.WATER_SOURCE_DISTANCE), 8);
                }
            }
        }
        public BlockType[] GetBlockTypes()
        {
            List <BlockType> blocks = new List <BlockType>();

            foreach (BlockType type in System.Enum.GetValues(typeof(BlockType)))
            {
                if (WorldData.CanPlaceGrass(type))
                {
                    blocks.Add(type);
                }
            }
            return(blocks.ToArray());
        }