What i would recommend is to create a "Fake Wall" the whole terrain is the same level, but the side of a cliff would be a sprite that the player cannot pass.
Otherwise you could do a check for the block next to the player's level and see if it is equal to the current blocks's height +/- 1