Disable Structures Spawning on Water

I am making structure gen in a mod for 1.20.1, my structure is not supposed to spawn on top of water or in water, how can I just make it not try in the presence of water?

Continue to help post