Filter invalid item IDs (fixes #168).

Blocks which cannot exist as items are now filtered out as a part of inventory
handling, preventing client crashes. Some of these blocks are converted into
item equivalents, but most are discarded.