In the previous version (1.8.3) if a villager was swimming the water block was removed in order to block the trade. This morning I discovered a cleaner way to do this without having to remove the water block that did not cause any other issues.
Both ways work this way just does not affect blocks on the server.