amulet.api.chunk.status module

class amulet.api.chunk.status.StatusFormats(value)[source]

Bases: Enum

The different formats the status value can be converted to.

>>> StatusFormats.Raw  # The raw float value
>>> StatusFormats.Bedrock  # as an integer between 0 and 2
>>> StatusFormats.Java_13  # as a string
>>> StatusFormats.Java_14  # as a string
class amulet.api.chunk.status.Status[source]

Bases: object

A class to represent the generation state of a chunk.

This stores the chunk status as a float in the range -1 to 2 where -1 is nothing generated and 2 being fully generated.

__init__()[source]

Construct an instance of the Status class.

property value: float[source]

Getter

Get the raw status value.

>>> status = chunk.status.value
Returns

The float status value in the range -1 to 2

Setter

Set the status value.

>>> chunk.status.value = 2
>>> chunk.status.value = "full"

This can be a float/int or a string. If it is a string it is looked up in the states look up table to find the float value it corresponds with.

Parameters

value – The value to set as the generation stage.

as_type(status_format)[source]

Get the generation state in a given format.

>>> chunk.status.as_type(StatusFormats.Raw)
2.0
>>> chunk.status.as_type(StatusFormats.Bedrock)
2
>>> chunk.status.as_type(StatusFormats.Java_14)
'full'
Parameters

status_format (StatusFormats) – The format the status should be returned in. Must be from StatusFormats.

Return type

Union[int, float, str]

Returns

The status code in the requested format.