Data3D: Read and write Data3D data

Data3DR Documentation

Read and write Data3D data

Description

Data3D data (tag 43) stores information about surface heights and biomes in a chunk.

get_data3d_data() loads Data3D data from db. It will silently drop keys not representing Data3D data.

get_data3d_value() loads Data3D data from db. It only supports loading a single value.

put_data3d_data(), put_data3d_values(), and put_data3d_value() store Data3D data into db.

read_data3d_value() decodes binary Data3D data.

write_data3d_value encodes Data3D data into a raw vector.

Usage

get_data3d_data(db, x, z, dimension)

get_data3d_values(db, x, z, dimension)

get_data3d_value(db, x, z, dimension)

put_data3d_data(db, data)

put_data3d_values(db, x, z, dimension, height_maps, biome_maps)

put_data3d_value(db, x, z, dimension, height_map, biome_map)

read_data3d_value(rawdata)

write_data3d_value(height_map, biome_map)

Arguments

db

A bedrockdb object.

x, z, dimension

Chunk coordinates to extract data from. x can also be a character vector of db keys.

data

A named-vector of key-value pairs for Data3D data.

height_maps, biome_maps

Lists of height and biome data. Values will be recycled if necessary to match the number of keys to be written to. If biome_maps is missing, height_maps should be in the same format as returned by get_data3d_data().

height_map

16x16 array containing height data. Values will be recycled if necessary. If biome_map is missing, height-map should be a list a list() with both "height_map" and "biome_map" elements.

biome_map

16xNx16 array containing biome data.

rawdata

A raw vector.

Value

get_data3d_data() returns a list of the of the values returned by get_data3d_value().

get_data3d_value() returns a list with components "height_map" and "biome_map".


rbedrock documentation built on Oct. 7, 2023, 1:07 a.m.