get_chunk_blocks_data: Load block data from one or more chunks

View source: R/blocks.R

get_chunk_blocks_dataR Documentation

Load block data from one or more chunks

Description

These functions return block data as strings containing the block name and block states. The strings' format is blockname@state1=value1@state2=value2 etc. Blocks may have 0 or more states.

get_chunk_blocks_value() is an alias for get_chunk_blocks_data()

get_chunk_blocks_value() loads block data from a bedrockdb. It only supports loading a single value.

put_chunk_blocks_data(), put_chunk_blocks_values(), and put_chunk_blocks_value() stores block data into a bedrockdb.

Usage

get_chunk_blocks_data(
  db,
  x,
  z,
  dimension,
  names_only = FALSE,
  extra_block = FALSE
)

get_chunk_blocks_values(
  db,
  x,
  z,
  dimension,
  names_only = FALSE,
  extra_block = FALSE
)

get_chunk_blocks_value(
  db,
  x,
  z,
  dimension,
  names_only = FALSE,
  extra_block = FALSE
)

put_chunk_blocks_data(db, data, version = 9L)

put_chunk_blocks_values(db, x, z, dimension, values, version = 9L)

put_chunk_blocks_value(db, x, z, dimension, value, version = 9L)

Arguments

db

A bedrockdb object.

x, z, dimension

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

names_only

A logical scalar. Return only the names of the blocks, ignoring block states.

extra_block

A logical scalar. Append the extra block layer to the output (separated by ";"). This is mostly useful if you have waterlogged blocks. If the extra block is air, it will not be appended.

data

A named list of 16xNx16 character() arrays

version

Which format of subchunk data to use

values

A list of 16xNx16 character() arrays

value

A 16xNx16 character array

Value

get_chunk_blocks_data() returns a list of the of the values returned by read_chunk_blocks_value().

get_chunk_blocks_value() return a 16xNx16 character array. The axes represent the x, y, and z dimensions in that order. The size of the y-axis is based on the highest subchunk in the coordinate. Missing subchunks are considered air.


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