Fixed multiple flag generation errors and bugs. i.e. Liquids and Topsoil

I fixed the (lack-of) liquid flag generation and made it work with modded/third-party liquids.

I also fixed the world-height bug with flags, when generated too high, would cause an exception.
Fair enough. Thought I'd add it in while I was there, feel free to remove it if you like. It's a fairly self-explanatory method I find