def _analyze(self, command):
        """
        analyze

        Counts all of the block types in every chunk of the world.
        """
        blockCounts = zeros((65536,), 'uint64')

        print "Analyzing {0} chunks...".format(self.level.chunkCount)
        # for input to bincount, create an array of uint16s by
        # shifting the data left and adding the blocks

        for i, cPos in enumerate(self.level.allChunks, 1):
            ch = self.level.getChunk(*cPos)
            btypes = numpy.array(ch.Data.ravel(), dtype='uint16')
            btypes <<= 12
            btypes += ch.Blocks.ravel()
            counts = bincount(btypes)

            blockCounts[:counts.shape[0]] += counts
            if i % 100 == 0:
                logging.info("Chunk {0}...".format(i))

        for blockID in range(materials.id_limit):
            for data in range(16):
                i = (data << 12) + blockID
                if blockCounts[i]:
                    idstring = "({id}:{data})".format(id=blockID, data=data)

                    print "{idstring:9} {name:30}: {count:<10}".format(
                        idstring=idstring, name=self.level.materials.blockWithID(blockID, data).name,
                        count=blockCounts[i])

        self.needsSave = True

        analyze

        Counts all of the block types in every chunk of the world.
        
mce.py