I do that all the time on cruises! I've never gotten badly hurt though, I'm sorry that you did
A lot of times it's just something to get used to, as with any new place. If you keep forgetting, sticking a post-it by the bathroom door that says "step up!" can help.