Massive bugfix

Fixed dupe bug after MUCH research. Also, added generic custom tool
class, from where it is possible to make a tool that can only mine
certain blocks.