Here you go 
This stops all types of liquid from flowing
@Listener
public void stopLiquidFlow(ChangeBlockEvent.Place event, @Root BlockSnapshot snapshot) {
Optional<MatterProperty> matter = snapshot.getState().getProperty(MatterProperty.class);
if (matter.isPresent() && matter.get().getValue() == Matter.LIQUID) {
event.setCancelled(true);
}
}