amulet-core 2.0a8__cp312-cp312-win_amd64.whl → 2.0.1a2.post250529084747__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.

Files changed (271) hide show
  1. amulet/core/__init__.py +36 -0
  2. amulet/core/__pyinstaller/hook-amulet.core.py +4 -0
  3. amulet/core/_amulet_core.cp312-win_amd64.pyd +0 -0
  4. amulet/core/_amulet_core.pyi +7 -0
  5. amulet/{_version.py → core/_version.py} +3 -3
  6. amulet/core/amulet_core.dll +0 -0
  7. amulet/core/amulet_core.lib +0 -0
  8. amulet/core/amulet_coreConfig.cmake +18 -0
  9. amulet/{biome.pyi → core/biome/__init__.pyi} +3 -3
  10. amulet/core/biome/biome.hpp +53 -0
  11. amulet/{block.pyi → core/block/__init__.pyi} +25 -26
  12. amulet/core/block/block.hpp +156 -0
  13. amulet/{block_entity.pyi → core/block_entity/__init__.pyi} +7 -7
  14. amulet/core/block_entity/block_entity.hpp +84 -0
  15. amulet/{errors.py → core/chunk/__init__.pyi} +37 -33
  16. amulet/core/chunk/chunk.hpp +126 -0
  17. amulet/core/chunk/component/__init__.pyi +18 -0
  18. amulet/core/chunk/component/biome_3d_component.hpp +96 -0
  19. amulet/core/chunk/component/block_component.hpp +101 -0
  20. amulet/core/chunk/component/block_component.pyi +28 -0
  21. amulet/core/chunk/component/block_entity_component.hpp +119 -0
  22. amulet/core/chunk/component/section_array_map.hpp +129 -0
  23. amulet/{chunk_components.pyi → core/chunk/component/section_array_map.pyi} +4 -24
  24. amulet/core/dll.hpp +21 -0
  25. amulet/core/entity/__init__.pyi +105 -0
  26. amulet/core/entity/entity.hpp +100 -0
  27. amulet/{palette → core/palette}/__init__.pyi +2 -2
  28. amulet/core/palette/biome_palette.hpp +65 -0
  29. amulet/{palette → core/palette}/biome_palette.pyi +8 -8
  30. amulet/core/palette/block_palette.hpp +71 -0
  31. amulet/{palette → core/palette}/block_palette.pyi +12 -10
  32. amulet/core/selection/__init__.pyi +8 -0
  33. amulet/core/selection/box.hpp +86 -0
  34. amulet/core/selection/box.pyi +215 -0
  35. amulet/core/selection/group.hpp +80 -0
  36. amulet/core/selection/group.pyi +213 -0
  37. amulet/{version.pyi → core/version/__init__.pyi} +58 -10
  38. amulet/core/version/version.hpp +204 -0
  39. {amulet_core-2.0a8.dist-info → amulet_core-2.0.1a2.post250529084747.dist-info}/METADATA +25 -20
  40. amulet_core-2.0.1a2.post250529084747.dist-info/RECORD +45 -0
  41. {amulet_core-2.0a8.dist-info → amulet_core-2.0.1a2.post250529084747.dist-info}/WHEEL +1 -1
  42. amulet_core-2.0.1a2.post250529084747.dist-info/entry_points.txt +2 -0
  43. amulet/__init__.cp312-win_amd64.pyd +0 -0
  44. amulet/__init__.py.cpp +0 -45
  45. amulet/__init__.pyi +0 -30
  46. amulet/__pyinstaller/hook-amulet.py +0 -4
  47. amulet/_init.py +0 -26
  48. amulet/biome.cpp +0 -36
  49. amulet/biome.hpp +0 -43
  50. amulet/biome.py.cpp +0 -122
  51. amulet/block.cpp +0 -435
  52. amulet/block.hpp +0 -119
  53. amulet/block.py.cpp +0 -377
  54. amulet/block_entity.cpp +0 -12
  55. amulet/block_entity.hpp +0 -56
  56. amulet/block_entity.py.cpp +0 -115
  57. amulet/chunk.cpp +0 -16
  58. amulet/chunk.hpp +0 -100
  59. amulet/chunk.py.cpp +0 -80
  60. amulet/chunk.pyi +0 -28
  61. amulet/chunk_components/biome_3d_component.cpp +0 -5
  62. amulet/chunk_components/biome_3d_component.hpp +0 -79
  63. amulet/chunk_components/block_component.cpp +0 -41
  64. amulet/chunk_components/block_component.hpp +0 -88
  65. amulet/chunk_components/block_entity_component.cpp +0 -5
  66. amulet/chunk_components/block_entity_component.hpp +0 -147
  67. amulet/chunk_components/section_array_map.cpp +0 -129
  68. amulet/chunk_components/section_array_map.hpp +0 -147
  69. amulet/collections/eq.py.hpp +0 -37
  70. amulet/collections/hash.py.hpp +0 -27
  71. amulet/collections/holder.py.hpp +0 -37
  72. amulet/collections/iterator.py.hpp +0 -80
  73. amulet/collections/mapping.py.hpp +0 -199
  74. amulet/collections/mutable_mapping.py.hpp +0 -226
  75. amulet/collections/sequence.py.hpp +0 -163
  76. amulet/collections.pyi +0 -40
  77. amulet/data_types.py +0 -29
  78. amulet/entity.py +0 -182
  79. amulet/game/__init__.py +0 -7
  80. amulet/game/_game.py +0 -152
  81. amulet/game/_universal/__init__.py +0 -1
  82. amulet/game/_universal/_biome.py +0 -17
  83. amulet/game/_universal/_block.py +0 -47
  84. amulet/game/_universal/_version.py +0 -68
  85. amulet/game/abc/__init__.py +0 -22
  86. amulet/game/abc/_block_specification.py +0 -150
  87. amulet/game/abc/biome.py +0 -213
  88. amulet/game/abc/block.py +0 -331
  89. amulet/game/abc/game_version_container.py +0 -25
  90. amulet/game/abc/json_interface.py +0 -27
  91. amulet/game/abc/version.py +0 -44
  92. amulet/game/bedrock/__init__.py +0 -1
  93. amulet/game/bedrock/_biome.py +0 -35
  94. amulet/game/bedrock/_block.py +0 -42
  95. amulet/game/bedrock/_version.py +0 -165
  96. amulet/game/java/__init__.py +0 -2
  97. amulet/game/java/_biome.py +0 -35
  98. amulet/game/java/_block.py +0 -60
  99. amulet/game/java/_version.py +0 -176
  100. amulet/game/translate/__init__.py +0 -12
  101. amulet/game/translate/_functions/__init__.py +0 -15
  102. amulet/game/translate/_functions/_code_functions/__init__.py +0 -0
  103. amulet/game/translate/_functions/_code_functions/_text.py +0 -553
  104. amulet/game/translate/_functions/_code_functions/banner_pattern.py +0 -67
  105. amulet/game/translate/_functions/_code_functions/bedrock_chest_connection.py +0 -152
  106. amulet/game/translate/_functions/_code_functions/bedrock_moving_block_pos.py +0 -88
  107. amulet/game/translate/_functions/_code_functions/bedrock_sign.py +0 -152
  108. amulet/game/translate/_functions/_code_functions/bedrock_skull_rotation.py +0 -16
  109. amulet/game/translate/_functions/_code_functions/custom_name.py +0 -146
  110. amulet/game/translate/_functions/_frozen.py +0 -66
  111. amulet/game/translate/_functions/_state.py +0 -54
  112. amulet/game/translate/_functions/_typing.py +0 -98
  113. amulet/game/translate/_functions/abc.py +0 -123
  114. amulet/game/translate/_functions/carry_nbt.py +0 -160
  115. amulet/game/translate/_functions/carry_properties.py +0 -80
  116. amulet/game/translate/_functions/code.py +0 -143
  117. amulet/game/translate/_functions/map_block_name.py +0 -66
  118. amulet/game/translate/_functions/map_nbt.py +0 -111
  119. amulet/game/translate/_functions/map_properties.py +0 -93
  120. amulet/game/translate/_functions/multiblock.py +0 -112
  121. amulet/game/translate/_functions/new_block.py +0 -42
  122. amulet/game/translate/_functions/new_entity.py +0 -43
  123. amulet/game/translate/_functions/new_nbt.py +0 -206
  124. amulet/game/translate/_functions/new_properties.py +0 -64
  125. amulet/game/translate/_functions/sequence.py +0 -51
  126. amulet/game/translate/_functions/walk_input_nbt.py +0 -331
  127. amulet/game/translate/_translator.py +0 -433
  128. amulet/img/__init__.py +0 -10
  129. amulet/img/missing_no.png +0 -0
  130. amulet/img/missing_pack.png +0 -0
  131. amulet/img/missing_world.png +0 -0
  132. amulet/io/binary_reader.hpp +0 -45
  133. amulet/io/binary_writer.hpp +0 -30
  134. amulet/item.py +0 -75
  135. amulet/level/__init__.pyi +0 -23
  136. amulet/level/_load.py +0 -100
  137. amulet/level/abc/__init__.py +0 -12
  138. amulet/level/abc/_chunk_handle.py +0 -358
  139. amulet/level/abc/_dimension.py +0 -86
  140. amulet/level/abc/_history/__init__.py +0 -1
  141. amulet/level/abc/_history/_cache.py +0 -224
  142. amulet/level/abc/_history/_history_manager.py +0 -291
  143. amulet/level/abc/_level/__init__.py +0 -5
  144. amulet/level/abc/_level/_compactable_level.py +0 -10
  145. amulet/level/abc/_level/_creatable_level.py +0 -28
  146. amulet/level/abc/_level/_disk_level.py +0 -17
  147. amulet/level/abc/_level/_level.py +0 -449
  148. amulet/level/abc/_level/_loadable_level.py +0 -42
  149. amulet/level/abc/_player_storage.py +0 -7
  150. amulet/level/abc/_raw_level.py +0 -187
  151. amulet/level/abc/_registry.py +0 -40
  152. amulet/level/java/__init__.pyi +0 -16
  153. amulet/level/java/_chunk_handle.py +0 -17
  154. amulet/level/java/_dimension.py +0 -20
  155. amulet/level/java/_level.py +0 -184
  156. amulet/level/java/_raw/__init__.pyi +0 -15
  157. amulet/level/java/_raw/_chunk.pyi +0 -23
  158. amulet/level/java/_raw/_constant.py +0 -9
  159. amulet/level/java/_raw/_data_pack/__init__.py +0 -2
  160. amulet/level/java/_raw/_data_pack/data_pack.py +0 -241
  161. amulet/level/java/_raw/_data_pack/data_pack_manager.py +0 -77
  162. amulet/level/java/_raw/_dimension.py +0 -86
  163. amulet/level/java/_raw/_level.py +0 -507
  164. amulet/level/java/_raw/_typing.py +0 -3
  165. amulet/level/java/_raw/java_chunk_decode.cpp +0 -531
  166. amulet/level/java/_raw/java_chunk_decode.hpp +0 -23
  167. amulet/level/java/_raw/java_chunk_encode.cpp +0 -25
  168. amulet/level/java/_raw/java_chunk_encode.hpp +0 -23
  169. amulet/level/java/anvil/__init__.py +0 -2
  170. amulet/level/java/anvil/_dimension.py +0 -170
  171. amulet/level/java/anvil/_region.py +0 -421
  172. amulet/level/java/anvil/_sector_manager.py +0 -223
  173. amulet/level/java/chunk.pyi +0 -81
  174. amulet/level/java/chunk_/_chunk.py +0 -260
  175. amulet/level/java/chunk_/components/inhabited_time.py +0 -12
  176. amulet/level/java/chunk_/components/last_update.py +0 -12
  177. amulet/level/java/chunk_/components/legacy_version.py +0 -12
  178. amulet/level/java/chunk_/components/light_populated.py +0 -12
  179. amulet/level/java/chunk_/components/named_height_2d.py +0 -37
  180. amulet/level/java/chunk_/components/status.py +0 -11
  181. amulet/level/java/chunk_/components/terrain_populated.py +0 -12
  182. amulet/level/java/chunk_components/data_version_component.cpp +0 -32
  183. amulet/level/java/chunk_components/data_version_component.hpp +0 -31
  184. amulet/level/java/chunk_components/java_raw_chunk_component.cpp +0 -56
  185. amulet/level/java/chunk_components/java_raw_chunk_component.hpp +0 -45
  186. amulet/level/java/chunk_components.pyi +0 -22
  187. amulet/level/java/java_chunk.cpp +0 -170
  188. amulet/level/java/java_chunk.hpp +0 -141
  189. amulet/level/java/long_array.hpp +0 -175
  190. amulet/level/java/long_array.pyi +0 -39
  191. amulet/level/temporary_level/__init__.py +0 -1
  192. amulet/level/temporary_level/_level.py +0 -16
  193. amulet/mesh/__init__.py +0 -0
  194. amulet/mesh/block/__init__.pyi +0 -301
  195. amulet/mesh/block/_cube.py +0 -198
  196. amulet/mesh/block/_missing_block.py +0 -20
  197. amulet/mesh/block/block_mesh.cpp +0 -107
  198. amulet/mesh/block/block_mesh.hpp +0 -207
  199. amulet/mesh/util.py +0 -17
  200. amulet/palette/biome_palette.hpp +0 -85
  201. amulet/palette/block_palette.cpp +0 -32
  202. amulet/palette/block_palette.hpp +0 -93
  203. amulet/player.py +0 -62
  204. amulet/pybind11/collections.hpp +0 -118
  205. amulet/pybind11/numpy.hpp +0 -26
  206. amulet/pybind11/py_module.hpp +0 -34
  207. amulet/pybind11/type_hints.hpp +0 -51
  208. amulet/pybind11/types.hpp +0 -25
  209. amulet/pybind11/typing.hpp +0 -7
  210. amulet/resource_pack/__init__.py +0 -63
  211. amulet/resource_pack/abc/__init__.py +0 -2
  212. amulet/resource_pack/abc/resource_pack.py +0 -38
  213. amulet/resource_pack/abc/resource_pack_manager.py +0 -85
  214. amulet/resource_pack/java/__init__.py +0 -2
  215. amulet/resource_pack/java/download_resources.py +0 -212
  216. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_black.png +0 -0
  217. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_blue.png +0 -0
  218. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_brown.png +0 -0
  219. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_cyan.png +0 -0
  220. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_gray.png +0 -0
  221. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_green.png +0 -0
  222. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_light_blue.png +0 -0
  223. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_light_gray.png +0 -0
  224. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_lime.png +0 -0
  225. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_magenta.png +0 -0
  226. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_orange.png +0 -0
  227. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_pink.png +0 -0
  228. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_purple.png +0 -0
  229. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_red.png +0 -0
  230. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_white.png +0 -0
  231. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_yellow.png +0 -0
  232. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/barrier.png +0 -0
  233. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/end_portal.png +0 -0
  234. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/grass.png +0 -0
  235. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/lava.png +0 -0
  236. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/structure_void.png +0 -0
  237. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/water.png +0 -0
  238. amulet/resource_pack/java/java_vanilla_fix/pack.png +0 -0
  239. amulet/resource_pack/java/resource_pack.py +0 -44
  240. amulet/resource_pack/java/resource_pack_manager.py +0 -563
  241. amulet/resource_pack/unknown_resource_pack.py +0 -10
  242. amulet/selection/__init__.py +0 -2
  243. amulet/selection/abstract_selection.py +0 -342
  244. amulet/selection/box.py +0 -852
  245. amulet/selection/group.py +0 -481
  246. amulet/utils/__init__.pyi +0 -23
  247. amulet/utils/call_spec/__init__.py +0 -24
  248. amulet/utils/call_spec/_call_spec.py +0 -257
  249. amulet/utils/cast.py +0 -10
  250. amulet/utils/comment_json.py +0 -188
  251. amulet/utils/format_utils.py +0 -41
  252. amulet/utils/generator.py +0 -18
  253. amulet/utils/matrix.py +0 -243
  254. amulet/utils/numpy.hpp +0 -36
  255. amulet/utils/numpy.pyi +0 -11
  256. amulet/utils/numpy_helpers.py +0 -19
  257. amulet/utils/shareable_lock.py +0 -335
  258. amulet/utils/signal/__init__.py +0 -10
  259. amulet/utils/signal/_signal.py +0 -228
  260. amulet/utils/task_manager.py +0 -235
  261. amulet/utils/typed_property.py +0 -111
  262. amulet/utils/weakref.py +0 -70
  263. amulet/utils/world_utils.py +0 -102
  264. amulet/version.cpp +0 -136
  265. amulet/version.hpp +0 -142
  266. amulet/version.py.cpp +0 -281
  267. amulet_core-2.0a8.dist-info/RECORD +0 -241
  268. amulet_core-2.0a8.dist-info/entry_points.txt +0 -2
  269. /amulet/{__pyinstaller → core/__pyinstaller}/__init__.py +0 -0
  270. /amulet/{py.typed → core/py.typed} +0 -0
  271. {amulet_core-2.0a8.dist-info → amulet_core-2.0.1a2.post250529084747.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,215 @@
1
+ from __future__ import annotations
2
+
3
+ import types
4
+ import typing
5
+
6
+ import amulet.core.selection.group
7
+
8
+ __all__ = ["SelectionBox"]
9
+
10
+ class SelectionBox:
11
+ """
12
+ The SelectionBox class represents a single cuboid selection.
13
+
14
+ When combined with :class:`~amulet.api.selection.SelectionGroup` it can represent any arbitrary shape.
15
+ """
16
+
17
+ @typing.overload
18
+ def __eq__(self, arg0: SelectionBox) -> bool: ...
19
+ @typing.overload
20
+ def __eq__(self, arg0: typing.Any) -> bool | types.NotImplementedType: ...
21
+ def __ge__(self, arg0: SelectionBox) -> bool: ...
22
+ def __gt__(self, arg0: SelectionBox) -> bool: ...
23
+ def __hash__(self) -> int: ...
24
+ @typing.overload
25
+ def __init__(
26
+ self, min_x: int, min_y: int, min_z: int, size_x: int, size_y: int, size_z: int
27
+ ) -> None:
28
+ """
29
+ Construct a new SelectionBox instance.
30
+
31
+ >>> # a selection box that selects one block.
32
+ >>> box = SelectionBox(0, 0, 0, 1, 1, 1)
33
+
34
+ :param min_x: The minimum x coordinate of the box.
35
+ :param min_y: The minimum y coordinate of the box.
36
+ :param min_z: The minimum z coordinate of the box.
37
+ :param size_x: The size of the box in the x axis.
38
+ :param size_y: The size of the box in the y axis.
39
+ :param size_z: The size of the box in the z axis.
40
+ """
41
+
42
+ @typing.overload
43
+ def __init__(
44
+ self, point_1: tuple[int, int, int], point_2: tuple[int, int, int]
45
+ ) -> None:
46
+ """
47
+ Construct a new SelectionBox instance.
48
+
49
+ >>> # a selection box that selects one block.
50
+ >>> box = SelectionBox((0, 0, 0), (1, 1, 1))
51
+
52
+ :param point_1: The first coordinate of the box.
53
+ :param point_2: The second coordinate of the box.
54
+ """
55
+
56
+ def __le__(self, arg0: SelectionBox) -> bool: ...
57
+ def __lt__(self, arg0: SelectionBox) -> bool: ...
58
+ def __repr__(self) -> str: ...
59
+ def __str__(self) -> str: ...
60
+ def contains_block(self, x: int, y: int, z: int) -> bool:
61
+ """
62
+ Is the block contained within the selection.
63
+
64
+ >>> selection1: AbstractBaseSelection
65
+ >>> (1, 2, 3) in selection1
66
+ True
67
+
68
+ :param x: The x coordinate of the block. Defined by the most negative corner.
69
+ :param y: The y coordinate of the block. Defined by the most negative corner.
70
+ :param z: The z coordinate of the block. Defined by the most negative corner.
71
+ :return: True if the block is in the selection.
72
+ """
73
+
74
+ def contains_box(self, other: SelectionBox) -> bool:
75
+ """
76
+ Does the other SelectionBox other fit entirely within this SelectionBox.
77
+
78
+ :param other: The SelectionBox to test.
79
+ :return: True if other fits in self, False otherwise.
80
+ """
81
+
82
+ def contains_point(self, x: float, y: float, z: float) -> bool:
83
+ """
84
+ Is the point contained within the selection.
85
+
86
+ >>> selection1: AbstractBaseSelection
87
+ >>> (1.5, 2.5, 3.5) in selection1
88
+ True
89
+
90
+ :param x: The x coordinate of the point.
91
+ :param y: The y coordinate of the point.
92
+ :param z: The z coordinate of the point.
93
+ :return: True if the point is in the selection.
94
+ """
95
+
96
+ @typing.overload
97
+ def intersects(self, other: SelectionBox) -> bool:
98
+ """
99
+ Does this selection intersect ``other``.
100
+
101
+ :param other: The other selection.
102
+ :return: True if the selections intersect, False otherwise.
103
+ """
104
+
105
+ @typing.overload
106
+ def intersects(self, other: amulet.core.selection.group.SelectionGroup) -> bool: ...
107
+ def touches(self, other: SelectionBox) -> bool:
108
+ """
109
+ Method to check if this instance of :class:`SelectionBox` touches but does not intersect another SelectionBox.
110
+
111
+ :param other: The other SelectionBox
112
+ :return: True if the two :class:`SelectionBox` instances touch, False otherwise
113
+ """
114
+
115
+ def touches_or_intersects(self, other: SelectionBox) -> bool:
116
+ """
117
+ Does this SelectionBox touch or intersect the other SelectionBox.
118
+
119
+ :param other: The other SelectionBox.
120
+ :return: True if the two :class:`SelectionBox` instances touch or intersect, False otherwise.
121
+ """
122
+
123
+ def translate(self, x: int, y: int, z: int) -> SelectionBox:
124
+ """
125
+ Create a new :class:`SelectionBox` based on this one with the coordinates moved by the given offset.
126
+
127
+ :param x: The x offset.
128
+ :param y: The y offset.
129
+ :param z: The z offset.
130
+ :return: The new selection with the given offset.
131
+ """
132
+
133
+ @property
134
+ def max(self) -> tuple[int, int, int]:
135
+ """
136
+ The maximum coordinate of the box.
137
+ """
138
+
139
+ @property
140
+ def max_x(self) -> int:
141
+ """
142
+ The maximum x coordinate of the box.
143
+ """
144
+
145
+ @property
146
+ def max_y(self) -> int:
147
+ """
148
+ The maximum y coordinate of the box.
149
+ """
150
+
151
+ @property
152
+ def max_z(self) -> int:
153
+ """
154
+ The maximum z coordinate of the box.
155
+ """
156
+
157
+ @property
158
+ def min(self) -> tuple[int, int, int]:
159
+ """
160
+ The minimum coordinate of the box.
161
+ """
162
+
163
+ @property
164
+ def min_x(self) -> int:
165
+ """
166
+ The minimum x coordinate of the box.
167
+ """
168
+
169
+ @property
170
+ def min_y(self) -> int:
171
+ """
172
+ The minimum y coordinate of the box.
173
+ """
174
+
175
+ @property
176
+ def min_z(self) -> int:
177
+ """
178
+ The minimum z coordinate of the box.
179
+ """
180
+
181
+ @property
182
+ def shape(self) -> tuple[int, int, int]:
183
+ """
184
+ The length of the box in the x, y and z axis.
185
+
186
+ >>> SelectionBox(0, 0, 0, 1, 1, 1).shape
187
+ (1, 1, 1)
188
+ """
189
+
190
+ @property
191
+ def size_x(self) -> int:
192
+ """
193
+ The length of the box in the x axis.
194
+ """
195
+
196
+ @property
197
+ def size_y(self) -> int:
198
+ """
199
+ The length of the box in the y axis.
200
+ """
201
+
202
+ @property
203
+ def size_z(self) -> int:
204
+ """
205
+ The length of the box in the z axis.
206
+ """
207
+
208
+ @property
209
+ def volume(self) -> int:
210
+ """
211
+ The number of blocks in the box.
212
+
213
+ >>> SelectionBox(0, 0, 0, 1, 1, 1).volume
214
+ 1
215
+ """
@@ -0,0 +1,80 @@
1
+ #pragma once
2
+
3
+ #include <array>
4
+ #include <concepts>
5
+ #include <ranges>
6
+ #include <set>
7
+
8
+ #include <amulet/core/dll.hpp>
9
+
10
+ #include "box.hpp"
11
+
12
+ namespace Amulet {
13
+
14
+ class SelectionBox;
15
+
16
+ class SelectionGroup {
17
+ private:
18
+ std::set<SelectionBox> _boxes;
19
+
20
+ public:
21
+ // Constructors
22
+ SelectionGroup() {};
23
+ SelectionGroup(const SelectionBox& box)
24
+ {
25
+ _boxes.insert(box);
26
+ }
27
+
28
+ template <typename Iterable>
29
+ requires std::ranges::input_range<Iterable> && std::convertible_to<std::ranges::range_value_t<Iterable>, const SelectionBox&>
30
+ SelectionGroup(const Iterable& boxes)
31
+ {
32
+ for (const SelectionBox& box : boxes) {
33
+ _boxes.emplace(box);
34
+ }
35
+ }
36
+
37
+ // Accessors
38
+ const std::set<SelectionBox>& selection_boxes() const
39
+ {
40
+ return _boxes;
41
+ }
42
+ size_t size() const
43
+ {
44
+ return _boxes.size();
45
+ }
46
+
47
+ // Bounds
48
+ AMULET_CORE_EXPORT std::int64_t min_x() const;
49
+ AMULET_CORE_EXPORT std::int64_t min_y() const;
50
+ AMULET_CORE_EXPORT std::int64_t min_z() const;
51
+ AMULET_CORE_EXPORT std::int64_t max_x() const;
52
+ AMULET_CORE_EXPORT std::int64_t max_y() const;
53
+ AMULET_CORE_EXPORT std::int64_t max_z() const;
54
+ AMULET_CORE_EXPORT std::array<std::int64_t, 3> min() const;
55
+ AMULET_CORE_EXPORT std::array<std::int64_t, 3> max() const;
56
+ AMULET_CORE_EXPORT std::pair<
57
+ std::array<std::int64_t, 3>,
58
+ std::array<std::int64_t, 3>>
59
+ bounds() const;
60
+ AMULET_CORE_EXPORT SelectionBox bounding_box() const;
61
+
62
+ // Contains and intersects
63
+ AMULET_CORE_EXPORT bool contains_block(std::int64_t x, std::int64_t y, std::int64_t z) const;
64
+ AMULET_CORE_EXPORT bool contains_point(double x, double y, double z) const;
65
+ AMULET_CORE_EXPORT bool intersects(const SelectionBox& other) const;
66
+ AMULET_CORE_EXPORT bool intersects(const SelectionGroup& other) const;
67
+
68
+ // Transform
69
+ AMULET_CORE_EXPORT SelectionGroup translate(std::int64_t dx, std::int64_t dy, std::int64_t dz) const;
70
+
71
+ // Operators
72
+ operator bool() const
73
+ {
74
+ return !_boxes.empty();
75
+ }
76
+ bool operator==(const SelectionGroup& rhs) const = default;
77
+ bool operator!=(const SelectionGroup& rhs) const = default;
78
+ };
79
+
80
+ }
@@ -0,0 +1,213 @@
1
+ from __future__ import annotations
2
+
3
+ import collections.abc
4
+ import types
5
+ import typing
6
+
7
+ import amulet.core.selection.box
8
+
9
+ __all__ = ["SelectionGroup"]
10
+
11
+ class SelectionGroup:
12
+ """
13
+ A container for zero or more :class:`SelectionBox` instances.
14
+
15
+ This allows for non-rectangular and non-contiguous selections.
16
+ """
17
+
18
+ __hash__: typing.ClassVar[None] = None # type: ignore
19
+ def __bool__(self) -> bool:
20
+ """
21
+ The number of :class:`SelectionBox` classes in the group.
22
+ """
23
+
24
+ @typing.overload
25
+ def __eq__(self, arg0: SelectionGroup) -> bool:
26
+ """
27
+ Does the contents of this :class:`SelectionGroup` match the other :class:`SelectionGroup`.
28
+
29
+ Note if the boxes do not exactly match this will return False even if the volume represented is the same.
30
+
31
+ :param other: The other :class:`SelectionGroup` to compare with.
32
+ :return: True if the boxes contained match.
33
+ """
34
+
35
+ @typing.overload
36
+ def __eq__(self, arg0: typing.Any) -> bool | types.NotImplementedType: ...
37
+ @typing.overload
38
+ def __init__(self) -> None:
39
+ """
40
+ Create an empty SelectionGroup.
41
+
42
+ >>> SelectionGroup()
43
+ """
44
+
45
+ @typing.overload
46
+ def __init__(self, box: amulet.core.selection.box.SelectionBox) -> None:
47
+ """
48
+ Create a SelectionGroup containing the given box.
49
+
50
+ >>> SelectionGroup(SelectionBox(0, 0, 0, 1, 1, 1))
51
+ """
52
+
53
+ @typing.overload
54
+ def __init__(
55
+ self, boxes: collections.abc.Iterable[amulet.core.selection.box.SelectionBox]
56
+ ) -> None:
57
+ """
58
+ Create a SelectionGroup from the boxes in the iterable.
59
+
60
+ >>> SelectionGroup([
61
+ >>> SelectionBox(0, 0, 0, 1, 1, 1),
62
+ >>> SelectionBox(1, 1, 1, 1, 1, 1)
63
+ >>> ])
64
+ """
65
+
66
+ def __iter__(self) -> typing.Iterator[amulet.core.selection.box.SelectionBox]:
67
+ """
68
+ An iterable of all the :class:`SelectionBox` classes in the group.
69
+ """
70
+
71
+ def __len__(self) -> int:
72
+ """
73
+ The number of :class:`SelectionBox` classes in the group.
74
+ """
75
+
76
+ def __repr__(self) -> str: ...
77
+ def __str__(self) -> str: ...
78
+ def contains_block(self, x: int, y: int, z: int) -> bool:
79
+ """
80
+ Is the block contained within the selection.
81
+
82
+ >>> selection1: AbstractBaseSelection
83
+ >>> (1, 2, 3) in selection1
84
+ True
85
+
86
+ :param x: The x coordinate of the block. Defined by the most negative corner.
87
+ :param y: The y coordinate of the block. Defined by the most negative corner.
88
+ :param z: The z coordinate of the block. Defined by the most negative corner.
89
+ :return: True if the block is in the selection.
90
+ """
91
+
92
+ def contains_point(self, x: float, y: float, z: float) -> bool:
93
+ """
94
+ Is the point contained within the selection.
95
+
96
+ >>> selection1: AbstractBaseSelection
97
+ >>> (1.5, 2.5, 3.5) in selection1
98
+ True
99
+
100
+ :param x: The x coordinate of the point.
101
+ :param y: The y coordinate of the point.
102
+ :param z: The z coordinate of the point.
103
+ :return: True if the point is in the selection.
104
+ """
105
+
106
+ @typing.overload
107
+ def intersects(self, other: amulet.core.selection.box.SelectionBox) -> bool:
108
+ """
109
+ Does this selection intersect ``other``.
110
+
111
+ :param other: The other selection.
112
+ :return: True if the selections intersect, False otherwise.
113
+ """
114
+
115
+ @typing.overload
116
+ def intersects(self, other: SelectionGroup) -> bool: ...
117
+ def translate(self, x: int, y: int, z: int) -> SelectionGroup:
118
+ """
119
+ Create a new :class:`SelectionGroup` based on this one with the coordinates moved by the given offset.
120
+
121
+ :param x: The x offset.
122
+ :param y: The y offset.
123
+ :param z: The z offset.
124
+ :return: The new selection with the given offset.
125
+ """
126
+
127
+ @property
128
+ def bounding_box(self) -> amulet.core.selection.box.SelectionBox:
129
+ """
130
+ A SelectionBox containing this entire selection.
131
+
132
+ :raises RuntimeError: If there are no boxes in the selection.
133
+ """
134
+
135
+ @property
136
+ def bounds(self) -> tuple[tuple[int, int, int], tuple[int, int, int]]:
137
+ """
138
+ The minimum and maximum x, y and z coordinates in the selection.
139
+
140
+ :raises RuntimeError: If there are no boxes in the selection.
141
+ """
142
+
143
+ @property
144
+ def max(self) -> tuple[int, int, int]:
145
+ """
146
+ The maximum x, y and z coordinates in the selection.
147
+
148
+ :raises RuntimeError: If there are no boxes in the selection.
149
+ """
150
+
151
+ @property
152
+ def max_x(self) -> int:
153
+ """
154
+ The maximum x coordinate in the selection.
155
+
156
+ :raises RuntimeError: If there are no boxes in the selection.
157
+ """
158
+
159
+ @property
160
+ def max_y(self) -> int:
161
+ """
162
+ The maximum y coordinate in the selection.
163
+
164
+ :raises RuntimeError: If there are no boxes in the selection.
165
+ """
166
+
167
+ @property
168
+ def max_z(self) -> int:
169
+ """
170
+ The maximum z coordinate in the selection.
171
+
172
+ :raises RuntimeError: If there are no boxes in the selection.
173
+ """
174
+
175
+ @property
176
+ def min(self) -> tuple[int, int, int]:
177
+ """
178
+ The minimum x, y and z coordinates in the selection.
179
+
180
+ :raises RuntimeError: If there are no boxes in the selection.
181
+ """
182
+
183
+ @property
184
+ def min_x(self) -> int:
185
+ """
186
+ The minimum x coordinate in the selection.
187
+
188
+ :raises RuntimeError: If there are no boxes in the selection.
189
+ """
190
+
191
+ @property
192
+ def min_y(self) -> int:
193
+ """
194
+ The minimum y coordinate in the selection.
195
+
196
+ :raises RuntimeError: If there are no boxes in the selection.
197
+ """
198
+
199
+ @property
200
+ def min_z(self) -> int:
201
+ """
202
+ The minimum z coordinate in the selection.
203
+
204
+ :raises RuntimeError: If there are no boxes in the selection.
205
+ """
206
+
207
+ @property
208
+ def selection_boxes(
209
+ self,
210
+ ) -> typing.Iterator[amulet.core.selection.box.SelectionBox]:
211
+ """
212
+ An iterator of the :class:`SelectionBox` instances stored for this group.
213
+ """
@@ -13,16 +13,32 @@ __all__ = [
13
13
  ]
14
14
 
15
15
  class PlatformVersionContainer:
16
+ """
17
+ A class storing platform identifier and version number.
18
+ Thread safe.
19
+ """
20
+
16
21
  def __init__(self, platform: str, version: VersionNumber) -> None: ...
17
22
  def __repr__(self) -> str: ...
18
23
  @property
19
- def platform(self) -> str: ...
24
+ def platform(self) -> str:
25
+ """
26
+ Get the platform identifier.
27
+ """
28
+
20
29
  @property
21
- def version(self) -> VersionNumber: ...
30
+ def version(self) -> VersionNumber:
31
+ """
32
+ Get the version number.
33
+ """
22
34
 
23
35
  class VersionNumber:
24
36
  """
25
37
  This class is designed to store semantic versions and data versions and allow comparisons between them.
38
+ It is a wrapper around std::vector<std::int64_t> with special comparison handling.
39
+ The version can contain zero to max(int64) values.
40
+ Undefined trailing values are implied zeros. 1.1 == 1.1.0
41
+ All methods are thread safe.
26
42
 
27
43
  >>> v1 = VersionNumber(1, 0, 0)
28
44
  >>> v2 = VersionNumber(1, 0)
@@ -53,7 +69,7 @@ class VersionNumber:
53
69
  def __reversed__(self) -> typing.Iterator[int]: ...
54
70
  def __str__(self) -> str: ...
55
71
  def count(self, value: int) -> int: ...
56
- def cropped_version(self) -> tuple:
72
+ def cropped_version(self) -> list[int]:
57
73
  """
58
74
  The version number with trailing zeros cut off.
59
75
  """
@@ -61,26 +77,58 @@ class VersionNumber:
61
77
  def index(
62
78
  self, value: int, start: int = 0, stop: int = 18446744073709551615
63
79
  ) -> int: ...
64
- def padded_version(self, len: int) -> tuple:
80
+ def padded_version(self, len: int) -> list[int]:
65
81
  """
66
- Get the version number padded with zeros to the given length.
82
+ Get the version number cropped or padded with zeros to the given length.
67
83
  """
68
84
 
69
85
  class VersionRange:
86
+ """
87
+ A class storing platform identifier and minimum and maximum version numbers.
88
+ Thread safe.
89
+ """
90
+
91
+ __hash__: typing.ClassVar[None] = None # type: ignore
92
+ @typing.overload
93
+ def __eq__(self, arg0: VersionRange) -> bool: ...
94
+ @typing.overload
95
+ def __eq__(self, arg0: typing.Any) -> bool | types.NotImplementedType: ...
70
96
  def __init__(
71
97
  self, platform: str, min_version: VersionNumber, max_version: VersionNumber
72
98
  ) -> None: ...
73
99
  def __repr__(self) -> str: ...
74
- def contains(self, arg0: str, arg1: VersionNumber) -> bool: ...
100
+ def contains(self, arg0: str, arg1: VersionNumber) -> bool:
101
+ """
102
+ Check if the platform is equal and the version number is within the range.
103
+ """
104
+
75
105
  @property
76
- def max_version(self) -> VersionNumber: ...
106
+ def max_version(self) -> VersionNumber:
107
+ """
108
+ The maximum version number
109
+ """
110
+
77
111
  @property
78
- def min_version(self) -> VersionNumber: ...
112
+ def min_version(self) -> VersionNumber:
113
+ """
114
+ The minimum version number
115
+ """
116
+
79
117
  @property
80
- def platform(self) -> str: ...
118
+ def platform(self) -> str:
119
+ """
120
+ The platform identifier.
121
+ """
81
122
 
82
123
  class VersionRangeContainer:
124
+ """
125
+ A class that contains a version range.
126
+ """
127
+
83
128
  def __init__(self, version_range: VersionRange) -> None: ...
84
129
  def __repr__(self) -> str: ...
85
130
  @property
86
- def version_range(self) -> VersionRange: ...
131
+ def version_range(self) -> VersionRange:
132
+ """
133
+ The version range.
134
+ """