https://github.com/minetest/minetest/blob/master/src/mapgen.cpp#L766