dolor.types.misc

Miscellaneous types.

class EmptyType[source]

Bases: dolor.types.type.Type

A type of no value.

It always unpacks to None and always packs to b"".

Users should not have to explicitly use this type; it is just useful for things like VersionSwitchedType for instance, which uses this type when a packet attribute doesn’t exist for a certain version.

class RawByte[source]

Bases: dolor.types.type.Type

A single byte of data.

The main reason this exists is to be used along with Array, for which this type is special-cased to produce a bytearray value.

class StructType[source]

Bases: dolor.types.type.Type

A wrapper over struct.pack() and struct.unpack().

fmt

The format string for the structure, not including the endianness prefix.

Type

str

classmethod real_fmt()[source]

Translates the fmt attribute to the format string actually used.

Just adds the big endian prefix to the format string, as all Minecraft types are big endian.