Here is a link to the code for my voxel project:
https://sites.google.com/site/voxbygame/
Hope it helps somebody! (Note - collision not fully implemented).
Keys wads, space to jump (infinitely), b to drop block, u to remove block, 4 to toggle through
block player holding.