-
Notifications
You must be signed in to change notification settings - Fork 0
MapBlock dictionary
Each MapBlock has a dictionary in self.data with the parsed data of the MapBlock.
The data is parsed from the raw binary data of the MapBlock. Please consult Luanti's MapBlock Serialization Format for the binary data's documentation.
Some unnecessary values that exist in the raw binary data but are obsolete in this format (such as name lengths) or are potentially dangerous to expose (such as fixed version numbers) have been removed.
In general, you should not touch anything if you are not aware of the implications that modifying it may cause. If you are unsure, use mtanvil's helper functions or read the page linked above.
-
was_compressed(bool): Indicates whether the binary data was compressed with zstd or not. -
version(int): MapBlock format version number. Latest is 29. -
flags(dict): Flags for the MapBlock.-
is_underground(bool): If true, Luanti will not calculate sunlight from above for this MapBlock. -
day_night_differs(bool): Whether the lighting of the block is different on day and night. -
lighting_expired(bool): Not used in format version 27 and above, seelighting_completeinstead. If true, lighting is invalid and should be updated. -
generated(bool): Whether the MapBlock has been generated yet. If false, the MapBlock is most likely filled withCONTENT_IGNOREand parts of structures (eg trees) from neighbouring MapBlocks.
-
-
lighting_complete(dict): Indicates if the light is correct at the sides of a map block. If any is false, Luanti will automatically recompute light when both this block and its required neighbor are loaded. Nothing flags should always be set.-
nothing1(bool) -
nothing2(bool) -
nothing3(bool) -
nothing4(bool) -
night(dict): Lighting at night-
X-(bool) -
Y-(bool) -
Z-(bool) -
Z+(bool) -
Y+(bool) -
X+(bool)
-
-
day(dict): Lighting during the day- Same as
night
- Same as
-
-
timestamp(int): Timestamp when last saved, as seconds from starting the game.4294967295is an invalid/unknown timestamp, use when nothing should be done with the time difference.
Note: mtanvil handles mappings automatically so you should not need to touch this
-
name_id_mappings(list): List of name ID mappings.- foreach mapping:
-
id(int): The ID in the node data that is used to represent this node. -
name(str): The node name (eg "default:goldblock").
-
- foreach mapping:
-
nodes(list): List of all theNodes in the MapBlock
-
content_width(int): Number of bytes in the content (param0) fields of nodes. Always 1 before format version 24, always 2 since. -
params_width(int): Number of bytes used for parameters (param1andparam2) per node. Always 2. -
node_data(list): List of all nodes and their params. The location of a node in the list is(z*16*16 + y*16 + x).- foreach node:
-
param0(int): The mapping ID of the node. -
param1(int) -
param2(int)
-
- foreach node:
-
node_metadata_version(int): Always 1 before format version 28, always 2 since. (If this is 0 then the following node metadata values are not included. mtanvil will still return an empty list.) -
node_metadata(list):-
position(int): Position of the relevant node innode_data. -
vars(list): List of all vars in the node metadata.- foreach var:
-
key(str) -
value(str) -
is_private(bool)
-
- foreach var:
-
serialized_inventory: NOT IMPLEMENTED YET DUE TO THE LACK OF DOCUMENTATION
-
-
static_object_version(int): Always 0 -
static_objects(list): List of static objects- foreach static_object:
-
type(int): Object type ID -
pos_x(int) -
pos_y(int) -
pos_z(int) -
data(bytes): A separate StaticObject class will be created soon to better support this
-
- foreach static_object:
-
length_of_single_timer(int): Length of the data of a single timer. Always 10 -
timers(list):- foreach timer:
-
position(int): Position of the relevant node innode_data -
timeout(int) -
elapsed(int)
-
- foreach timer:
Code | Issues | View on PyPi