amulet-core 2.0a5__cp312-cp312-macosx_10_13_universal2.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of amulet-core might be problematic. Click here for more details.
- amulet/__init__.cpython-312-darwin.so +0 -0
- amulet/__init__.pyi +30 -0
- amulet/__pyinstaller/__init__.py +2 -0
- amulet/__pyinstaller/hook-amulet.py +4 -0
- amulet/_init.py +28 -0
- amulet/_version.py +21 -0
- amulet/biome.cpp +36 -0
- amulet/biome.hpp +43 -0
- amulet/biome.pyi +77 -0
- amulet/block.cpp +435 -0
- amulet/block.hpp +119 -0
- amulet/block.pyi +273 -0
- amulet/block_entity.cpp +12 -0
- amulet/block_entity.hpp +56 -0
- amulet/block_entity.pyi +80 -0
- amulet/chunk.cpp +16 -0
- amulet/chunk.hpp +99 -0
- amulet/chunk.pyi +30 -0
- amulet/chunk_/components/biome.py +155 -0
- amulet/chunk_/components/block_entity.py +117 -0
- amulet/chunk_/components/entity.py +64 -0
- amulet/chunk_/components/height_2d.py +16 -0
- amulet/chunk_components.pyi +95 -0
- amulet/collections.pyi +37 -0
- amulet/data_types.py +29 -0
- amulet/entity.py +180 -0
- amulet/errors.py +63 -0
- amulet/game/__init__.py +7 -0
- amulet/game/_game.py +152 -0
- amulet/game/_universal/__init__.py +1 -0
- amulet/game/_universal/_biome.py +17 -0
- amulet/game/_universal/_block.py +47 -0
- amulet/game/_universal/_version.py +68 -0
- amulet/game/abc/__init__.py +22 -0
- amulet/game/abc/_block_specification.py +150 -0
- amulet/game/abc/biome.py +213 -0
- amulet/game/abc/block.py +331 -0
- amulet/game/abc/game_version_container.py +25 -0
- amulet/game/abc/json_interface.py +27 -0
- amulet/game/abc/version.py +44 -0
- amulet/game/bedrock/__init__.py +1 -0
- amulet/game/bedrock/_biome.py +35 -0
- amulet/game/bedrock/_block.py +42 -0
- amulet/game/bedrock/_version.py +165 -0
- amulet/game/java/__init__.py +2 -0
- amulet/game/java/_biome.py +35 -0
- amulet/game/java/_block.py +60 -0
- amulet/game/java/_version.py +176 -0
- amulet/game/translate/__init__.py +12 -0
- amulet/game/translate/_functions/__init__.py +15 -0
- amulet/game/translate/_functions/_code_functions/__init__.py +0 -0
- amulet/game/translate/_functions/_code_functions/_text.py +553 -0
- amulet/game/translate/_functions/_code_functions/banner_pattern.py +67 -0
- amulet/game/translate/_functions/_code_functions/bedrock_chest_connection.py +152 -0
- amulet/game/translate/_functions/_code_functions/bedrock_moving_block_pos.py +88 -0
- amulet/game/translate/_functions/_code_functions/bedrock_sign.py +152 -0
- amulet/game/translate/_functions/_code_functions/bedrock_skull_rotation.py +16 -0
- amulet/game/translate/_functions/_code_functions/custom_name.py +146 -0
- amulet/game/translate/_functions/_frozen.py +66 -0
- amulet/game/translate/_functions/_state.py +54 -0
- amulet/game/translate/_functions/_typing.py +98 -0
- amulet/game/translate/_functions/abc.py +116 -0
- amulet/game/translate/_functions/carry_nbt.py +160 -0
- amulet/game/translate/_functions/carry_properties.py +80 -0
- amulet/game/translate/_functions/code.py +143 -0
- amulet/game/translate/_functions/map_block_name.py +66 -0
- amulet/game/translate/_functions/map_nbt.py +111 -0
- amulet/game/translate/_functions/map_properties.py +93 -0
- amulet/game/translate/_functions/multiblock.py +112 -0
- amulet/game/translate/_functions/new_block.py +42 -0
- amulet/game/translate/_functions/new_entity.py +43 -0
- amulet/game/translate/_functions/new_nbt.py +206 -0
- amulet/game/translate/_functions/new_properties.py +64 -0
- amulet/game/translate/_functions/sequence.py +51 -0
- amulet/game/translate/_functions/walk_input_nbt.py +331 -0
- amulet/game/translate/_translator.py +433 -0
- amulet/item.py +75 -0
- amulet/level/__init__.pyi +27 -0
- amulet/level/_load.py +100 -0
- amulet/level/abc/__init__.py +12 -0
- amulet/level/abc/_chunk_handle.py +335 -0
- amulet/level/abc/_dimension.py +86 -0
- amulet/level/abc/_history/__init__.py +1 -0
- amulet/level/abc/_history/_cache.py +224 -0
- amulet/level/abc/_history/_history_manager.py +291 -0
- amulet/level/abc/_level/__init__.py +5 -0
- amulet/level/abc/_level/_compactable_level.py +10 -0
- amulet/level/abc/_level/_creatable_level.py +29 -0
- amulet/level/abc/_level/_disk_level.py +17 -0
- amulet/level/abc/_level/_level.py +453 -0
- amulet/level/abc/_level/_loadable_level.py +42 -0
- amulet/level/abc/_player_storage.py +7 -0
- amulet/level/abc/_raw_level.py +187 -0
- amulet/level/abc/_registry.py +40 -0
- amulet/level/bedrock/__init__.py +2 -0
- amulet/level/bedrock/_chunk_handle.py +19 -0
- amulet/level/bedrock/_dimension.py +22 -0
- amulet/level/bedrock/_level.py +187 -0
- amulet/level/bedrock/_raw/__init__.py +5 -0
- amulet/level/bedrock/_raw/_actor_counter.py +53 -0
- amulet/level/bedrock/_raw/_chunk.py +54 -0
- amulet/level/bedrock/_raw/_chunk_decode.py +668 -0
- amulet/level/bedrock/_raw/_chunk_encode.py +602 -0
- amulet/level/bedrock/_raw/_constant.py +9 -0
- amulet/level/bedrock/_raw/_dimension.py +343 -0
- amulet/level/bedrock/_raw/_level.py +463 -0
- amulet/level/bedrock/_raw/_level_dat.py +90 -0
- amulet/level/bedrock/_raw/_typing.py +6 -0
- amulet/level/bedrock/_raw/leveldb_chunk_versions.py +83 -0
- amulet/level/bedrock/chunk/__init__.py +1 -0
- amulet/level/bedrock/chunk/_chunk.py +126 -0
- amulet/level/bedrock/chunk/components/__init__.py +0 -0
- amulet/level/bedrock/chunk/components/chunk_version.py +12 -0
- amulet/level/bedrock/chunk/components/finalised_state.py +13 -0
- amulet/level/bedrock/chunk/components/raw_chunk.py +15 -0
- amulet/level/construction/__init__.py +0 -0
- amulet/level/java/__init__.pyi +21 -0
- amulet/level/java/_chunk_handle.py +17 -0
- amulet/level/java/_chunk_handle.pyi +15 -0
- amulet/level/java/_dimension.py +20 -0
- amulet/level/java/_dimension.pyi +13 -0
- amulet/level/java/_level.py +184 -0
- amulet/level/java/_level.pyi +120 -0
- amulet/level/java/_raw/__init__.pyi +19 -0
- amulet/level/java/_raw/_chunk.pyi +23 -0
- amulet/level/java/_raw/_chunk_decode.py +561 -0
- amulet/level/java/_raw/_chunk_encode.py +463 -0
- amulet/level/java/_raw/_constant.py +9 -0
- amulet/level/java/_raw/_constant.pyi +20 -0
- amulet/level/java/_raw/_data_pack/__init__.py +2 -0
- amulet/level/java/_raw/_data_pack/__init__.pyi +8 -0
- amulet/level/java/_raw/_data_pack/data_pack.py +241 -0
- amulet/level/java/_raw/_data_pack/data_pack.pyi +197 -0
- amulet/level/java/_raw/_data_pack/data_pack_manager.py +77 -0
- amulet/level/java/_raw/_data_pack/data_pack_manager.pyi +75 -0
- amulet/level/java/_raw/_dimension.py +86 -0
- amulet/level/java/_raw/_dimension.pyi +72 -0
- amulet/level/java/_raw/_level.py +507 -0
- amulet/level/java/_raw/_level.pyi +238 -0
- amulet/level/java/_raw/_typing.py +3 -0
- amulet/level/java/_raw/_typing.pyi +5 -0
- amulet/level/java/anvil/__init__.py +2 -0
- amulet/level/java/anvil/__init__.pyi +11 -0
- amulet/level/java/anvil/_dimension.py +170 -0
- amulet/level/java/anvil/_dimension.pyi +109 -0
- amulet/level/java/anvil/_region.py +421 -0
- amulet/level/java/anvil/_region.pyi +197 -0
- amulet/level/java/anvil/_sector_manager.py +223 -0
- amulet/level/java/anvil/_sector_manager.pyi +142 -0
- amulet/level/java/chunk.pyi +81 -0
- amulet/level/java/chunk_/_chunk.py +260 -0
- amulet/level/java/chunk_/components/inhabited_time.py +12 -0
- amulet/level/java/chunk_/components/last_update.py +12 -0
- amulet/level/java/chunk_/components/legacy_version.py +12 -0
- amulet/level/java/chunk_/components/light_populated.py +12 -0
- amulet/level/java/chunk_/components/named_height_2d.py +37 -0
- amulet/level/java/chunk_/components/status.py +11 -0
- amulet/level/java/chunk_/components/terrain_populated.py +12 -0
- amulet/level/java/chunk_components.pyi +22 -0
- amulet/level/java/long_array.pyi +38 -0
- amulet/level/java_forge/__init__.py +0 -0
- amulet/level/mcstructure/__init__.py +0 -0
- amulet/level/nbt/__init__.py +0 -0
- amulet/level/schematic/__init__.py +0 -0
- amulet/level/sponge_schematic/__init__.py +0 -0
- amulet/level/temporary_level/__init__.py +1 -0
- amulet/level/temporary_level/_level.py +16 -0
- amulet/palette/__init__.pyi +8 -0
- amulet/palette/biome_palette.pyi +45 -0
- amulet/palette/block_palette.pyi +45 -0
- amulet/player.py +64 -0
- amulet/py.typed +0 -0
- amulet/selection/__init__.py +2 -0
- amulet/selection/abstract_selection.py +342 -0
- amulet/selection/box.py +852 -0
- amulet/selection/group.py +481 -0
- amulet/utils/__init__.pyi +28 -0
- amulet/utils/call_spec/__init__.py +24 -0
- amulet/utils/call_spec/__init__.pyi +53 -0
- amulet/utils/call_spec/_call_spec.py +262 -0
- amulet/utils/call_spec/_call_spec.pyi +272 -0
- amulet/utils/format_utils.py +41 -0
- amulet/utils/generator.py +18 -0
- amulet/utils/matrix.py +243 -0
- amulet/utils/matrix.pyi +177 -0
- amulet/utils/numpy.pyi +11 -0
- amulet/utils/numpy_helpers.py +19 -0
- amulet/utils/shareable_lock.py +335 -0
- amulet/utils/shareable_lock.pyi +190 -0
- amulet/utils/signal/__init__.py +10 -0
- amulet/utils/signal/__init__.pyi +25 -0
- amulet/utils/signal/_signal.py +228 -0
- amulet/utils/signal/_signal.pyi +84 -0
- amulet/utils/task_manager.py +235 -0
- amulet/utils/task_manager.pyi +168 -0
- amulet/utils/typed_property.py +111 -0
- amulet/utils/typing.py +4 -0
- amulet/utils/typing.pyi +6 -0
- amulet/utils/weakref.py +70 -0
- amulet/utils/weakref.pyi +50 -0
- amulet/utils/world_utils.py +102 -0
- amulet/utils/world_utils.pyi +109 -0
- amulet/version.cpp +136 -0
- amulet/version.hpp +142 -0
- amulet/version.pyi +94 -0
- amulet_core-2.0a5.dist-info/METADATA +103 -0
- amulet_core-2.0a5.dist-info/RECORD +210 -0
- amulet_core-2.0a5.dist-info/WHEEL +5 -0
- amulet_core-2.0a5.dist-info/entry_points.txt +2 -0
- amulet_core-2.0a5.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# from __future__ import annotations
|
|
2
|
+
# from amulet.chunk.components.abc import ChunkComponent
|
|
3
|
+
#
|
|
4
|
+
#
|
|
5
|
+
# class InhabitedTimeComponent(ChunkComponent[int, int]):
|
|
6
|
+
# storage_key = b"jit"
|
|
7
|
+
#
|
|
8
|
+
# @staticmethod
|
|
9
|
+
# def fix_set_data(old_obj: int, new_obj: int) -> int:
|
|
10
|
+
# if not isinstance(new_obj, int):
|
|
11
|
+
# raise TypeError
|
|
12
|
+
# return new_obj
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# from __future__ import annotations
|
|
2
|
+
# from amulet.chunk.components.abc import ChunkComponent
|
|
3
|
+
#
|
|
4
|
+
#
|
|
5
|
+
# class LastUpdateComponent(ChunkComponent[int, int]):
|
|
6
|
+
# storage_key = b"jlu"
|
|
7
|
+
#
|
|
8
|
+
# @staticmethod
|
|
9
|
+
# def fix_set_data(old_obj: int, new_obj: int) -> int:
|
|
10
|
+
# if not isinstance(new_obj, int):
|
|
11
|
+
# raise TypeError
|
|
12
|
+
# return new_obj
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# from __future__ import annotations
|
|
2
|
+
# from amulet.chunk.components.abc import ChunkComponent
|
|
3
|
+
#
|
|
4
|
+
#
|
|
5
|
+
# class LegacyVersionComponent(ChunkComponent[int, int]):
|
|
6
|
+
# storage_key = b"jlv"
|
|
7
|
+
#
|
|
8
|
+
# @staticmethod
|
|
9
|
+
# def fix_set_data(old_obj: int, new_obj: int) -> int:
|
|
10
|
+
# if not isinstance(new_obj, int):
|
|
11
|
+
# raise TypeError
|
|
12
|
+
# return new_obj
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# from __future__ import annotations
|
|
2
|
+
# from amulet.chunk.components.abc import ChunkComponent
|
|
3
|
+
#
|
|
4
|
+
#
|
|
5
|
+
# class LightPopulatedComponent(ChunkComponent[bool, bool]):
|
|
6
|
+
# storage_key = b"jtp"
|
|
7
|
+
#
|
|
8
|
+
# @staticmethod
|
|
9
|
+
# def fix_set_data(old_obj: bool, new_obj: bool) -> bool:
|
|
10
|
+
# if not isinstance(new_obj, bool):
|
|
11
|
+
# raise TypeError
|
|
12
|
+
# return new_obj
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# import numpy
|
|
2
|
+
# from amulet.chunk.components.abc import ChunkComponent
|
|
3
|
+
#
|
|
4
|
+
#
|
|
5
|
+
# class NamedHeight2DData:
|
|
6
|
+
# arrays: dict[str, numpy.ndarray]
|
|
7
|
+
#
|
|
8
|
+
# def __init__(
|
|
9
|
+
# self, shape: tuple[int, int], arrays: dict[str, numpy.ndarray]
|
|
10
|
+
# ) -> None:
|
|
11
|
+
# self._shape = shape
|
|
12
|
+
# self.arrays = arrays
|
|
13
|
+
#
|
|
14
|
+
# @property
|
|
15
|
+
# def shape(self) -> tuple[int, int]:
|
|
16
|
+
# return self._shape
|
|
17
|
+
#
|
|
18
|
+
#
|
|
19
|
+
# class NamedHeight2DComponent(ChunkComponent[NamedHeight2DData, NamedHeight2DData]):
|
|
20
|
+
# storage_key = b"nh2d"
|
|
21
|
+
#
|
|
22
|
+
# @staticmethod
|
|
23
|
+
# def fix_set_data(
|
|
24
|
+
# old_obj: NamedHeight2DData, new_obj: NamedHeight2DData
|
|
25
|
+
# ) -> NamedHeight2DData:
|
|
26
|
+
# if not isinstance(new_obj, NamedHeight2DData):
|
|
27
|
+
# raise TypeError
|
|
28
|
+
# if new_obj.shape != old_obj.shape:
|
|
29
|
+
# raise ValueError
|
|
30
|
+
# for key, value in new_obj.arrays.items():
|
|
31
|
+
# if not isinstance(key, str):
|
|
32
|
+
# raise TypeError
|
|
33
|
+
# if not isinstance(value, numpy.ndarray):
|
|
34
|
+
# raise TypeError
|
|
35
|
+
# if value.shape != old_obj.shape:
|
|
36
|
+
# raise ValueError
|
|
37
|
+
# return new_obj
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# from amulet.chunk.components.abc import ChunkComponent
|
|
2
|
+
#
|
|
3
|
+
#
|
|
4
|
+
# class StatusComponent(ChunkComponent[str, str]):
|
|
5
|
+
# storage_key = b"jst"
|
|
6
|
+
#
|
|
7
|
+
# @staticmethod
|
|
8
|
+
# def fix_set_data(old_obj: str, new_obj: str) -> str:
|
|
9
|
+
# if not isinstance(new_obj, str):
|
|
10
|
+
# raise TypeError
|
|
11
|
+
# return new_obj
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# from __future__ import annotations
|
|
2
|
+
# from amulet.chunk.components.abc import ChunkComponent
|
|
3
|
+
#
|
|
4
|
+
#
|
|
5
|
+
# class TerrainPopulatedComponent(ChunkComponent[bool, bool]):
|
|
6
|
+
# storage_key = b"jtp"
|
|
7
|
+
#
|
|
8
|
+
# @staticmethod
|
|
9
|
+
# def fix_set_data(old_obj: bool, new_obj: bool) -> bool:
|
|
10
|
+
# if not isinstance(new_obj, bool):
|
|
11
|
+
# raise TypeError
|
|
12
|
+
# return new_obj
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import collections.abc
|
|
4
|
+
import typing
|
|
5
|
+
|
|
6
|
+
import amulet_nbt
|
|
7
|
+
|
|
8
|
+
__all__ = ["DataVersionComponent", "JavaRawChunkComponent"]
|
|
9
|
+
|
|
10
|
+
class DataVersionComponent:
|
|
11
|
+
ComponentID: typing.ClassVar[str] = "Amulet::DataVersionComponent"
|
|
12
|
+
@property
|
|
13
|
+
def data_version(self) -> int: ...
|
|
14
|
+
|
|
15
|
+
class JavaRawChunkComponent:
|
|
16
|
+
ComponentID: typing.ClassVar[str] = "Amulet::JavaRawChunkComponent"
|
|
17
|
+
@property
|
|
18
|
+
def raw_data(self) -> collections.abc.MutableMapping[str, amulet_nbt.NamedTag]: ...
|
|
19
|
+
@raw_data.setter
|
|
20
|
+
def raw_data(
|
|
21
|
+
self, arg1: collections.abc.Mapping[str, amulet_nbt.NamedTag]
|
|
22
|
+
) -> None: ...
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import numpy
|
|
4
|
+
import typing_extensions
|
|
5
|
+
|
|
6
|
+
__all__ = ["decode_long_array", "encode_long_array"]
|
|
7
|
+
|
|
8
|
+
def decode_long_array(
|
|
9
|
+
long_array: typing_extensions.Buffer,
|
|
10
|
+
size: int,
|
|
11
|
+
bits_per_entry: int,
|
|
12
|
+
dense: bool = True,
|
|
13
|
+
) -> numpy.ndarray:
|
|
14
|
+
"""
|
|
15
|
+
Decode a long array (from BlockStates or Heightmaps)
|
|
16
|
+
|
|
17
|
+
:param long_array: Encoded long array
|
|
18
|
+
:param size: The expected size of the returned array
|
|
19
|
+
:param bits_per_entry: The number of bits per entry in the encoded array.
|
|
20
|
+
:param dense: If true the long arrays will be treated as a bit stream. If false they are distinct values with padding
|
|
21
|
+
:return: Decoded array as numpy array
|
|
22
|
+
"""
|
|
23
|
+
|
|
24
|
+
def encode_long_array(
|
|
25
|
+
array: typing_extensions.Buffer,
|
|
26
|
+
bits_per_entry: None | int = None,
|
|
27
|
+
dense: bool = True,
|
|
28
|
+
min_bits_per_entry: int = 1,
|
|
29
|
+
) -> numpy.ndarray[numpy.uint64]:
|
|
30
|
+
"""
|
|
31
|
+
Encode a long array (from BlockStates or Heightmaps)
|
|
32
|
+
|
|
33
|
+
:param array: A numpy array of the data to be encoded.
|
|
34
|
+
:param bits_per_entry: The number of bits to use to store each value. If left as None will use the smallest bits per entry.
|
|
35
|
+
:param dense: If true the long arrays will be treated as a bit stream. If false they are distinct values with padding
|
|
36
|
+
:param min_bits_per_entry: The mimimum value that bits_per_entry can be. If it is less than this it will be capped at this value.
|
|
37
|
+
:return: Encoded array as numpy array
|
|
38
|
+
"""
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from ._level import TemporaryLevel
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from typing import Any
|
|
4
|
+
from amulet.level.abc import Level, CreatableLevel
|
|
5
|
+
from amulet.utils.call_spec import method_spec
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class TemporaryLevel(Level, CreatableLevel):
|
|
9
|
+
"""A temporary level that exists only in memory."""
|
|
10
|
+
|
|
11
|
+
__slots__ = ()
|
|
12
|
+
|
|
13
|
+
@classmethod
|
|
14
|
+
@method_spec()
|
|
15
|
+
def create(cls, *args: Any, **kwargs: Any) -> TemporaryLevel:
|
|
16
|
+
raise NotImplementedError
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from amulet.palette.biome_palette import BiomePalette
|
|
4
|
+
from amulet.palette.block_palette import BlockPalette
|
|
5
|
+
|
|
6
|
+
from . import biome_palette, block_palette
|
|
7
|
+
|
|
8
|
+
__all__ = ["BiomePalette", "BlockPalette", "biome_palette", "block_palette"]
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import collections.abc
|
|
4
|
+
import typing
|
|
5
|
+
|
|
6
|
+
import amulet.biome
|
|
7
|
+
import amulet.version
|
|
8
|
+
|
|
9
|
+
__all__ = ["BiomePalette"]
|
|
10
|
+
|
|
11
|
+
class BiomePalette(amulet.version.VersionRangeContainer):
|
|
12
|
+
@typing.overload
|
|
13
|
+
def __contains__(self, arg0: int) -> bool: ...
|
|
14
|
+
@typing.overload
|
|
15
|
+
def __contains__(self, arg0: amulet.biome.Biome) -> bool: ...
|
|
16
|
+
@typing.overload
|
|
17
|
+
def __getitem__(self, arg0: int) -> amulet.biome.Biome: ...
|
|
18
|
+
@typing.overload
|
|
19
|
+
def __getitem__(self, arg0: slice) -> list: ...
|
|
20
|
+
def __init__(self, arg0: amulet.version.VersionRange) -> None: ...
|
|
21
|
+
def __iter__(self) -> collections.abc.Iterator[typing.Any]: ...
|
|
22
|
+
def __len__(self) -> int: ...
|
|
23
|
+
def __repr__(self) -> str: ...
|
|
24
|
+
def __reversed__(self) -> collections.abc.Iterator[typing.Any]: ...
|
|
25
|
+
def biome_to_index(self, arg0: amulet.biome.Biome) -> int:
|
|
26
|
+
"""
|
|
27
|
+
Get the index of the biome in the palette.
|
|
28
|
+
If it is not in the palette already it will be added first.
|
|
29
|
+
|
|
30
|
+
:param biome: The biome to get the index of.
|
|
31
|
+
:return: The index of the biome in the palette.
|
|
32
|
+
"""
|
|
33
|
+
|
|
34
|
+
def count(self, value: typing.Any) -> int: ...
|
|
35
|
+
def index(
|
|
36
|
+
self, value: typing.Any, start: int = 0, stop: int = 9223372036854775807
|
|
37
|
+
) -> int: ...
|
|
38
|
+
def index_to_biome(self, arg0: int) -> amulet.biome.Biome:
|
|
39
|
+
"""
|
|
40
|
+
Get the biome at the specified palette index.
|
|
41
|
+
|
|
42
|
+
:param index: The index to get
|
|
43
|
+
:return: The biome at that index
|
|
44
|
+
:raises IndexError if there is no biome at that index.
|
|
45
|
+
"""
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import collections.abc
|
|
4
|
+
import typing
|
|
5
|
+
|
|
6
|
+
import amulet.block
|
|
7
|
+
import amulet.version
|
|
8
|
+
|
|
9
|
+
__all__ = ["BlockPalette"]
|
|
10
|
+
|
|
11
|
+
class BlockPalette(amulet.version.VersionRangeContainer):
|
|
12
|
+
@typing.overload
|
|
13
|
+
def __contains__(self, arg0: int) -> bool: ...
|
|
14
|
+
@typing.overload
|
|
15
|
+
def __contains__(self, arg0: amulet.block.BlockStack) -> bool: ...
|
|
16
|
+
@typing.overload
|
|
17
|
+
def __getitem__(self, arg0: int) -> amulet.block.BlockStack: ...
|
|
18
|
+
@typing.overload
|
|
19
|
+
def __getitem__(self, arg0: slice) -> list: ...
|
|
20
|
+
def __init__(self, arg0: amulet.version.VersionRange) -> None: ...
|
|
21
|
+
def __iter__(self) -> collections.abc.Iterator[typing.Any]: ...
|
|
22
|
+
def __len__(self) -> int: ...
|
|
23
|
+
def __repr__(self) -> str: ...
|
|
24
|
+
def __reversed__(self) -> collections.abc.Iterator[typing.Any]: ...
|
|
25
|
+
def block_stack_to_index(self, arg0: amulet.block.BlockStack) -> int:
|
|
26
|
+
"""
|
|
27
|
+
Get the index of the block stack in the palette.
|
|
28
|
+
If it is not in the palette already it will be added first.
|
|
29
|
+
|
|
30
|
+
:param block_stack: The block stack to get the index of.
|
|
31
|
+
:return: The index of the block stack in the palette.
|
|
32
|
+
"""
|
|
33
|
+
|
|
34
|
+
def count(self, value: typing.Any) -> int: ...
|
|
35
|
+
def index(
|
|
36
|
+
self, value: typing.Any, start: int = 0, stop: int = 9223372036854775807
|
|
37
|
+
) -> int: ...
|
|
38
|
+
def index_to_block_stack(self, arg0: int) -> amulet.block.BlockStack:
|
|
39
|
+
"""
|
|
40
|
+
Get the block stack at the specified palette index.
|
|
41
|
+
|
|
42
|
+
:param index: The index to get
|
|
43
|
+
:return: The block stack at that index
|
|
44
|
+
:raises IndexError if there is no block stack at that index.
|
|
45
|
+
"""
|
amulet/player.py
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from typing import Tuple
|
|
4
|
+
|
|
5
|
+
from amulet.data_types import DimensionId
|
|
6
|
+
|
|
7
|
+
LOCAL_PLAYER = "~local_player"
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class Player:
|
|
11
|
+
def __init__(
|
|
12
|
+
self,
|
|
13
|
+
player_id: str,
|
|
14
|
+
dimension_id: DimensionId,
|
|
15
|
+
location: Tuple[float, float, float],
|
|
16
|
+
rotation: Tuple[float, float],
|
|
17
|
+
) -> None:
|
|
18
|
+
"""
|
|
19
|
+
Creates a new instance of :class:`Player` with the given UUID, location, and rotation
|
|
20
|
+
|
|
21
|
+
:param player_id: The ID of the player
|
|
22
|
+
:param location: The location of the player in world coordinates
|
|
23
|
+
:param rotation: The rotation of the player
|
|
24
|
+
:param dimension_id: The dimension the player is in
|
|
25
|
+
"""
|
|
26
|
+
super().__init__()
|
|
27
|
+
assert isinstance(player_id, str)
|
|
28
|
+
assert (
|
|
29
|
+
isinstance(location, tuple)
|
|
30
|
+
and len(location) == 3
|
|
31
|
+
and all(isinstance(f, float) for f in location)
|
|
32
|
+
)
|
|
33
|
+
assert (
|
|
34
|
+
isinstance(rotation, tuple)
|
|
35
|
+
and len(rotation) == 2
|
|
36
|
+
and all(isinstance(f, float) for f in rotation)
|
|
37
|
+
)
|
|
38
|
+
self._player_id = player_id
|
|
39
|
+
self._location = location
|
|
40
|
+
self._rotation = rotation
|
|
41
|
+
self._dimension_id = dimension_id
|
|
42
|
+
|
|
43
|
+
def __repr__(self) -> str:
|
|
44
|
+
return f"Player({self.player_id}, {self.dimension_id}, {self.location}, {self.rotation})"
|
|
45
|
+
|
|
46
|
+
@property
|
|
47
|
+
def player_id(self) -> str:
|
|
48
|
+
"""The player's ID"""
|
|
49
|
+
return self._player_id
|
|
50
|
+
|
|
51
|
+
@property
|
|
52
|
+
def location(self) -> Tuple[float, float, float]:
|
|
53
|
+
"""The current location of the player in the world"""
|
|
54
|
+
return self._location
|
|
55
|
+
|
|
56
|
+
@property
|
|
57
|
+
def rotation(self) -> Tuple[float, float]:
|
|
58
|
+
"""The current rotation of the player in the world"""
|
|
59
|
+
return self._rotation
|
|
60
|
+
|
|
61
|
+
@property
|
|
62
|
+
def dimension_id(self) -> DimensionId:
|
|
63
|
+
"""The current dimension the player is in"""
|
|
64
|
+
return self._dimension_id
|
amulet/py.typed
ADDED
|
File without changes
|