amulet-core 2.0a8__cp312-cp312-win_amd64.whl → 2.0.1a3.post250529101330__cp312-cp312-win_amd64.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/core/__init__.py +36 -0
- amulet/core/__pyinstaller/hook-amulet.core.py +4 -0
- amulet/core/_amulet_core.cp312-win_amd64.pyd +0 -0
- amulet/core/_amulet_core.pyi +7 -0
- amulet/{_version.py → core/_version.py} +3 -3
- amulet/core/amulet_core.dll +0 -0
- amulet/core/amulet_core.lib +0 -0
- amulet/core/amulet_coreConfig.cmake +18 -0
- amulet/{biome.pyi → core/biome/__init__.pyi} +3 -3
- amulet/core/biome/biome.hpp +53 -0
- amulet/{block.pyi → core/block/__init__.pyi} +25 -26
- amulet/core/block/block.hpp +156 -0
- amulet/{block_entity.pyi → core/block_entity/__init__.pyi} +7 -7
- amulet/core/block_entity/block_entity.hpp +84 -0
- amulet/{errors.py → core/chunk/__init__.pyi} +37 -33
- amulet/core/chunk/chunk.hpp +126 -0
- amulet/core/chunk/component/__init__.pyi +18 -0
- amulet/core/chunk/component/biome_3d_component.hpp +96 -0
- amulet/core/chunk/component/block_component.hpp +101 -0
- amulet/core/chunk/component/block_component.pyi +28 -0
- amulet/core/chunk/component/block_entity_component.hpp +119 -0
- amulet/core/chunk/component/section_array_map.hpp +129 -0
- amulet/{chunk_components.pyi → core/chunk/component/section_array_map.pyi} +4 -24
- amulet/core/dll.hpp +21 -0
- amulet/core/entity/__init__.pyi +105 -0
- amulet/core/entity/entity.hpp +100 -0
- amulet/{palette → core/palette}/__init__.pyi +2 -2
- amulet/core/palette/biome_palette.hpp +65 -0
- amulet/{palette → core/palette}/biome_palette.pyi +8 -8
- amulet/core/palette/block_palette.hpp +71 -0
- amulet/{palette → core/palette}/block_palette.pyi +12 -10
- amulet/core/selection/__init__.pyi +8 -0
- amulet/core/selection/box.hpp +86 -0
- amulet/core/selection/box.pyi +215 -0
- amulet/core/selection/group.hpp +80 -0
- amulet/core/selection/group.pyi +213 -0
- amulet/{version.pyi → core/version/__init__.pyi} +58 -10
- amulet/core/version/version.hpp +204 -0
- {amulet_core-2.0a8.dist-info → amulet_core-2.0.1a3.post250529101330.dist-info}/METADATA +25 -20
- amulet_core-2.0.1a3.post250529101330.dist-info/RECORD +45 -0
- {amulet_core-2.0a8.dist-info → amulet_core-2.0.1a3.post250529101330.dist-info}/WHEEL +1 -1
- amulet_core-2.0.1a3.post250529101330.dist-info/entry_points.txt +2 -0
- amulet/__init__.cp312-win_amd64.pyd +0 -0
- amulet/__init__.py.cpp +0 -45
- amulet/__init__.pyi +0 -30
- amulet/__pyinstaller/hook-amulet.py +0 -4
- amulet/_init.py +0 -26
- amulet/biome.cpp +0 -36
- amulet/biome.hpp +0 -43
- amulet/biome.py.cpp +0 -122
- amulet/block.cpp +0 -435
- amulet/block.hpp +0 -119
- amulet/block.py.cpp +0 -377
- amulet/block_entity.cpp +0 -12
- amulet/block_entity.hpp +0 -56
- amulet/block_entity.py.cpp +0 -115
- amulet/chunk.cpp +0 -16
- amulet/chunk.hpp +0 -100
- amulet/chunk.py.cpp +0 -80
- amulet/chunk.pyi +0 -28
- amulet/chunk_components/biome_3d_component.cpp +0 -5
- amulet/chunk_components/biome_3d_component.hpp +0 -79
- amulet/chunk_components/block_component.cpp +0 -41
- amulet/chunk_components/block_component.hpp +0 -88
- amulet/chunk_components/block_entity_component.cpp +0 -5
- amulet/chunk_components/block_entity_component.hpp +0 -147
- amulet/chunk_components/section_array_map.cpp +0 -129
- amulet/chunk_components/section_array_map.hpp +0 -147
- amulet/collections/eq.py.hpp +0 -37
- amulet/collections/hash.py.hpp +0 -27
- amulet/collections/holder.py.hpp +0 -37
- amulet/collections/iterator.py.hpp +0 -80
- amulet/collections/mapping.py.hpp +0 -199
- amulet/collections/mutable_mapping.py.hpp +0 -226
- amulet/collections/sequence.py.hpp +0 -163
- amulet/collections.pyi +0 -40
- amulet/data_types.py +0 -29
- amulet/entity.py +0 -182
- amulet/game/__init__.py +0 -7
- amulet/game/_game.py +0 -152
- amulet/game/_universal/__init__.py +0 -1
- amulet/game/_universal/_biome.py +0 -17
- amulet/game/_universal/_block.py +0 -47
- amulet/game/_universal/_version.py +0 -68
- amulet/game/abc/__init__.py +0 -22
- amulet/game/abc/_block_specification.py +0 -150
- amulet/game/abc/biome.py +0 -213
- amulet/game/abc/block.py +0 -331
- amulet/game/abc/game_version_container.py +0 -25
- amulet/game/abc/json_interface.py +0 -27
- amulet/game/abc/version.py +0 -44
- amulet/game/bedrock/__init__.py +0 -1
- amulet/game/bedrock/_biome.py +0 -35
- amulet/game/bedrock/_block.py +0 -42
- amulet/game/bedrock/_version.py +0 -165
- amulet/game/java/__init__.py +0 -2
- amulet/game/java/_biome.py +0 -35
- amulet/game/java/_block.py +0 -60
- amulet/game/java/_version.py +0 -176
- amulet/game/translate/__init__.py +0 -12
- amulet/game/translate/_functions/__init__.py +0 -15
- amulet/game/translate/_functions/_code_functions/__init__.py +0 -0
- amulet/game/translate/_functions/_code_functions/_text.py +0 -553
- amulet/game/translate/_functions/_code_functions/banner_pattern.py +0 -67
- amulet/game/translate/_functions/_code_functions/bedrock_chest_connection.py +0 -152
- amulet/game/translate/_functions/_code_functions/bedrock_moving_block_pos.py +0 -88
- amulet/game/translate/_functions/_code_functions/bedrock_sign.py +0 -152
- amulet/game/translate/_functions/_code_functions/bedrock_skull_rotation.py +0 -16
- amulet/game/translate/_functions/_code_functions/custom_name.py +0 -146
- amulet/game/translate/_functions/_frozen.py +0 -66
- amulet/game/translate/_functions/_state.py +0 -54
- amulet/game/translate/_functions/_typing.py +0 -98
- amulet/game/translate/_functions/abc.py +0 -123
- amulet/game/translate/_functions/carry_nbt.py +0 -160
- amulet/game/translate/_functions/carry_properties.py +0 -80
- amulet/game/translate/_functions/code.py +0 -143
- amulet/game/translate/_functions/map_block_name.py +0 -66
- amulet/game/translate/_functions/map_nbt.py +0 -111
- amulet/game/translate/_functions/map_properties.py +0 -93
- amulet/game/translate/_functions/multiblock.py +0 -112
- amulet/game/translate/_functions/new_block.py +0 -42
- amulet/game/translate/_functions/new_entity.py +0 -43
- amulet/game/translate/_functions/new_nbt.py +0 -206
- amulet/game/translate/_functions/new_properties.py +0 -64
- amulet/game/translate/_functions/sequence.py +0 -51
- amulet/game/translate/_functions/walk_input_nbt.py +0 -331
- amulet/game/translate/_translator.py +0 -433
- amulet/img/__init__.py +0 -10
- amulet/img/missing_no.png +0 -0
- amulet/img/missing_pack.png +0 -0
- amulet/img/missing_world.png +0 -0
- amulet/io/binary_reader.hpp +0 -45
- amulet/io/binary_writer.hpp +0 -30
- amulet/item.py +0 -75
- amulet/level/__init__.pyi +0 -23
- amulet/level/_load.py +0 -100
- amulet/level/abc/__init__.py +0 -12
- amulet/level/abc/_chunk_handle.py +0 -358
- amulet/level/abc/_dimension.py +0 -86
- amulet/level/abc/_history/__init__.py +0 -1
- amulet/level/abc/_history/_cache.py +0 -224
- amulet/level/abc/_history/_history_manager.py +0 -291
- amulet/level/abc/_level/__init__.py +0 -5
- amulet/level/abc/_level/_compactable_level.py +0 -10
- amulet/level/abc/_level/_creatable_level.py +0 -28
- amulet/level/abc/_level/_disk_level.py +0 -17
- amulet/level/abc/_level/_level.py +0 -449
- amulet/level/abc/_level/_loadable_level.py +0 -42
- amulet/level/abc/_player_storage.py +0 -7
- amulet/level/abc/_raw_level.py +0 -187
- amulet/level/abc/_registry.py +0 -40
- amulet/level/java/__init__.pyi +0 -16
- amulet/level/java/_chunk_handle.py +0 -17
- amulet/level/java/_dimension.py +0 -20
- amulet/level/java/_level.py +0 -184
- amulet/level/java/_raw/__init__.pyi +0 -15
- amulet/level/java/_raw/_chunk.pyi +0 -23
- amulet/level/java/_raw/_constant.py +0 -9
- amulet/level/java/_raw/_data_pack/__init__.py +0 -2
- amulet/level/java/_raw/_data_pack/data_pack.py +0 -241
- amulet/level/java/_raw/_data_pack/data_pack_manager.py +0 -77
- amulet/level/java/_raw/_dimension.py +0 -86
- amulet/level/java/_raw/_level.py +0 -507
- amulet/level/java/_raw/_typing.py +0 -3
- amulet/level/java/_raw/java_chunk_decode.cpp +0 -531
- amulet/level/java/_raw/java_chunk_decode.hpp +0 -23
- amulet/level/java/_raw/java_chunk_encode.cpp +0 -25
- amulet/level/java/_raw/java_chunk_encode.hpp +0 -23
- amulet/level/java/anvil/__init__.py +0 -2
- amulet/level/java/anvil/_dimension.py +0 -170
- amulet/level/java/anvil/_region.py +0 -421
- amulet/level/java/anvil/_sector_manager.py +0 -223
- amulet/level/java/chunk.pyi +0 -81
- amulet/level/java/chunk_/_chunk.py +0 -260
- amulet/level/java/chunk_/components/inhabited_time.py +0 -12
- amulet/level/java/chunk_/components/last_update.py +0 -12
- amulet/level/java/chunk_/components/legacy_version.py +0 -12
- amulet/level/java/chunk_/components/light_populated.py +0 -12
- amulet/level/java/chunk_/components/named_height_2d.py +0 -37
- amulet/level/java/chunk_/components/status.py +0 -11
- amulet/level/java/chunk_/components/terrain_populated.py +0 -12
- amulet/level/java/chunk_components/data_version_component.cpp +0 -32
- amulet/level/java/chunk_components/data_version_component.hpp +0 -31
- amulet/level/java/chunk_components/java_raw_chunk_component.cpp +0 -56
- amulet/level/java/chunk_components/java_raw_chunk_component.hpp +0 -45
- amulet/level/java/chunk_components.pyi +0 -22
- amulet/level/java/java_chunk.cpp +0 -170
- amulet/level/java/java_chunk.hpp +0 -141
- amulet/level/java/long_array.hpp +0 -175
- amulet/level/java/long_array.pyi +0 -39
- amulet/level/temporary_level/__init__.py +0 -1
- amulet/level/temporary_level/_level.py +0 -16
- amulet/mesh/__init__.py +0 -0
- amulet/mesh/block/__init__.pyi +0 -301
- amulet/mesh/block/_cube.py +0 -198
- amulet/mesh/block/_missing_block.py +0 -20
- amulet/mesh/block/block_mesh.cpp +0 -107
- amulet/mesh/block/block_mesh.hpp +0 -207
- amulet/mesh/util.py +0 -17
- amulet/palette/biome_palette.hpp +0 -85
- amulet/palette/block_palette.cpp +0 -32
- amulet/palette/block_palette.hpp +0 -93
- amulet/player.py +0 -62
- amulet/pybind11/collections.hpp +0 -118
- amulet/pybind11/numpy.hpp +0 -26
- amulet/pybind11/py_module.hpp +0 -34
- amulet/pybind11/type_hints.hpp +0 -51
- amulet/pybind11/types.hpp +0 -25
- amulet/pybind11/typing.hpp +0 -7
- amulet/resource_pack/__init__.py +0 -63
- amulet/resource_pack/abc/__init__.py +0 -2
- amulet/resource_pack/abc/resource_pack.py +0 -38
- amulet/resource_pack/abc/resource_pack_manager.py +0 -85
- amulet/resource_pack/java/__init__.py +0 -2
- amulet/resource_pack/java/download_resources.py +0 -212
- amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_black.png +0 -0
- amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_blue.png +0 -0
- amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_brown.png +0 -0
- amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_cyan.png +0 -0
- amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_gray.png +0 -0
- amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_green.png +0 -0
- amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_light_blue.png +0 -0
- amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_light_gray.png +0 -0
- amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_lime.png +0 -0
- amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_magenta.png +0 -0
- amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_orange.png +0 -0
- amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_pink.png +0 -0
- amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_purple.png +0 -0
- amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_red.png +0 -0
- amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_white.png +0 -0
- amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_yellow.png +0 -0
- amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/barrier.png +0 -0
- amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/end_portal.png +0 -0
- amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/grass.png +0 -0
- amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/lava.png +0 -0
- amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/structure_void.png +0 -0
- amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/water.png +0 -0
- amulet/resource_pack/java/java_vanilla_fix/pack.png +0 -0
- amulet/resource_pack/java/resource_pack.py +0 -44
- amulet/resource_pack/java/resource_pack_manager.py +0 -563
- amulet/resource_pack/unknown_resource_pack.py +0 -10
- amulet/selection/__init__.py +0 -2
- amulet/selection/abstract_selection.py +0 -342
- amulet/selection/box.py +0 -852
- amulet/selection/group.py +0 -481
- amulet/utils/__init__.pyi +0 -23
- amulet/utils/call_spec/__init__.py +0 -24
- amulet/utils/call_spec/_call_spec.py +0 -257
- amulet/utils/cast.py +0 -10
- amulet/utils/comment_json.py +0 -188
- amulet/utils/format_utils.py +0 -41
- amulet/utils/generator.py +0 -18
- amulet/utils/matrix.py +0 -243
- amulet/utils/numpy.hpp +0 -36
- amulet/utils/numpy.pyi +0 -11
- amulet/utils/numpy_helpers.py +0 -19
- amulet/utils/shareable_lock.py +0 -335
- amulet/utils/signal/__init__.py +0 -10
- amulet/utils/signal/_signal.py +0 -228
- amulet/utils/task_manager.py +0 -235
- amulet/utils/typed_property.py +0 -111
- amulet/utils/weakref.py +0 -70
- amulet/utils/world_utils.py +0 -102
- amulet/version.cpp +0 -136
- amulet/version.hpp +0 -142
- amulet/version.py.cpp +0 -281
- amulet_core-2.0a8.dist-info/RECORD +0 -241
- amulet_core-2.0a8.dist-info/entry_points.txt +0 -2
- /amulet/{__pyinstaller → core/__pyinstaller}/__init__.py +0 -0
- /amulet/{py.typed → core/py.typed} +0 -0
- {amulet_core-2.0a8.dist-info → amulet_core-2.0.1a3.post250529101330.dist-info}/top_level.txt +0 -0
|
@@ -1,226 +0,0 @@
|
|
|
1
|
-
#pragma once
|
|
2
|
-
|
|
3
|
-
#include <memory>
|
|
4
|
-
|
|
5
|
-
#include <pybind11/pybind11.h>
|
|
6
|
-
|
|
7
|
-
#include "mapping.py.hpp"
|
|
8
|
-
|
|
9
|
-
namespace py = pybind11;
|
|
10
|
-
|
|
11
|
-
namespace Amulet {
|
|
12
|
-
namespace collections {
|
|
13
|
-
template <typename KT = py::object, typename VT = py::object, typename clsT>
|
|
14
|
-
void PyMutableMapping_pop(clsT cls) {
|
|
15
|
-
py::object marker = py::module::import("builtins").attr("Ellipsis");
|
|
16
|
-
cls.def(
|
|
17
|
-
"pop",
|
|
18
|
-
[marker](
|
|
19
|
-
py::object self,
|
|
20
|
-
Amulet::pybind11::type_hints::PyObjectCpp<KT> key,
|
|
21
|
-
Amulet::pybind11::type_hints::PyObjectCpp<VT> default_
|
|
22
|
-
) -> Amulet::pybind11::type_hints::PyObjectCpp<VT> {
|
|
23
|
-
py::object value;
|
|
24
|
-
try {
|
|
25
|
-
value = self.attr("__getitem__")(key);
|
|
26
|
-
}
|
|
27
|
-
catch (const py::error_already_set& e) {
|
|
28
|
-
if (e.matches(PyExc_KeyError)) {
|
|
29
|
-
if (default_.is(marker)) {
|
|
30
|
-
throw;
|
|
31
|
-
}
|
|
32
|
-
return default_;
|
|
33
|
-
}
|
|
34
|
-
else {
|
|
35
|
-
throw;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
self.attr("__delitem__")(key);
|
|
39
|
-
return value;
|
|
40
|
-
},
|
|
41
|
-
py::arg("key"),
|
|
42
|
-
py::arg("default") = marker
|
|
43
|
-
);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
template <typename KT = py::object, typename VT = py::object, typename clsT>
|
|
47
|
-
void PyMutableMapping_popitem(clsT cls) {
|
|
48
|
-
py::object iter = py::module::import("builtins").attr("iter");
|
|
49
|
-
py::object next = py::module::import("builtins").attr("next");
|
|
50
|
-
cls.def(
|
|
51
|
-
"popitem",
|
|
52
|
-
[iter, next](py::object self) -> std::pair<
|
|
53
|
-
Amulet::pybind11::type_hints::PyObjectCpp<KT>,
|
|
54
|
-
Amulet::pybind11::type_hints::PyObjectCpp<VT>
|
|
55
|
-
> {
|
|
56
|
-
py::object key;
|
|
57
|
-
try {
|
|
58
|
-
key = next(iter(self));
|
|
59
|
-
}
|
|
60
|
-
catch (const py::error_already_set& e) {
|
|
61
|
-
if (e.matches(PyExc_StopIteration)) {
|
|
62
|
-
throw py::key_error();
|
|
63
|
-
}
|
|
64
|
-
else {
|
|
65
|
-
throw;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
py::object value = self.attr("__getitem__")(key);
|
|
69
|
-
self.attr("__delitem__")(key);
|
|
70
|
-
return std::make_pair(key, value);
|
|
71
|
-
}
|
|
72
|
-
);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
template <typename clsT>
|
|
76
|
-
void PyMutableMapping_clear(clsT cls) {
|
|
77
|
-
cls.def(
|
|
78
|
-
"clear",
|
|
79
|
-
[](py::object self) {
|
|
80
|
-
try {
|
|
81
|
-
while (true) {
|
|
82
|
-
self.attr("popitem")();
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
catch (const py::error_already_set& e) {
|
|
86
|
-
if (!e.matches(PyExc_KeyError)) {
|
|
87
|
-
throw;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
);
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
template <typename clsT>
|
|
95
|
-
void PyMutableMapping_update(clsT cls) {
|
|
96
|
-
py::object isinstance = py::module::import("builtins").attr("isinstance");
|
|
97
|
-
py::object hasattr = py::module::import("builtins").attr("hasattr");
|
|
98
|
-
py::object PyMapping = py::module::import("collections.abc").attr("Mapping");
|
|
99
|
-
cls.def(
|
|
100
|
-
"update",
|
|
101
|
-
[
|
|
102
|
-
isinstance,
|
|
103
|
-
hasattr,
|
|
104
|
-
PyMapping
|
|
105
|
-
](
|
|
106
|
-
py::object self,
|
|
107
|
-
py::object other,
|
|
108
|
-
py::kwargs kwargs
|
|
109
|
-
) {
|
|
110
|
-
if (isinstance(other, PyMapping)) {
|
|
111
|
-
for (auto it = other.begin(); it != other.end(); it++) {
|
|
112
|
-
self.attr("__setitem__")(*it, other.attr("__getitem__")(*it));
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
else if (hasattr(other, "keys")) {
|
|
116
|
-
py::object keys = other.attr("keys")();
|
|
117
|
-
for (auto it = keys.begin(); it != keys.end(); it++) {
|
|
118
|
-
self.attr("__setitem__")(*it, other.attr("__getitem__")(*it));
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
else {
|
|
122
|
-
for (auto it = other.begin(); it != other.end(); it++) {
|
|
123
|
-
self.attr("__setitem__")(
|
|
124
|
-
*it->attr("__getitem__")(0),
|
|
125
|
-
*it->attr("__getitem__")(1)
|
|
126
|
-
);
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
py::object items = kwargs.attr("items")();
|
|
130
|
-
for (auto it = items.begin(); it != items.end(); it++) {
|
|
131
|
-
self.attr("__setitem__")(
|
|
132
|
-
*it->attr("__getitem__")(0),
|
|
133
|
-
*it->attr("__getitem__")(1)
|
|
134
|
-
);
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
},
|
|
138
|
-
py::arg("other") = py::tuple()
|
|
139
|
-
);
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
template <typename KT = py::object, typename VT = py::object, typename clsT>
|
|
143
|
-
void PyMutableMapping_setdefault(clsT cls) {
|
|
144
|
-
cls.def(
|
|
145
|
-
"setdefault",
|
|
146
|
-
[](
|
|
147
|
-
py::object self,
|
|
148
|
-
Amulet::pybind11::type_hints::PyObjectCpp<KT> key,
|
|
149
|
-
py::typing::Optional<VT> default_ = py::none()
|
|
150
|
-
) -> py::typing::Optional<VT> {
|
|
151
|
-
try {
|
|
152
|
-
return self.attr("__getitem__")(key);
|
|
153
|
-
}
|
|
154
|
-
catch (const py::error_already_set& e) {
|
|
155
|
-
if (e.matches(PyExc_KeyError)) {
|
|
156
|
-
self.attr("__setitem__")(key, default_);
|
|
157
|
-
}
|
|
158
|
-
else {
|
|
159
|
-
throw;
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
return default_;
|
|
163
|
-
}
|
|
164
|
-
);
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
template <typename clsT>
|
|
168
|
-
void PyMutableMapping_register(clsT cls) {
|
|
169
|
-
py::module::import("collections.abc").attr("MutableMapping").attr("register")(cls);
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
class MutableMapping : public Mapping {
|
|
173
|
-
public:
|
|
174
|
-
virtual ~MutableMapping() {};
|
|
175
|
-
virtual void setitem(py::object py_key, py::object py_value) = 0;
|
|
176
|
-
virtual void delitem(py::object py_key) = 0;
|
|
177
|
-
virtual void clear() = 0;
|
|
178
|
-
};
|
|
179
|
-
|
|
180
|
-
template <typename mapT>
|
|
181
|
-
class Map : public MutableMapping {
|
|
182
|
-
private:
|
|
183
|
-
py::object _owner;
|
|
184
|
-
mapT& _map;
|
|
185
|
-
public:
|
|
186
|
-
Map(
|
|
187
|
-
mapT& map,
|
|
188
|
-
py::object owner = py::none()
|
|
189
|
-
) : _owner(owner), _map(map) {}
|
|
190
|
-
|
|
191
|
-
py::object getitem(py::object py_key) const override {
|
|
192
|
-
return py::cast(_map.at(py_key.cast<typename mapT::key_type>()));
|
|
193
|
-
}
|
|
194
|
-
std::shared_ptr<Iterator> iter() const override {
|
|
195
|
-
return std::make_shared<MapIterator<mapT>>(_map, _owner);
|
|
196
|
-
}
|
|
197
|
-
size_t size() const override {
|
|
198
|
-
return _map.size();
|
|
199
|
-
}
|
|
200
|
-
bool contains(py::object py_key) const override {
|
|
201
|
-
return _map.contains(py_key.cast<typename mapT::key_type>());
|
|
202
|
-
}
|
|
203
|
-
void setitem(py::object py_key, py::object py_value) override {
|
|
204
|
-
_map.insert_or_assign(
|
|
205
|
-
py_key.cast<typename mapT::key_type>(),
|
|
206
|
-
py_value.cast<typename mapT::mapped_type>()
|
|
207
|
-
);
|
|
208
|
-
}
|
|
209
|
-
void delitem(py::object py_key) override {
|
|
210
|
-
_map.erase(py_key.cast<typename mapT::key_type>());
|
|
211
|
-
}
|
|
212
|
-
void clear() override {
|
|
213
|
-
_map.clear();
|
|
214
|
-
}
|
|
215
|
-
};
|
|
216
|
-
|
|
217
|
-
template <typename mapT>
|
|
218
|
-
static py::object make_map(mapT& value, py::object owner = py::none()) {
|
|
219
|
-
return py::cast(
|
|
220
|
-
static_cast<std::shared_ptr<MutableMapping>>(
|
|
221
|
-
std::make_shared<Map<mapT>>(value, owner)
|
|
222
|
-
)
|
|
223
|
-
);
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
}
|
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
#pragma once
|
|
2
|
-
|
|
3
|
-
#include <algorithm>
|
|
4
|
-
#include <cstddef>
|
|
5
|
-
#include <memory>
|
|
6
|
-
|
|
7
|
-
#include <pybind11/pybind11.h>
|
|
8
|
-
#include "iterator.py.hpp"
|
|
9
|
-
#include <amulet/pybind11/collections.hpp>
|
|
10
|
-
|
|
11
|
-
namespace py = pybind11;
|
|
12
|
-
|
|
13
|
-
namespace Amulet {
|
|
14
|
-
namespace collections {
|
|
15
|
-
|
|
16
|
-
template <typename clsT>
|
|
17
|
-
void Sequence_getitem_slice(clsT cls) {
|
|
18
|
-
cls.def(
|
|
19
|
-
"__getitem__",
|
|
20
|
-
[](py::object self, const py::slice& slice) {
|
|
21
|
-
size_t start = 0, stop = 0, step = 0, slicelength = 0;
|
|
22
|
-
if (!slice.compute(py::len(self), &start, &stop, &step, &slicelength)) {
|
|
23
|
-
throw py::error_already_set();
|
|
24
|
-
}
|
|
25
|
-
py::list out(slicelength);
|
|
26
|
-
py::object getitem = self.attr("__getitem__");
|
|
27
|
-
for (size_t i = 0; i < slicelength; ++i) {
|
|
28
|
-
out[i] = getitem(start);
|
|
29
|
-
start += step;
|
|
30
|
-
}
|
|
31
|
-
return out;
|
|
32
|
-
}
|
|
33
|
-
);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
template <typename clsT>
|
|
37
|
-
void Sequence_contains(clsT cls) {
|
|
38
|
-
cls.def(
|
|
39
|
-
"__contains__",
|
|
40
|
-
[](py::object self, py::object value) {
|
|
41
|
-
py::iterator it = py::iter(self);
|
|
42
|
-
while (it != py::iterator::sentinel()) {
|
|
43
|
-
if (it->equal(value)) {
|
|
44
|
-
return true;
|
|
45
|
-
}
|
|
46
|
-
++it;
|
|
47
|
-
}
|
|
48
|
-
return false;
|
|
49
|
-
}
|
|
50
|
-
);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
template <typename elemT = py::object, typename clsT>
|
|
54
|
-
void Sequence_iter(clsT cls) {
|
|
55
|
-
cls.def(
|
|
56
|
-
"__iter__",
|
|
57
|
-
[](py::object self) -> Amulet::pybind11::collections::Iterator<elemT> {
|
|
58
|
-
return py::cast(
|
|
59
|
-
static_cast<std::shared_ptr<Amulet::collections::Iterator>>(
|
|
60
|
-
std::make_shared<PySequenceIterator>(self, 0, 1)
|
|
61
|
-
)
|
|
62
|
-
);
|
|
63
|
-
}
|
|
64
|
-
);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
template <typename elemT = py::object, typename clsT>
|
|
68
|
-
void Sequence_reversed(clsT cls) {
|
|
69
|
-
cls.def(
|
|
70
|
-
"__reversed__",
|
|
71
|
-
[](py::object self) -> Amulet::pybind11::collections::Iterator<elemT> {
|
|
72
|
-
return py::cast(
|
|
73
|
-
static_cast<std::shared_ptr<Amulet::collections::Iterator>>(
|
|
74
|
-
std::make_shared<PySequenceIterator>(self, py::len(self) - 1, -1)
|
|
75
|
-
)
|
|
76
|
-
);
|
|
77
|
-
}
|
|
78
|
-
);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
template <typename clsT>
|
|
82
|
-
void Sequence_index(clsT cls) {
|
|
83
|
-
cls.def(
|
|
84
|
-
"index",
|
|
85
|
-
[](py::object self, py::object value, Py_ssize_t s_start, Py_ssize_t s_stop) {
|
|
86
|
-
size_t size = py::len(self);
|
|
87
|
-
size_t start;
|
|
88
|
-
size_t stop;
|
|
89
|
-
if (s_start < 0) {
|
|
90
|
-
start = std::max<Py_ssize_t>(0, size + s_start);
|
|
91
|
-
}
|
|
92
|
-
else {
|
|
93
|
-
start = s_start;
|
|
94
|
-
}
|
|
95
|
-
if (s_stop < 0) {
|
|
96
|
-
stop = size + s_stop;
|
|
97
|
-
}
|
|
98
|
-
else {
|
|
99
|
-
stop = s_stop;
|
|
100
|
-
}
|
|
101
|
-
py::object getitem = self.attr("__getitem__");
|
|
102
|
-
while (start < stop) {
|
|
103
|
-
py::object obj;
|
|
104
|
-
try {
|
|
105
|
-
obj = getitem(start);
|
|
106
|
-
}
|
|
107
|
-
catch (py::error_already_set& e) {
|
|
108
|
-
if (e.matches(PyExc_IndexError)) {
|
|
109
|
-
break;
|
|
110
|
-
}
|
|
111
|
-
else {
|
|
112
|
-
throw;
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
if (value.equal(obj)) {
|
|
117
|
-
return start;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
start++;
|
|
121
|
-
}
|
|
122
|
-
throw py::value_error("");
|
|
123
|
-
},
|
|
124
|
-
py::arg("value"), py::arg("start") = 0, py::arg("stop") = std::numeric_limits<Py_ssize_t>::max()
|
|
125
|
-
);
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
template <typename clsT>
|
|
129
|
-
void Sequence_count(clsT cls) {
|
|
130
|
-
cls.def(
|
|
131
|
-
"count",
|
|
132
|
-
[](py::object self, py::object value) {
|
|
133
|
-
size_t count = 0;
|
|
134
|
-
size_t size = py::len(self);
|
|
135
|
-
py::object getitem = self.attr("__getitem__");
|
|
136
|
-
for (size_t i = 0; i < size; ++i) {
|
|
137
|
-
if (value.equal(getitem(i))) {
|
|
138
|
-
count++;
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
return count;
|
|
142
|
-
},
|
|
143
|
-
py::arg("value")
|
|
144
|
-
);
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
template <typename clsT>
|
|
148
|
-
void Sequence_register(clsT cls) {
|
|
149
|
-
py::module::import("collections.abc").attr("Sequence").attr("register")(cls);
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
template <typename elemT = py::object, typename clsT>
|
|
153
|
-
void Sequence(clsT cls) {
|
|
154
|
-
Sequence_getitem_slice(cls);
|
|
155
|
-
Sequence_contains(cls);
|
|
156
|
-
Sequence_iter<elemT>(cls);
|
|
157
|
-
Sequence_reversed<elemT>(cls);
|
|
158
|
-
Sequence_index(cls);
|
|
159
|
-
Sequence_count(cls);
|
|
160
|
-
Sequence_register(cls);
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
}
|
amulet/collections.pyi
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
import collections.abc
|
|
4
|
-
import types
|
|
5
|
-
import typing
|
|
6
|
-
|
|
7
|
-
__all__ = ["Holder", "Iterator", "Mapping", "MutableMapping"]
|
|
8
|
-
|
|
9
|
-
class Holder:
|
|
10
|
-
"""
|
|
11
|
-
A utility class for keeping smart pointers alive.
|
|
12
|
-
"""
|
|
13
|
-
|
|
14
|
-
class Iterator:
|
|
15
|
-
def __iter__(self: typing.Iterator) -> typing.Iterator: ...
|
|
16
|
-
def __next__(self: typing.Iterator) -> typing.Any: ...
|
|
17
|
-
|
|
18
|
-
class Mapping:
|
|
19
|
-
def __contains__(self, arg0: typing.Any) -> bool: ...
|
|
20
|
-
def __eq__(self, arg0: typing.Any) -> bool | types.NotImplementedType: ...
|
|
21
|
-
def __getitem__(self, arg0: typing.Any) -> typing.Any: ...
|
|
22
|
-
def __hash__(self) -> int: ...
|
|
23
|
-
def __iter__(self) -> typing.Iterator: ...
|
|
24
|
-
def __len__(self) -> int: ...
|
|
25
|
-
def __repr__(self) -> str: ...
|
|
26
|
-
def get(self, arg0: typing.Any, arg1: typing.Any | None) -> typing.Any | None: ...
|
|
27
|
-
def items(self) -> collections.abc.ItemsView[typing.Any, typing.Any]: ...
|
|
28
|
-
def keys(self) -> collections.abc.KeysView[typing.Any]: ...
|
|
29
|
-
def values(self) -> collections.abc.ValuesView[typing.Any]: ...
|
|
30
|
-
|
|
31
|
-
class MutableMapping(Mapping):
|
|
32
|
-
def __delitem__(self, arg0: typing.Any) -> None: ...
|
|
33
|
-
def __setitem__(self, arg0: typing.Any, arg1: typing.Any) -> None: ...
|
|
34
|
-
def clear(self) -> None: ...
|
|
35
|
-
def pop(self, key: typing.Any, default: typing.Any = ...) -> typing.Any: ...
|
|
36
|
-
def popitem(self) -> tuple[typing.Any, typing.Any]: ...
|
|
37
|
-
def setdefault(
|
|
38
|
-
self, arg0: typing.Any, arg1: typing.Any | None
|
|
39
|
-
) -> typing.Any | None: ...
|
|
40
|
-
def update(self, other: typing.Any = (), **kwargs) -> None: ...
|
amulet/data_types.py
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
from typing import TypeAlias
|
|
2
|
-
import numpy
|
|
3
|
-
|
|
4
|
-
#: The type for a dimension identifier
|
|
5
|
-
DimensionId: TypeAlias = str
|
|
6
|
-
|
|
7
|
-
#: The data type for the x and z coordinates of a region file. Note these are no the same as block coordinates.
|
|
8
|
-
RegionCoordinates: TypeAlias = tuple[int, int]
|
|
9
|
-
|
|
10
|
-
#: The data type for the x and z coordinate of a chunk. Note these are no the same as block coordinates.
|
|
11
|
-
ChunkCoordinates: TypeAlias = tuple[int, int]
|
|
12
|
-
|
|
13
|
-
#: The data type for the x, y and z coordinates of a sub-chunk within the world. Note these are no the same as block coordinates.
|
|
14
|
-
SubChunkCoordinates: TypeAlias = tuple[int, int, int]
|
|
15
|
-
|
|
16
|
-
#: The data type for the x, y and z location of a block within the world.
|
|
17
|
-
BlockCoordinates: TypeAlias = tuple[int, int, int]
|
|
18
|
-
|
|
19
|
-
#: The data type for the x, y and z location of a block within the world in the form of a numpy array.
|
|
20
|
-
BlockCoordinatesArray: TypeAlias = numpy.ndarray # NDArray[(3, ), int]
|
|
21
|
-
|
|
22
|
-
#: The data type for the x, y and z location of a point within the world.
|
|
23
|
-
PointCoordinates: TypeAlias = tuple[float, float, float]
|
|
24
|
-
|
|
25
|
-
#: The data type for the x, y and z location of a point within the world in the form of a numpy array.
|
|
26
|
-
PointCoordinatesArray: TypeAlias = numpy.ndarray # NDArray[(3, ), numpy.float]
|
|
27
|
-
|
|
28
|
-
#: The data type for a tuple containing three floats. Use :data:`PointCoordinates` for x, y, z float coordinates.
|
|
29
|
-
FloatTriplet: TypeAlias = tuple[float, float, float]
|
amulet/entity.py
DELETED
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
from typing import Any
|
|
4
|
-
from amulet_nbt import NamedTag
|
|
5
|
-
from amulet.version import PlatformVersionContainer, VersionNumber
|
|
6
|
-
from amulet.data_types import PointCoordinates
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
class Entity(PlatformVersionContainer):
|
|
10
|
-
"""
|
|
11
|
-
A class to contain all the data to define an Entity.
|
|
12
|
-
"""
|
|
13
|
-
|
|
14
|
-
__slots__ = (
|
|
15
|
-
"_namespace",
|
|
16
|
-
"_base_name",
|
|
17
|
-
"_x",
|
|
18
|
-
"_y",
|
|
19
|
-
"_z",
|
|
20
|
-
"_nbt",
|
|
21
|
-
)
|
|
22
|
-
|
|
23
|
-
def __init__(
|
|
24
|
-
self,
|
|
25
|
-
platform: str,
|
|
26
|
-
version: VersionNumber,
|
|
27
|
-
namespace: str,
|
|
28
|
-
base_name: str,
|
|
29
|
-
x: float,
|
|
30
|
-
y: float,
|
|
31
|
-
z: float,
|
|
32
|
-
nbt: NamedTag,
|
|
33
|
-
) -> None:
|
|
34
|
-
"""
|
|
35
|
-
Constructs a :class:`Entity` instance.
|
|
36
|
-
|
|
37
|
-
:param platform: The platform the entity is defined in.
|
|
38
|
-
:param version: The version the entity is defined in.
|
|
39
|
-
:param namespace: The namespace of the entity eg "minecraft"
|
|
40
|
-
:param base_name: The base name of the entity eg "creeper"
|
|
41
|
-
:param x: The x coordinate of the entity
|
|
42
|
-
:param y: The y coordinate of the entity
|
|
43
|
-
:param z: The z coordinate of the entity
|
|
44
|
-
:param nbt: The NBT stored with the entity
|
|
45
|
-
"""
|
|
46
|
-
super().__init__(platform, version)
|
|
47
|
-
self._namespace = str(namespace)
|
|
48
|
-
self._base_name = str(base_name)
|
|
49
|
-
self._x = float(x)
|
|
50
|
-
self._y = float(y)
|
|
51
|
-
self._z = float(z)
|
|
52
|
-
if not isinstance(nbt, NamedTag):
|
|
53
|
-
raise TypeError(f"nbt must be an NamedTag. Got {nbt}")
|
|
54
|
-
self._nbt = nbt
|
|
55
|
-
|
|
56
|
-
def __getstate__(self) -> tuple[tuple[str, VersionNumber], tuple[str, str, float, float, float, NamedTag]]: # type: ignore[override]
|
|
57
|
-
raise NotImplementedError
|
|
58
|
-
# return (
|
|
59
|
-
# super().__getstate__(),
|
|
60
|
-
# (
|
|
61
|
-
# self._namespace,
|
|
62
|
-
# self._base_name,
|
|
63
|
-
# self._x,
|
|
64
|
-
# self._y,
|
|
65
|
-
# self._z,
|
|
66
|
-
# self._nbt,
|
|
67
|
-
# ),
|
|
68
|
-
# )
|
|
69
|
-
|
|
70
|
-
def __setstate__(self, state: tuple[tuple[str, VersionNumber], tuple[str, str, float, float, float, NamedTag]]) -> None: # type: ignore[override]
|
|
71
|
-
raise NotImplementedError
|
|
72
|
-
# super().__setstate__(state[0])
|
|
73
|
-
# (
|
|
74
|
-
# self._namespace,
|
|
75
|
-
# self._base_name,
|
|
76
|
-
# self._x,
|
|
77
|
-
# self._y,
|
|
78
|
-
# self._z,
|
|
79
|
-
# self._nbt,
|
|
80
|
-
# ) = state[1]
|
|
81
|
-
|
|
82
|
-
def __eq__(self, other: Any) -> bool:
|
|
83
|
-
if not isinstance(other, Entity):
|
|
84
|
-
return NotImplemented
|
|
85
|
-
return self.__getstate__() == other.__getstate__()
|
|
86
|
-
|
|
87
|
-
def __hash__(self) -> int:
|
|
88
|
-
return id(self)
|
|
89
|
-
|
|
90
|
-
def __repr__(self) -> str:
|
|
91
|
-
return f"Entity({self.platform!r}, {self.version!r}, {self._namespace!r}, {self._base_name!r}, {self._x}, {self._y}, {self._z}, {self._nbt!r})"
|
|
92
|
-
|
|
93
|
-
@property
|
|
94
|
-
def namespaced_name(self) -> str:
|
|
95
|
-
"""
|
|
96
|
-
The namespace:base_name of the entity represented by the object (eg: `minecraft:creeper`)
|
|
97
|
-
|
|
98
|
-
If the given namespace is an empty string it will just return the base name.
|
|
99
|
-
|
|
100
|
-
:return: namespace:base_name of the entity
|
|
101
|
-
"""
|
|
102
|
-
return f"{self._namespace}:{self._base_name}"
|
|
103
|
-
|
|
104
|
-
@property
|
|
105
|
-
def namespace(self) -> str:
|
|
106
|
-
"""
|
|
107
|
-
The namespace of the entity represented by the Entity object (eg: `minecraft`)
|
|
108
|
-
|
|
109
|
-
:return: The namespace of the entity
|
|
110
|
-
"""
|
|
111
|
-
return self._namespace
|
|
112
|
-
|
|
113
|
-
@namespace.setter
|
|
114
|
-
def namespace(self, value: str) -> None:
|
|
115
|
-
self._namespace = value
|
|
116
|
-
|
|
117
|
-
@property
|
|
118
|
-
def base_name(self) -> str:
|
|
119
|
-
"""
|
|
120
|
-
The base name of the entity represented by the Entity object (eg: `creeper`, `pig`)
|
|
121
|
-
|
|
122
|
-
:return: The base name of the entity
|
|
123
|
-
"""
|
|
124
|
-
return self._base_name
|
|
125
|
-
|
|
126
|
-
@base_name.setter
|
|
127
|
-
def base_name(self, value: str) -> None:
|
|
128
|
-
self._base_name = value
|
|
129
|
-
|
|
130
|
-
@property
|
|
131
|
-
def x(self) -> float:
|
|
132
|
-
"""The x location of the Entity."""
|
|
133
|
-
return self._x
|
|
134
|
-
|
|
135
|
-
@x.setter
|
|
136
|
-
def x(self, value: float) -> None:
|
|
137
|
-
self._x = float(value)
|
|
138
|
-
|
|
139
|
-
@property
|
|
140
|
-
def y(self) -> float:
|
|
141
|
-
"""The y location of the Entity."""
|
|
142
|
-
return self._y
|
|
143
|
-
|
|
144
|
-
@y.setter
|
|
145
|
-
def y(self, value: float) -> None:
|
|
146
|
-
self._y = float(value)
|
|
147
|
-
|
|
148
|
-
@property
|
|
149
|
-
def z(self) -> float:
|
|
150
|
-
"""The z location of the Entity."""
|
|
151
|
-
return self._z
|
|
152
|
-
|
|
153
|
-
@z.setter
|
|
154
|
-
def z(self, value: float) -> None:
|
|
155
|
-
self._z = float(value)
|
|
156
|
-
|
|
157
|
-
@property
|
|
158
|
-
def location(self) -> PointCoordinates:
|
|
159
|
-
"""The location of the Entity."""
|
|
160
|
-
return self._x, self._y, self._z
|
|
161
|
-
|
|
162
|
-
@location.setter
|
|
163
|
-
def location(self, location: PointCoordinates) -> None:
|
|
164
|
-
self.x, self.y, self.z = location
|
|
165
|
-
|
|
166
|
-
@property
|
|
167
|
-
def nbt(self) -> NamedTag:
|
|
168
|
-
"""
|
|
169
|
-
The NBT behind the object
|
|
170
|
-
|
|
171
|
-
:getter: Get the NBT data stored in the object
|
|
172
|
-
:setter: Set the NBT data stored in the object
|
|
173
|
-
|
|
174
|
-
:return: A NamedTag
|
|
175
|
-
"""
|
|
176
|
-
return self._nbt
|
|
177
|
-
|
|
178
|
-
@nbt.setter
|
|
179
|
-
def nbt(self, value: NamedTag) -> None:
|
|
180
|
-
if not isinstance(value, NamedTag):
|
|
181
|
-
raise TypeError
|
|
182
|
-
self._nbt = value
|
amulet/game/__init__.py
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"""
|
|
2
|
-
A module to store data about the game including state enumerations and translations between different game versions.
|
|
3
|
-
"""
|
|
4
|
-
|
|
5
|
-
from ._game import game_platforms, game_versions, get_game_version
|
|
6
|
-
from .java import JavaGameVersion
|
|
7
|
-
from .bedrock import BedrockGameVersion
|