amulet-core 2.0a8__cp311-cp311-win_amd64.whl → 2.0.1a3.post250529101324__cp311-cp311-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.cp311-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.post250529101324.dist-info}/METADATA +25 -20
- amulet_core-2.0.1a3.post250529101324.dist-info/RECORD +45 -0
- {amulet_core-2.0a8.dist-info → amulet_core-2.0.1a3.post250529101324.dist-info}/WHEEL +1 -1
- amulet_core-2.0.1a3.post250529101324.dist-info/entry_points.txt +2 -0
- amulet/__init__.cp311-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.post250529101324.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import types
|
|
4
|
+
import typing
|
|
5
|
+
|
|
6
|
+
import amulet.core.version
|
|
7
|
+
import amulet.nbt
|
|
8
|
+
|
|
9
|
+
__all__ = ["Entity"]
|
|
10
|
+
|
|
11
|
+
class Entity(amulet.core.version.PlatformVersionContainer):
|
|
12
|
+
"""
|
|
13
|
+
A class to contain all the data to define an Entity.
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
@typing.overload
|
|
17
|
+
def __eq__(self, arg0: Entity) -> bool: ...
|
|
18
|
+
@typing.overload
|
|
19
|
+
def __eq__(self, arg0: typing.Any) -> bool | types.NotImplementedType: ...
|
|
20
|
+
def __hash__(self) -> int: ...
|
|
21
|
+
def __init__(
|
|
22
|
+
self,
|
|
23
|
+
platform: str,
|
|
24
|
+
version: amulet.core.version.VersionNumber,
|
|
25
|
+
namespace: str,
|
|
26
|
+
base_name: str,
|
|
27
|
+
x: float,
|
|
28
|
+
y: float,
|
|
29
|
+
z: float,
|
|
30
|
+
nbt: amulet.nbt.NamedTag,
|
|
31
|
+
) -> None: ...
|
|
32
|
+
def __repr__(self) -> str: ...
|
|
33
|
+
@property
|
|
34
|
+
def base_name(self) -> str:
|
|
35
|
+
"""
|
|
36
|
+
The base name of the entity represented by the :class:`Entity` object.
|
|
37
|
+
|
|
38
|
+
>>> entity: Entity
|
|
39
|
+
>>> entity.base_name
|
|
40
|
+
|
|
41
|
+
:return: The base name of the entity
|
|
42
|
+
"""
|
|
43
|
+
|
|
44
|
+
@base_name.setter
|
|
45
|
+
def base_name(self, arg1: str) -> None: ...
|
|
46
|
+
@property
|
|
47
|
+
def namespace(self) -> str:
|
|
48
|
+
"""
|
|
49
|
+
The namespace of the entity represented by the :class:`Entity` object.
|
|
50
|
+
|
|
51
|
+
>>> entity: Entity
|
|
52
|
+
>>> entity.namespace
|
|
53
|
+
|
|
54
|
+
:return: The namespace of the entity
|
|
55
|
+
"""
|
|
56
|
+
|
|
57
|
+
@namespace.setter
|
|
58
|
+
def namespace(self, arg1: str) -> None: ...
|
|
59
|
+
@property
|
|
60
|
+
def namespaced_name(self) -> str:
|
|
61
|
+
"""
|
|
62
|
+
The namespace:base_name of the entity represented by the :class:`Entity` object.
|
|
63
|
+
|
|
64
|
+
>>> entity: Entity
|
|
65
|
+
>>> entity.namespaced_name
|
|
66
|
+
|
|
67
|
+
:return: The namespace:base_name of the entity
|
|
68
|
+
"""
|
|
69
|
+
|
|
70
|
+
@property
|
|
71
|
+
def nbt(self) -> amulet.nbt.NamedTag:
|
|
72
|
+
"""
|
|
73
|
+
The nbt data for the entity.
|
|
74
|
+
>>> entity: Entity
|
|
75
|
+
>>> entity.nbt
|
|
76
|
+
|
|
77
|
+
:return: The NamedTag of the entity
|
|
78
|
+
"""
|
|
79
|
+
|
|
80
|
+
@nbt.setter
|
|
81
|
+
def nbt(self, arg1: amulet.nbt.NamedTag) -> None: ...
|
|
82
|
+
@property
|
|
83
|
+
def x(self) -> float:
|
|
84
|
+
"""
|
|
85
|
+
The x coordinate of the entity.
|
|
86
|
+
"""
|
|
87
|
+
|
|
88
|
+
@x.setter
|
|
89
|
+
def x(self, arg1: float) -> None: ...
|
|
90
|
+
@property
|
|
91
|
+
def y(self) -> float:
|
|
92
|
+
"""
|
|
93
|
+
The y coordinate of the entity.
|
|
94
|
+
"""
|
|
95
|
+
|
|
96
|
+
@y.setter
|
|
97
|
+
def y(self, arg1: float) -> None: ...
|
|
98
|
+
@property
|
|
99
|
+
def z(self) -> float:
|
|
100
|
+
"""
|
|
101
|
+
The z coordinate of the entity.
|
|
102
|
+
"""
|
|
103
|
+
|
|
104
|
+
@z.setter
|
|
105
|
+
def z(self, arg1: float) -> None: ...
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
|
|
3
|
+
#include <map>
|
|
4
|
+
#include <string>
|
|
5
|
+
#include <variant>
|
|
6
|
+
|
|
7
|
+
#include <amulet/io/binary_reader.hpp>
|
|
8
|
+
#include <amulet/io/binary_writer.hpp>
|
|
9
|
+
|
|
10
|
+
#include <amulet/nbt/tag/eq.hpp>
|
|
11
|
+
#include <amulet/nbt/tag/named_tag.hpp>
|
|
12
|
+
|
|
13
|
+
#include <amulet/core/dll.hpp>
|
|
14
|
+
#include <amulet/core/version/version.hpp>
|
|
15
|
+
|
|
16
|
+
namespace Amulet {
|
|
17
|
+
|
|
18
|
+
class Entity : public PlatformVersionContainer {
|
|
19
|
+
private:
|
|
20
|
+
std::string _namespace;
|
|
21
|
+
std::string _base_name;
|
|
22
|
+
std::shared_ptr<Amulet::NBT::NamedTag> _nbt;
|
|
23
|
+
double _x;
|
|
24
|
+
double _y;
|
|
25
|
+
double _z;
|
|
26
|
+
|
|
27
|
+
public:
|
|
28
|
+
const std::string& get_namespace() const { return _namespace; }
|
|
29
|
+
|
|
30
|
+
template <typename NamespaceT>
|
|
31
|
+
void set_namespace(NamespaceT&& namespace_) { _namespace = std::forward<NamespaceT>(namespace_); }
|
|
32
|
+
|
|
33
|
+
const std::string& get_base_name() const { return _base_name; }
|
|
34
|
+
|
|
35
|
+
template <typename BaseNameT>
|
|
36
|
+
void set_base_name(BaseNameT&& base_name) { _base_name = std::forward<BaseNameT>(base_name); }
|
|
37
|
+
|
|
38
|
+
std::shared_ptr<Amulet::NBT::NamedTag> get_nbt() const { return _nbt; }
|
|
39
|
+
|
|
40
|
+
template <typename NBTT>
|
|
41
|
+
void set_nbt(NBTT&& nbt)
|
|
42
|
+
{
|
|
43
|
+
if constexpr (std::is_same_v<std::shared_ptr<Amulet::NBT::NamedTag>, std::decay_t<NBTT>>) {
|
|
44
|
+
_nbt = std::forward<NBTT>(nbt);
|
|
45
|
+
} else {
|
|
46
|
+
_nbt = std::make_shared<Amulet::NBT::NamedTag>(std::forward<NBTT>(nbt));
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
double get_x() const { return _x; }
|
|
51
|
+
|
|
52
|
+
double get_y() const { return _y; }
|
|
53
|
+
|
|
54
|
+
double get_z() const { return _z; }
|
|
55
|
+
|
|
56
|
+
void set_x(double x) { _x = x; }
|
|
57
|
+
|
|
58
|
+
void set_y(double y) { _y = y; }
|
|
59
|
+
|
|
60
|
+
void set_z(double z) { _z = z; }
|
|
61
|
+
|
|
62
|
+
template <
|
|
63
|
+
typename PlatformT,
|
|
64
|
+
typename VersionNumberT,
|
|
65
|
+
typename NamespaceT,
|
|
66
|
+
typename BaseNameT,
|
|
67
|
+
typename NBTT>
|
|
68
|
+
Entity(
|
|
69
|
+
PlatformT&& platform,
|
|
70
|
+
VersionNumberT&& version,
|
|
71
|
+
NamespaceT&& namespace_,
|
|
72
|
+
BaseNameT&& base_name,
|
|
73
|
+
double x,
|
|
74
|
+
double y,
|
|
75
|
+
double z,
|
|
76
|
+
NBTT&& nbt)
|
|
77
|
+
: PlatformVersionContainer(std::forward<PlatformT>(platform), std::forward<VersionNumberT>(version))
|
|
78
|
+
, _namespace(std::forward<NamespaceT>(namespace_))
|
|
79
|
+
, _base_name(std::forward<BaseNameT>(base_name))
|
|
80
|
+
, _nbt(
|
|
81
|
+
[&nbt]() {
|
|
82
|
+
if constexpr (std::is_same_v<std::shared_ptr<Amulet::NBT::NamedTag>, NBTT>) {
|
|
83
|
+
return std::forward<NBTT>(nbt);
|
|
84
|
+
} else {
|
|
85
|
+
return std::make_shared<Amulet::NBT::NamedTag>(std::forward<NBTT>(nbt));
|
|
86
|
+
}
|
|
87
|
+
}())
|
|
88
|
+
, _x(x)
|
|
89
|
+
, _y(y)
|
|
90
|
+
, _z(z)
|
|
91
|
+
{
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
AMULET_CORE_EXPORT void serialise(BinaryWriter&) const;
|
|
95
|
+
AMULET_CORE_EXPORT static Entity deserialise(BinaryReader&);
|
|
96
|
+
|
|
97
|
+
AMULET_CORE_EXPORT bool operator==(const Entity& other) const;
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
} // namespace Amulet
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
-
from amulet.palette.biome_palette import BiomePalette
|
|
4
|
-
from amulet.palette.block_palette import BlockPalette
|
|
3
|
+
from amulet.core.palette.biome_palette import BiomePalette
|
|
4
|
+
from amulet.core.palette.block_palette import BlockPalette
|
|
5
5
|
|
|
6
6
|
from . import biome_palette, block_palette
|
|
7
7
|
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
|
|
3
|
+
#include <map>
|
|
4
|
+
#include <stdexcept>
|
|
5
|
+
|
|
6
|
+
#include <amulet/core/biome/biome.hpp>
|
|
7
|
+
#include <amulet/core/version/version.hpp>
|
|
8
|
+
|
|
9
|
+
namespace Amulet {
|
|
10
|
+
|
|
11
|
+
class BiomePalette : public VersionRangeContainer {
|
|
12
|
+
private:
|
|
13
|
+
std::vector<Biome> _index_to_biome;
|
|
14
|
+
std::map<Biome, size_t> _biome_to_index;
|
|
15
|
+
|
|
16
|
+
public:
|
|
17
|
+
const std::vector<Biome>& get_biomes() const { return _index_to_biome; }
|
|
18
|
+
|
|
19
|
+
template <typename VersionRangeT>
|
|
20
|
+
BiomePalette(VersionRangeT&& version_range)
|
|
21
|
+
: VersionRangeContainer(std::forward<VersionRangeT>(version_range))
|
|
22
|
+
, _index_to_biome()
|
|
23
|
+
, _biome_to_index()
|
|
24
|
+
{
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
AMULET_CORE_EXPORT void serialise(BinaryWriter&) const;
|
|
28
|
+
AMULET_CORE_EXPORT static BiomePalette deserialise(BinaryReader&);
|
|
29
|
+
|
|
30
|
+
bool operator==(const BiomePalette& other) const
|
|
31
|
+
{
|
|
32
|
+
return _index_to_biome == other._index_to_biome;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
size_t size() const { return _index_to_biome.size(); }
|
|
36
|
+
|
|
37
|
+
const Biome& index_to_biome(size_t index) const
|
|
38
|
+
{
|
|
39
|
+
return _index_to_biome.at(index);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
size_t biome_to_index(const Biome& biome)
|
|
43
|
+
{
|
|
44
|
+
auto it = _biome_to_index.find(biome);
|
|
45
|
+
if (it != _biome_to_index.end()) {
|
|
46
|
+
return it->second;
|
|
47
|
+
}
|
|
48
|
+
const auto& version_range = get_version_range();
|
|
49
|
+
if (!version_range.contains(biome.get_platform(), biome.get_version())) {
|
|
50
|
+
throw std::invalid_argument(
|
|
51
|
+
"Biome(\"" + biome.get_platform() + "\", " + biome.get_version().toString() + ") is incompatible with VersionRange(\"" + version_range.get_platform() + "\", " + version_range.get_min_version().toString() + ", " + version_range.get_max_version().toString() + ").");
|
|
52
|
+
}
|
|
53
|
+
size_t index = _index_to_biome.size();
|
|
54
|
+
_index_to_biome.push_back(biome);
|
|
55
|
+
_biome_to_index[biome] = index;
|
|
56
|
+
return index;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
bool contains_biome(const Biome& biome) const
|
|
60
|
+
{
|
|
61
|
+
return _biome_to_index.contains(biome);
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
}
|
|
@@ -3,26 +3,26 @@ from __future__ import annotations
|
|
|
3
3
|
import collections.abc
|
|
4
4
|
import typing
|
|
5
5
|
|
|
6
|
-
import amulet.biome
|
|
7
|
-
import amulet.version
|
|
6
|
+
import amulet.core.biome
|
|
7
|
+
import amulet.core.version
|
|
8
8
|
|
|
9
9
|
__all__ = ["BiomePalette"]
|
|
10
10
|
|
|
11
|
-
class BiomePalette(amulet.version.VersionRangeContainer):
|
|
11
|
+
class BiomePalette(amulet.core.version.VersionRangeContainer):
|
|
12
12
|
@typing.overload
|
|
13
13
|
def __contains__(self, arg0: int) -> bool: ...
|
|
14
14
|
@typing.overload
|
|
15
|
-
def __contains__(self, arg0: amulet.biome.Biome) -> bool: ...
|
|
15
|
+
def __contains__(self, arg0: amulet.core.biome.Biome) -> bool: ...
|
|
16
16
|
@typing.overload
|
|
17
|
-
def __getitem__(self, arg0: int) -> amulet.biome.Biome: ...
|
|
17
|
+
def __getitem__(self, arg0: int) -> amulet.core.biome.Biome: ...
|
|
18
18
|
@typing.overload
|
|
19
19
|
def __getitem__(self, arg0: slice) -> list: ...
|
|
20
|
-
def __init__(self, arg0: amulet.version.VersionRange) -> None: ...
|
|
20
|
+
def __init__(self, arg0: amulet.core.version.VersionRange) -> None: ...
|
|
21
21
|
def __iter__(self) -> collections.abc.Iterator[typing.Any]: ...
|
|
22
22
|
def __len__(self) -> int: ...
|
|
23
23
|
def __repr__(self) -> str: ...
|
|
24
24
|
def __reversed__(self) -> collections.abc.Iterator[typing.Any]: ...
|
|
25
|
-
def biome_to_index(self, arg0: amulet.biome.Biome) -> int:
|
|
25
|
+
def biome_to_index(self, arg0: amulet.core.biome.Biome) -> int:
|
|
26
26
|
"""
|
|
27
27
|
Get the index of the biome in the palette.
|
|
28
28
|
If it is not in the palette already it will be added first.
|
|
@@ -35,7 +35,7 @@ class BiomePalette(amulet.version.VersionRangeContainer):
|
|
|
35
35
|
def index(
|
|
36
36
|
self, value: typing.Any, start: int = 0, stop: int = 9223372036854775807
|
|
37
37
|
) -> int: ...
|
|
38
|
-
def index_to_biome(self, arg0: int) -> amulet.biome.Biome:
|
|
38
|
+
def index_to_biome(self, arg0: int) -> amulet.core.biome.Biome:
|
|
39
39
|
"""
|
|
40
40
|
Get the biome at the specified palette index.
|
|
41
41
|
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
|
|
3
|
+
#include <map>
|
|
4
|
+
#include <stdexcept>
|
|
5
|
+
|
|
6
|
+
#include <amulet/io/binary_reader.hpp>
|
|
7
|
+
#include <amulet/io/binary_writer.hpp>
|
|
8
|
+
|
|
9
|
+
#include <amulet/core/block/block.hpp>
|
|
10
|
+
#include <amulet/core/dll.hpp>
|
|
11
|
+
#include <amulet/core/version/version.hpp>
|
|
12
|
+
|
|
13
|
+
namespace Amulet {
|
|
14
|
+
|
|
15
|
+
class BlockPalette : public VersionRangeContainer {
|
|
16
|
+
private:
|
|
17
|
+
std::vector<BlockStack> _index_to_block;
|
|
18
|
+
std::map<BlockStack, size_t> _block_to_index;
|
|
19
|
+
|
|
20
|
+
public:
|
|
21
|
+
const std::vector<BlockStack>& get_blocks() const { return _index_to_block; }
|
|
22
|
+
|
|
23
|
+
template <typename VersionRangeT>
|
|
24
|
+
BlockPalette(VersionRangeT&& version_range)
|
|
25
|
+
: VersionRangeContainer(std::forward<VersionRangeT>(version_range))
|
|
26
|
+
, _index_to_block()
|
|
27
|
+
, _block_to_index()
|
|
28
|
+
{
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
AMULET_CORE_EXPORT void serialise(BinaryWriter&) const;
|
|
32
|
+
AMULET_CORE_EXPORT static BlockPalette deserialise(BinaryReader&);
|
|
33
|
+
|
|
34
|
+
bool operator==(const BlockPalette& other) const
|
|
35
|
+
{
|
|
36
|
+
return _index_to_block == other._index_to_block;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
size_t size() const { return _index_to_block.size(); }
|
|
40
|
+
|
|
41
|
+
const BlockStack& index_to_block_stack(size_t index) const
|
|
42
|
+
{
|
|
43
|
+
return _index_to_block.at(index);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
size_t block_stack_to_index(const BlockStack& block_stack)
|
|
47
|
+
{
|
|
48
|
+
auto it = _block_to_index.find(block_stack);
|
|
49
|
+
if (it != _block_to_index.end()) {
|
|
50
|
+
return it->second;
|
|
51
|
+
}
|
|
52
|
+
auto version_range = get_version_range();
|
|
53
|
+
for (const auto& block : block_stack.get_blocks()) {
|
|
54
|
+
if (!version_range.contains(block.get_platform(), block.get_version())) {
|
|
55
|
+
throw std::invalid_argument(
|
|
56
|
+
"BlockStack(\"" + block.get_platform() + "\", " + block.get_version().toString() + ") is incompatible with VersionRange(\"" + version_range.get_platform() + "\", " + version_range.get_min_version().toString() + ", " + version_range.get_max_version().toString() + ").");
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
size_t index = _index_to_block.size();
|
|
60
|
+
_index_to_block.push_back(block_stack);
|
|
61
|
+
_block_to_index.emplace(block_stack, index);
|
|
62
|
+
return index;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
bool contains_block(const BlockStack& block) const
|
|
66
|
+
{
|
|
67
|
+
return _block_to_index.contains(block);
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
}
|
|
@@ -3,26 +3,28 @@ from __future__ import annotations
|
|
|
3
3
|
import collections.abc
|
|
4
4
|
import typing
|
|
5
5
|
|
|
6
|
-
import amulet.block
|
|
7
|
-
import amulet.version
|
|
6
|
+
import amulet.core.block
|
|
7
|
+
import amulet.core.version
|
|
8
8
|
|
|
9
9
|
__all__ = ["BlockPalette"]
|
|
10
10
|
|
|
11
|
-
class BlockPalette(amulet.version.VersionRangeContainer):
|
|
11
|
+
class BlockPalette(amulet.core.version.VersionRangeContainer):
|
|
12
12
|
@typing.overload
|
|
13
13
|
def __contains__(self, arg0: int) -> bool: ...
|
|
14
14
|
@typing.overload
|
|
15
|
-
def __contains__(self, arg0: amulet.block.BlockStack) -> bool: ...
|
|
15
|
+
def __contains__(self, arg0: amulet.core.block.BlockStack) -> bool: ...
|
|
16
16
|
@typing.overload
|
|
17
|
-
def __getitem__(self, arg0: int) -> amulet.block.BlockStack: ...
|
|
17
|
+
def __getitem__(self, arg0: int) -> amulet.core.block.BlockStack: ...
|
|
18
18
|
@typing.overload
|
|
19
19
|
def __getitem__(self, arg0: slice) -> list: ...
|
|
20
|
-
def __init__(self, arg0: amulet.version.VersionRange) -> None: ...
|
|
21
|
-
def __iter__(self) -> collections.abc.Iterator[
|
|
20
|
+
def __init__(self, arg0: amulet.core.version.VersionRange) -> None: ...
|
|
21
|
+
def __iter__(self) -> collections.abc.Iterator[amulet.core.block.BlockStack]: ...
|
|
22
22
|
def __len__(self) -> int: ...
|
|
23
23
|
def __repr__(self) -> str: ...
|
|
24
|
-
def __reversed__(
|
|
25
|
-
|
|
24
|
+
def __reversed__(
|
|
25
|
+
self,
|
|
26
|
+
) -> collections.abc.Iterator[amulet.core.block.BlockStack]: ...
|
|
27
|
+
def block_stack_to_index(self, arg0: amulet.core.block.BlockStack) -> int:
|
|
26
28
|
"""
|
|
27
29
|
Get the index of the block stack in the palette.
|
|
28
30
|
If it is not in the palette already it will be added first.
|
|
@@ -35,7 +37,7 @@ class BlockPalette(amulet.version.VersionRangeContainer):
|
|
|
35
37
|
def index(
|
|
36
38
|
self, value: typing.Any, start: int = 0, stop: int = 9223372036854775807
|
|
37
39
|
) -> int: ...
|
|
38
|
-
def index_to_block_stack(self, arg0: int) -> amulet.block.BlockStack:
|
|
40
|
+
def index_to_block_stack(self, arg0: int) -> amulet.core.block.BlockStack:
|
|
39
41
|
"""
|
|
40
42
|
Get the block stack at the specified palette index.
|
|
41
43
|
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
#include <array>
|
|
3
|
+
#include <cstdint>
|
|
4
|
+
|
|
5
|
+
#include <amulet/core/dll.hpp>
|
|
6
|
+
|
|
7
|
+
namespace Amulet {
|
|
8
|
+
|
|
9
|
+
class SelectionGroup;
|
|
10
|
+
|
|
11
|
+
// The SelectionBox class represents a single cuboid selection.
|
|
12
|
+
class SelectionBox {
|
|
13
|
+
private:
|
|
14
|
+
std::int64_t _min_x;
|
|
15
|
+
std::int64_t _min_y;
|
|
16
|
+
std::int64_t _min_z;
|
|
17
|
+
std::uint64_t _size_x;
|
|
18
|
+
std::uint64_t _size_y;
|
|
19
|
+
std::uint64_t _size_z;
|
|
20
|
+
|
|
21
|
+
public:
|
|
22
|
+
SelectionBox(
|
|
23
|
+
std::int64_t min_x,
|
|
24
|
+
std::int64_t min_y,
|
|
25
|
+
std::int64_t min_z,
|
|
26
|
+
std::uint64_t size_x,
|
|
27
|
+
std::uint64_t size_y,
|
|
28
|
+
std::uint64_t size_z)
|
|
29
|
+
: _min_x(min_x)
|
|
30
|
+
, _min_y(min_y)
|
|
31
|
+
, _min_z(min_z)
|
|
32
|
+
, _size_x(size_x)
|
|
33
|
+
, _size_y(size_y)
|
|
34
|
+
, _size_z(size_z)
|
|
35
|
+
{
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
SelectionBox(
|
|
39
|
+
std::array<std::int64_t, 3> point_1,
|
|
40
|
+
std::array<std::int64_t, 3> point_2)
|
|
41
|
+
{
|
|
42
|
+
_min_x = std::min(point_1[0], point_2[0]);
|
|
43
|
+
_min_y = std::min(point_1[1], point_2[1]);
|
|
44
|
+
_min_z = std::min(point_1[2], point_2[2]);
|
|
45
|
+
_size_x = std::max(point_1[0], point_2[0]) - _min_x;
|
|
46
|
+
_size_y = std::max(point_1[1], point_2[1]) - _min_y;
|
|
47
|
+
_size_z = std::max(point_1[2], point_2[2]) - _min_z;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// Accessors
|
|
51
|
+
std::int64_t min_x() const { return _min_x; }
|
|
52
|
+
std::int64_t min_y() const { return _min_y; }
|
|
53
|
+
std::int64_t min_z() const { return _min_z; }
|
|
54
|
+
std::int64_t max_x() const { return _min_x + _size_x; }
|
|
55
|
+
std::int64_t max_y() const { return _min_y + _size_y; }
|
|
56
|
+
std::int64_t max_z() const { return _min_z + _size_z; }
|
|
57
|
+
std::array<std::int64_t, 3> min() const { return { _min_x, _min_y, _min_z }; }
|
|
58
|
+
std::array<std::int64_t, 3> max() const { return { max_x(), max_y(), max_z() }; }
|
|
59
|
+
|
|
60
|
+
// Shape and volume
|
|
61
|
+
std::uint64_t size_x() const { return _size_x; }
|
|
62
|
+
std::uint64_t size_y() const { return _size_y; }
|
|
63
|
+
std::uint64_t size_z() const { return _size_z; }
|
|
64
|
+
std::array<std::uint64_t, 3> shape() const { return { _size_x, _size_y, _size_z }; }
|
|
65
|
+
size_t volume() const { return _size_x * _size_y * _size_z; }
|
|
66
|
+
|
|
67
|
+
// Contains and intersects
|
|
68
|
+
AMULET_CORE_EXPORT bool contains_block(std::int64_t x, std::int64_t y, std::int64_t z) const;
|
|
69
|
+
AMULET_CORE_EXPORT bool contains_point(double x, double y, double z) const;
|
|
70
|
+
AMULET_CORE_EXPORT bool contains_box(const SelectionBox& other) const;
|
|
71
|
+
AMULET_CORE_EXPORT bool intersects(const SelectionBox& other) const;
|
|
72
|
+
AMULET_CORE_EXPORT bool intersects(const SelectionGroup& other) const;
|
|
73
|
+
AMULET_CORE_EXPORT bool touches_or_intersects(const SelectionBox& other) const;
|
|
74
|
+
AMULET_CORE_EXPORT bool touches(const SelectionBox& other) const;
|
|
75
|
+
|
|
76
|
+
// Transform
|
|
77
|
+
AMULET_CORE_EXPORT SelectionBox translate(std::int64_t dx, std::int64_t dy, std::int64_t dz) const;
|
|
78
|
+
// AMULET_CORE_EXPORT SelectionGroup transform() const;
|
|
79
|
+
|
|
80
|
+
// Operators
|
|
81
|
+
auto operator<=>(const SelectionBox&) const = default;
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
} // namespace Amulet
|
|
85
|
+
|
|
86
|
+
#include "group.hpp"
|