def getAllChunks(self, readOptions=None, world_version=None):
        """
        Returns a list of all chunks that have terrain data in the database.
        Chunks with only Entities or TileEntities are ignored.
        :param readOptions: ReadOptions
        :param world_version: game version to read the data for. Default: None.
        :return: list
        """
        allChunks = set()
        with self.world_db() as db:
            if not world_version:
                world_version = self.world_version
            rop = self.readOptions if readOptions is None else readOptions

            it = db.NewIterator(rop)
            it.SeekToFirst()
            if it.Valid():
                firstKey = it.key()
            else:
                # ie the database is empty
                return []

            it.SeekToLast()
            key = ''
            while key[0:8] != firstKey[0:8]:
                key = it.key()
                if len(key) >= 8:
                    try:
                        if world_version == 'pre1.0':
                            val = db.Get(rop, key[:8] + '\x30')
                        elif world_version == '1.plus':
                            val = db.Get(rop, key[:8]+dimension+'\x76')
                        # if the above key exists it is a valid chunk so add it
                        if val is not None:
                            allChunks.add(struct.unpack('<2i', key[:8]))
                    except RuntimeError:
                        pass

                # seek to the first key with this beginning and go one further
                it.seek(key[:8])
                it.stepBackward()

            it.status()  # All this does is cause an exception if something went wrong. Might be unneeded?
            del it
        return allChunks

        Returns a list of all chunks that have terrain data in the database.
        Chunks with only Entities or TileEntities are ignored.
        :param readOptions: ReadOptions
        :param world_version: game version to read the data for. Default: None.
        :return: list
        
pymclevel/leveldbpocket.py