private bool CanGrow(int height) //no shadows and enough space
{
for (int z = _z + 1; z < _map.Height; ++z)
{
if (GrassTask.CastsShadow(_map.GetBlock(_x, _y, z)))
{
return(false);
}
}
for (int x = _x - 5; x < _x + 5; ++x)
{
for (int y = _y - 5; y < _y + 5; ++y)
{
for (int z = _z + 1; z < _z + height; ++z)
{
Block b = _map.GetBlock(x, y, z);
if (Block.Air != b && Block.Leaves != b)
{
return(false);
}
}
}
}
return(true);
}