This release includes a new API for reading and writing from the world database. The new API is designed to better support pipes and use a common database connection across functions. Most functions associated with reading and writing values to a world database were impacted. Consider the process of getting a set of values from a common prefix.
<- bedrockdb(dbpath)
db # Previous API
<- get_data(db, starts_with = prefix)
dat # New API
# - automatically uses db
# - prefixes created with helper function
<- get_data(starts_with(prefix))
dat
# Previous API
put_data(db, dat)
# New API
put_data(dat)
# Previous API
put_values(db, names(dat), dat)
# New API
put_data(dat, names(dat))
As part of the new API, the get_values()
,
set_values()
, and related _values()
functions
were removed.
The API for working NBT and rNBT values has been reimagined.
New get_blocks_*
and put_blocks_*
functions have replaced get_chunk_blocks_*
and
put_chunk_blocks_*
. The new functions work per chunk and
always return blocks as a 16 x 384 x 16 array, regardless of the
dimension.
default_db()
function to get/set a default db
connection.print()
etc. commands for printing NBT using a tree
structure.with_db()
and local_db()
for
temporarily changing the default db connection.biome_name()
function for converting from a numeric
id to biome name.read_rnbt_once()
function to parse NBT data that is
mixed in with non NBT data. It returns a single NBT value along with how
may bytes the value was.blocks_nbt()
and blocks_str()
functions to convert block data between NBT and string
representations.spawning_area()
no longer requires a chunk to be
withing 96 blocks of a player.abort()
calls if exceptions are not
enabled.Rf_error()
.R_len_t
in more locations.db
if no keys are present.@x:z:d:t:s
. This change was made
because subtags can now be negative.locate_blocks()
function.rnbt
(raw nbt) format.get_subchunk_layers_value()
and friends.-Werror
flag used by leveldb on some
platformsstarts_with
option to get_values()
,
and db$mget_prefix()
and
bedrock_leveldb_mget_prefix()
function.get_subchunk_blocks_from_chunk()
function to
efficiently lead subchunks from a single chunk.