ItemTranslator class

class PyMCTranslate.py3.api.version.translators.item.ItemTranslator(translation_manager, parent_version, database, *_)[source]

Bases: BaseTranslator

base_names(namespace, force_blockstate=False)

A list of all the valid base names present in a given namespace for this object type.

Parameters
  • namespace (str) – A namespace string as found using the namespaces method

  • force_blockstate (bool) – True to get the blockstate format. False to get the native format (these are sometimes the same)

Return type

List[str]

Returns

A list of base names

get_mapping_from_universal(namespace, base_name, force_blockstate=False)

Get the mapping file for the requested object from the universal format to this version format.

Parameters
  • namespace (str) – A namespace string as found using the namespaces method

  • base_name (str) – A base name string as found using the base_name method

  • force_blockstate (bool) – True to get the blockstate format. False to get the native format (these are sometimes the same)

Return type

List[dict]

Returns

A list of mapping functions to apply to the object

get_mapping_to_universal(namespace, base_name, force_blockstate=False)

Get the mapping file for the requested object from this version format to the universal format.

Parameters
  • namespace (str) – A namespace string as found using the namespaces method

  • base_name (str) – A base name string as found using the base_name method

  • force_blockstate (bool) – True to get the blockstate format. False to get the native format (these are sometimes the same)

Return type

List[dict]

Returns

A list of mapping functions to apply to the object

get_specification(namespace, base_name, force_blockstate=False)[source]

Get the specification file for the requested object.

Parameters
  • namespace (str) – A namespace string as found using the namespaces method

  • base_name (str) – A base name string as found using the base_name method

  • force_blockstate (bool) – True to get the blockstate format. False to get the native format (these are sometimes the same)

Returns

A custom dictionary with a better documented API.

namespaces(force_blockstate=False)

A list of all the valid namespaces for this object type.

Parameters

force_blockstate (bool) – True to get the blockstate format. False to get the native format (these are sometimes the same)

Return type

List[str]

Returns

A list of all the namespaces