def _saveChunk_1plus(self, chunk, batch=None, writeOptions=None):
        """
        :param chunk: PocketLeveldbChunk
        :param batch: WriteBatch
        :param writeOptions: WriteOptions
        :return: None
        """
        cx, cz = chunk.chunkPosition
        key = struct.pack('<i', cx) + struct.pack('<i', cz) + dimension

        with nbt.littleEndianNBT():
            mcedit_defs = self.level.defsIds.mcedit_defs
            defs_get = mcedit_defs.get
            ids_get = self.level.defsIds.mcedit_ids.get
            tileEntityData = ''
            for ent in chunk.TileEntities:
                tileEntityData += ent.save(compressed=False)

            entityData = ''
            for ent in chunk.Entities:
                if 'identifier' in ent:
                    v = 'see "identifier"'
                    if "id" in ent:
                        v = ent["id"].value
                        del ent["id"]
                    entityData += ent.save(compressed=False)
                    ent["id"] = nbt.TAG_String(v)
                else:
                    try:
                        v = ent["id"].value
                        ent_data = defs_get(ids_get(v, v), {'id': -1})
                        id = ent_data['id']
                        ent['id'] = nbt.TAG_Int(id + mcedit_defs['entity_types'].get(ent_data.get('type', None),0))
                        entityData += ent.save(compressed=False)
                        # We have to re-invert after saving otherwise the next save will fail.
                        ent["id"] = nbt.TAG_String(v)
                    except Exception as e:
                        logger.warning("An error occured while saving entity ID:")
                        logger.warning(e)
                        logger.warning("Entity has been skipped")

        wop = self.writeOptions if writeOptions is None else writeOptions
        chunk._Blocks.update_subchunks()
        chunk._Data.subchunks = chunk._Blocks.subchunks
        chunk._Data.update_subchunks()
        chunk._extra_blocks.subchunks = chunk._Blocks.subchunks
        chunk._extra_blocks_data.subchunks = chunk._Blocks.subchunks
        chunk._extra_blocks.update_subchunks()
        chunk._extra_blocks_data.update_subchunks()
        data_2d = getattr(chunk, 'data_2d', '\x00'*768)
        if hasattr(chunk, 'Biomes') and data_2d:
            data_2d = data_2d[:512] + chunk.Biomes.tostring()
        if chunk.chunk_version == "\x03":
            chunk._SkyLight.subchunks = chunk._Blocks.subchunks
            chunk._SkyLight.update_subchunks()
            chunk._BlockLight.subchunks = chunk._Blocks.subchunks
            chunk._BlockLight.update_subchunks()
        chunk.subchunks = chunk._Blocks.subchunks

        for y in chunk.subchunks:
            c = chr(y)
            ver = chr(8)
            if chunk._Blocks.binary_data[y] is None or chunk._Data.binary_data[y] is None:
                continue

            blocks = chunk._Blocks.binary_data[y].ravel()
            blockData = chunk._Data.binary_data[y].ravel()
            blocks_storage = get_blocks_storage_from_blocks_and_data(blocks, blockData)

            if hasattr(chunk, "_extra_blocks") and chunk._extra_blocks.binary_data[y].max() > 0:
                extra_blocks = chunk._extra_blocks.binary_data[y].ravel()
                extra_blocks_data = chunk._extra_blocks_data.binary_data[y].ravel()
                extra_blocks_storage = get_blocks_storage_from_blocks_and_data(extra_blocks, extra_blocks_data)
                num_of_storages = 2
            else:
                extra_blocks_storage = ""
                num_of_storages = 1

            terrain = ver + chr(num_of_storages) + blocks_storage + extra_blocks_storage

            if batch is None:
                with self.world_db() as db:
                    if blocks is None or blockData is None or (numpy.all(chunk._Blocks.binary_data[y] == 0) and numpy.all(chunk._Data.binary_data[y] == 0)):
                        db.Delete(key + "\x2f" + c)
                    else:
                        db.Put(wop, key + "\x2f" + c, terrain)
                    if y == 0:
                        db.Put(wop, key + '\x76', chunk.chunk_version)
                        if len(chunk.TileEntities) > 0:
                            db.Put(wop, key + '\x31', tileEntityData)
                        else:
                            db.Delete(key + '\x31')
                        if len(chunk.Entities) > 0:
                            db.Put(wop, key + '\x32', entityData)
                        else:
                            db.Delete(key + '\x32')
                        if data_2d:
                            db.Put(wop, key + '\x2d', data_2d)
            else:
                if blocks is None or blockData is None or (numpy.all(chunk._Blocks.binary_data[y] == 0) and numpy.all(chunk._Data.binary_data[y] == 0)):
                    batch.Delete(key + "\x2f" + c)
                else:
                    batch.Put(key + "\x2f" + c, terrain)
                if y == 0:
                    batch.Put(key + '\x76', chunk.chunk_version)
                    if len(chunk.TileEntities) > 0:
                        batch.Put(key + '\x31', tileEntityData)
                    else:
                        batch.Delete(key + '\x31')
                    if len(chunk.Entities) > 0:
                        batch.Put(key + '\x32', entityData)
                    else:
                        batch.Delete(key + '\x32')
                    if data_2d:
                        batch.Put(key + '\x2d', data_2d)

        :param chunk: PocketLeveldbChunk
        :param batch: WriteBatch
        :param writeOptions: WriteOptions
        :return: None
        
pymclevel/leveldbpocket.py