Biomes array

class amulet.api.chunk.biomes.Biomes3D(input_array=None)[source]

Bases: UnboundedPartial3DArray

The Biomes3D class is designed to represent a 3D integer array but with no vertical height limit.

See UnboundedPartial3DArray for more information on how this works.

__init__(input_array=None)[source]

Construct a Biomes3D class from the given data.

Parameters

input_array (Union[Dict[int, ndarray], Biomes3D, None]) – Either an instance of Biomes3D or a dictionary converting sub-chunk id to a 4x4x4 numpy array.

add_section(sy, section)[source]

Add a section array at the given location.

Parameters
create_section(sy)[source]

Create a section array at the given location using the default value and dtype.

Parameters

sy (Union[int, integer]) – The section index to create.

property default_value: Union[int, bool][source]

The default value to populate undefined sections with. Read Only

property dtype: Type[dtype][source]

The numpy dtype for the arrays. Read Only.

get_section(sy)[source]

Get the section array for a given section index.

If the section is not defined it will be populated using create_section()

Parameters

sy (Union[int, integer]) – The section index to get.

Return type

ndarray

Returns

Numpy array for this section

has_section(sy)[source]

Check if the array for a given section exists. :param cy: The section y index :rtype: bool :return: True if the array exists, False otherwise

property section_shape: Tuple[int, int, int][source]

The x, y and z size of a section in the original array.

property sections: Iterable[int][source]

An iterable of the section defined in the array.

property shape: Tuple[int, Union[int, float], int][source]

The size of the array in the x, y and z axis. Read Only

property size_x: int[source]

The size of the array in the x axis. Read Only

property size_y: float[source]

The size of the array in the y axis. Is always math.inf for the unbounded variant. Read Only

property size_z: int[source]

The size of the array in the z axis. Read Only

property slice_x: slice[source]

The slice in the x axis into the original array. Read Only

property slice_y: slice[source]

The slice in the y axis into the original array. Read Only

property slice_z: slice[source]

The slice in the z axis into the original array. Read Only

property slices_tuple: Tuple[Tuple[int, int, int], Tuple[int, int, int], Tuple[int, int, int]][source]

The slices data in the x, y and z axis into the original array. Read Only

property start: Tuple[int, int, int][source]

The minimum x, y and z of the slice within the original array. Read Only

property start_x: int[source]

The minimum x value of the slice within the original array. Read Only

property start_y: Optional[int][source]

The minimum y value of the slice within the original array. Read Only

property start_z: int[source]

The minimum z value of the slice within the original array. Read Only

property step: Tuple[int, int, int][source]

The step count of the slice in the x, y and z axis. Read Only

property step_x: int[source]

The step count of the slice in the x axis. Read Only

property step_y: int[source]

The step count of the slice in the y axis. Read Only

property step_z: int[source]

The step count of the slice in the z axis. Read Only

property stop: Tuple[int, int, int][source]

The maximum x value of the slice within the original array. Read Only

property stop_x: int[source]

The maximum x value of the slice within the original array. Read Only

property stop_y: Optional[int][source]

The maximum y value of the slice within the original array. Read Only

property stop_z: int[source]

The maximum z value of the slice within the original array. Read Only