Registry¶
Quarry can be told to encode/decode block, item and other information by
setting the registry attribute on the in-use buffer. This can be
set directly or by deriving a subclass and customizing
get_buff_type(). The registry
affects the following methods:
unpack_slot()andpack_slot()unpack_block()andpack_block()unpack_entity_metadata()andpack_entity_metadata()unpack_chunk_section()andpack_chunk_section()unpack_villager()andpack_villager()unpack_particle()andpack_particle()
All registry objects have the following methods:
-
Registry.is_air_block(obj)[source]¶ Returns true if the given object is considered air for lighting purposes.
Quarry supports the following registry types:
-
class
quarry.types.registry.OpaqueRegistry(max_bits)[source]¶ Registry that passes IDs through unchanged. This is the default.
-
class
quarry.types.registry.BitShiftRegistry(max_bits)[source]¶ Registry implementing the Minecraft 1.7 - 1.12 bit-shift format for blocks.
Blocks decode to a
(block_id, metadata)pair. Items pass through unchanged.
-
class
quarry.types.registry.LookupRegistry(blocks, registries)[source]¶ Registry implementing a dictionary lookup, recommended for 1.13+.
Blocks decode to a
dictwhere the only guaranteed key isu'name'. Items decode to astrname.Use the
from_jar()orfrom_json()class methods to load data from the official server.