add minimum structure spawn range validation from 1.6 branch
wholesale import of 1.6 gen code
minor debug updates