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.