Using a thread that constantly teleports the entity to the right height. It works, but if the server lags, you'll find your ride rather bumpy as the pig/horse begins to start falling to the ground.