actual solving of the halfslab+torch problem

You're indenting using spaces, that's a no-no. Use tabs.

Wouldn't this allow torches to be placed on regular slabs, too? (if someone had a hacked client)