Module get_catalog

Catalog functions

Class Catalog

Catalog:get_size () Get the overall size of the catalog
Catalog:has_mapblock (catalog_mapblock_pos) Check for the existence of a mapblock in the catalog
Catalog:deserialize (catalog_mapblock_pos, world_mapblock_pos, options) Deserialize a single mapblock from the catalog
Catalog:prepare (catalog_mapblock_pos, options) Prepare a mapblock with options for faster access
Catalog.deserialize_all_options Deserialize options
Catalog:deserialize_all (target_mapblock_pos, options) Deserialize all mapblocks in the catalog to the world
mapblock_lib.get_catalog (filename) create a new catalog wrapper for the given filename


Class Catalog

Catalog object
Catalog:get_size ()
Get the overall size of the catalog

Returns:

    util.mapblock_pos the size in mapblocks
Catalog:has_mapblock (catalog_mapblock_pos)
Check for the existence of a mapblock in the catalog

Parameters:

Returns:

    the zip-manifest entry of the meta-file or nil if not found
Catalog:deserialize (catalog_mapblock_pos, world_mapblock_pos, options)
Deserialize a single mapblock from the catalog

Parameters:

Returns:

  1. success true on success
  2. error in case of an error

See also:

Catalog:prepare (catalog_mapblock_pos, options)
Prepare a mapblock with options for faster access

Parameters:

Returns:

  1. deserFn a function that accepts a mapblock position util.mapblock_pos to write the mapblock to the map
  2. error in case of an error
Catalog.deserialize_all_options
Deserialize options

Fields:

  • callback function to call when the blocks are deserialized
  • progress_callback function to call when the progress is update
  • error_callback function to call on errors
  • mapblock_options function that returns the deserialization options when called with a mapblock_pos as param
  • delay number for async mode: delay between deserialization-calls
  • rotate_y number the y rotation, can be 0,90,180 or 270 degrees
Catalog:deserialize_all (target_mapblock_pos, options)
Deserialize all mapblocks in the catalog to the world

Parameters:

See also:

mapblock_lib.get_catalog (filename)
create a new catalog wrapper for the given filename

Parameters:

  • filename the file to read from

Returns:

    Catalog the catalog object
generated by LDoc 1.4.6 Last updated 2023-03-30 05:48:06