Fix Sneaking + right clicking.

If a player tries to place a block while sneaking on a block based
inventory, it will now no longer display a message saying that a player
opened the inventory.
This commit also contains a small format fix.