how to block udp ports
This is a good tutorial for beginning with "pf", because system preferences do not allow you to enter manual rules.

http://krypted.com/mac-security/a-cheat-sheet-for-using-pf-in-os-x-lion-and-up/ 

I used to use the very good firewall fronted "HandsOff!" by metakine (but they sold it), where you can do what you like, but honestly I do not know whether there is a Yosemite update for that.

Update:
https://www.oneperiodic.com/products/handsoff/