Fixed NPE in the inventory click event.
Rewrited the anvil-related code, using names to identify our tools.