The rotation is handled by a set of 5 bits out of a total of 24 (currently), which can give a number up to 31. 24 of those numbers are used to represent all the possible rotations that a block can have. That way, every rotation possibility can fall under the same block ID. (If it helps, you can...