amulet-core 2.0.5a0__tar.gz → 2.0.5a1__tar.gz

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 (109) hide show
  1. {amulet_core-2.0.5a0/src/amulet_core.egg-info → amulet_core-2.0.5a1}/PKG-INFO +3 -4
  2. amulet_core-2.0.5a1/get_compiler/__init__.py +32 -0
  3. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/pyproject.toml +0 -1
  4. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/requirements.py +2 -2
  5. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/src/amulet/core/_version.py +3 -3
  6. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/src/amulet/core/biome/__init__.pyi +2 -2
  7. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/src/amulet/core/block/__init__.pyi +8 -8
  8. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/src/amulet/core/block/block.py.cpp +10 -10
  9. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/src/amulet/core/block_entity/__init__.pyi +2 -2
  10. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/src/amulet/core/chunk/component/section_array_map.py.cpp +12 -11
  11. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/src/amulet/core/chunk/component/section_array_map.pyi +41 -25
  12. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/src/amulet/core/entity/__init__.pyi +2 -2
  13. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/src/amulet/core/palette/biome_palette.py.cpp +8 -6
  14. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/src/amulet/core/palette/biome_palette.pyi +5 -5
  15. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/src/amulet/core/palette/block_palette.py.cpp +8 -6
  16. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/src/amulet/core/palette/block_palette.pyi +3 -3
  17. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/src/amulet/core/selection/__init_selection.py.cpp +7 -2
  18. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/src/amulet/core/selection/box.pyi +2 -2
  19. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/src/amulet/core/selection/box_group.py.cpp +6 -0
  20. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/src/amulet/core/selection/box_group.pyi +7 -2
  21. amulet_core-2.0.5a1/src/amulet/core/selection/cuboid.cpp +458 -0
  22. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/src/amulet/core/selection/cuboid.hpp +5 -0
  23. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/src/amulet/core/selection/cuboid.pyi +1 -0
  24. amulet_core-2.0.5a1/src/amulet/core/selection/ellipsoid.cpp +347 -0
  25. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/src/amulet/core/selection/ellipsoid.hpp +5 -0
  26. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/src/amulet/core/selection/ellipsoid.pyi +1 -0
  27. amulet_core-2.0.5a1/src/amulet/core/selection/shape.cpp +58 -0
  28. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/src/amulet/core/selection/shape.hpp +21 -1
  29. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/src/amulet/core/selection/shape.py.cpp +15 -2
  30. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/src/amulet/core/selection/shape.pyi +17 -0
  31. amulet_core-2.0.5a1/src/amulet/core/selection/shape_group.cpp +142 -0
  32. amulet_core-2.0.5a1/src/amulet/core/selection/shape_group.hpp +73 -0
  33. amulet_core-2.0.5a1/src/amulet/core/selection/shape_group.py.cpp +202 -0
  34. amulet_core-2.0.5a1/src/amulet/core/selection/shape_group.pyi +118 -0
  35. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/src/amulet/core/version/__init__.pyi +4 -4
  36. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1/src/amulet_core.egg-info}/PKG-INFO +3 -4
  37. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/src/amulet_core.egg-info/requires.txt +2 -3
  38. amulet_core-2.0.5a0/get_compiler/__init__.py +0 -32
  39. amulet_core-2.0.5a0/src/amulet/core/selection/cuboid.cpp +0 -205
  40. amulet_core-2.0.5a0/src/amulet/core/selection/ellipsoid.cpp +0 -160
  41. amulet_core-2.0.5a0/src/amulet/core/selection/shape.cpp +0 -21
  42. amulet_core-2.0.5a0/src/amulet/core/selection/shape_group.cpp +0 -27
  43. amulet_core-2.0.5a0/src/amulet/core/selection/shape_group.hpp +0 -61
  44. amulet_core-2.0.5a0/src/amulet/core/selection/shape_group.py.cpp +0 -90
  45. amulet_core-2.0.5a0/src/amulet/core/selection/shape_group.pyi +0 -60
  46. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/CMakeLists.txt +0 -0
  47. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/MANIFEST.in +0 -0
  48. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/README.md +0 -0
  49. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/build_requires.py +0 -0
  50. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/get_compiler/CMakeLists.txt +0 -0
  51. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/setup.cfg +0 -0
  52. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/setup.py +0 -0
  53. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/src/amulet/core/__init__.py +0 -0
  54. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/src/amulet/core/__init__.pyi +0 -0
  55. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/src/amulet/core/__pyinstaller/__init__.py +0 -0
  56. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/src/amulet/core/__pyinstaller/hook-amulet.core.py +0 -0
  57. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/src/amulet/core/_amulet_core.py.cpp +0 -0
  58. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/src/amulet/core/_amulet_core.pyi +0 -0
  59. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/src/amulet/core/amulet_coreConfig.cmake +0 -0
  60. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/src/amulet/core/biome/biome.cpp +0 -0
  61. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/src/amulet/core/biome/biome.hpp +0 -0
  62. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/src/amulet/core/biome/biome.py.cpp +0 -0
  63. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/src/amulet/core/block/block.cpp +0 -0
  64. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/src/amulet/core/block/block.hpp +0 -0
  65. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/src/amulet/core/block_entity/block_entity.cpp +0 -0
  66. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/src/amulet/core/block_entity/block_entity.hpp +0 -0
  67. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/src/amulet/core/block_entity/block_entity.py.cpp +0 -0
  68. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/src/amulet/core/chunk/__init__.pyi +0 -0
  69. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/src/amulet/core/chunk/chunk.cpp +0 -0
  70. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/src/amulet/core/chunk/chunk.hpp +0 -0
  71. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/src/amulet/core/chunk/chunk.py.cpp +0 -0
  72. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/src/amulet/core/chunk/component/__init__.pyi +0 -0
  73. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/src/amulet/core/chunk/component/__init_chunk_components.py.cpp +0 -0
  74. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/src/amulet/core/chunk/component/biome_3d_component.cpp +0 -0
  75. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/src/amulet/core/chunk/component/biome_3d_component.hpp +0 -0
  76. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/src/amulet/core/chunk/component/block_component.cpp +0 -0
  77. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/src/amulet/core/chunk/component/block_component.hpp +0 -0
  78. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/src/amulet/core/chunk/component/block_component.py.cpp +0 -0
  79. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/src/amulet/core/chunk/component/block_component.pyi +0 -0
  80. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/src/amulet/core/chunk/component/block_entity_component.cpp +0 -0
  81. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/src/amulet/core/chunk/component/block_entity_component.hpp +0 -0
  82. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/src/amulet/core/chunk/component/section_array_map.cpp +0 -0
  83. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/src/amulet/core/chunk/component/section_array_map.hpp +0 -0
  84. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/src/amulet/core/dll.hpp +0 -0
  85. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/src/amulet/core/entity/entity.cpp +0 -0
  86. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/src/amulet/core/entity/entity.hpp +0 -0
  87. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/src/amulet/core/entity/entity.py.cpp +0 -0
  88. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/src/amulet/core/palette/__init__.pyi +0 -0
  89. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/src/amulet/core/palette/__init_palette.py.cpp +0 -0
  90. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/src/amulet/core/palette/biome_palette.cpp +0 -0
  91. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/src/amulet/core/palette/biome_palette.hpp +0 -0
  92. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/src/amulet/core/palette/block_palette.cpp +0 -0
  93. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/src/amulet/core/palette/block_palette.hpp +0 -0
  94. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/src/amulet/core/py.typed +0 -0
  95. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/src/amulet/core/selection/__init__.pyi +0 -0
  96. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/src/amulet/core/selection/box.cpp +0 -0
  97. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/src/amulet/core/selection/box.hpp +0 -0
  98. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/src/amulet/core/selection/box.py.cpp +0 -0
  99. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/src/amulet/core/selection/box_group.cpp +0 -0
  100. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/src/amulet/core/selection/box_group.hpp +0 -0
  101. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/src/amulet/core/selection/cuboid.py.cpp +0 -0
  102. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/src/amulet/core/selection/ellipsoid.py.cpp +0 -0
  103. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/src/amulet/core/version/version.cpp +0 -0
  104. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/src/amulet/core/version/version.hpp +0 -0
  105. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/src/amulet/core/version/version.py.cpp +0 -0
  106. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/src/amulet_core.egg-info/SOURCES.txt +0 -0
  107. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/src/amulet_core.egg-info/dependency_links.txt +0 -0
  108. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/src/amulet_core.egg-info/entry_points.txt +0 -0
  109. {amulet_core-2.0.5a0 → amulet_core-2.0.5a1}/src/amulet_core.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: amulet-core
3
- Version: 2.0.5a0
3
+ Version: 2.0.5a1
4
4
  Summary: A Python library for reading/writing Minecraft's various save formats.
5
5
  Author: James Clare, Ben Gothard
6
6
  Project-URL: Homepage, https://www.amuletmc.com
@@ -13,9 +13,9 @@ Description-Content-Type: text/markdown
13
13
  Requires-Dist: amulet-compiler-target==2.0
14
14
  Requires-Dist: amulet-compiler-version==4.309027957683952396889703.17
15
15
  Requires-Dist: pybind11==3.0.0
16
- Requires-Dist: amulet-pybind11-extensions~=1.1.0.0a0
16
+ Requires-Dist: amulet-pybind11-extensions~=1.2.0.0a0
17
17
  Requires-Dist: amulet-io~=1.0
18
- Requires-Dist: amulet-utils~=1.1.3.0a0
18
+ Requires-Dist: amulet-utils~=1.1.3.0a1
19
19
  Requires-Dist: amulet-zlib~=1.0.8.0a0
20
20
  Requires-Dist: amulet-nbt~=5.0.2.0a0
21
21
  Requires-Dist: numpy~=2.0
@@ -28,7 +28,6 @@ Requires-Dist: setuptools>=42; extra == "dev"
28
28
  Requires-Dist: versioneer; extra == "dev"
29
29
  Requires-Dist: packaging; extra == "dev"
30
30
  Requires-Dist: wheel; extra == "dev"
31
- Requires-Dist: amulet_pybind11_extensions~=1.0; extra == "dev"
32
31
  Requires-Dist: pybind11_stubgen>=2.5.4; extra == "dev"
33
32
  Requires-Dist: black>=22.3; extra == "dev"
34
33
  Requires-Dist: isort; extra == "dev"
@@ -0,0 +1,32 @@
1
+ import os
2
+ import subprocess
3
+ from tempfile import TemporaryDirectory
4
+
5
+
6
+ def main() -> str:
7
+ if subprocess.run(["cmake", "--version"]).returncode:
8
+ raise RuntimeError("Could not find cmake")
9
+
10
+ with TemporaryDirectory() as build_dir:
11
+ # get the compiler id and version
12
+ if subprocess.run(
13
+ ["cmake", "-S", os.path.dirname(__file__), "-B", build_dir]
14
+ ).returncode:
15
+ raise RuntimeError(
16
+ "Could not find a C++ 20 compiler. Do you have a C++ 20 compiler installed?"
17
+ )
18
+
19
+ # Get the compiler variables generated by the cmake file
20
+ with open(os.path.join(build_dir, "compiler_id.txt")) as f:
21
+ compiler_id_str = f.read().strip()
22
+ with open(os.path.join(build_dir, "compiler_version.txt")) as f:
23
+ compiler_version = f.read().strip().split(".", 1)[0]
24
+
25
+ # convert the compiler id to an int so it can be used in a version number
26
+ compiler_id_int = 0
27
+ for b in compiler_id_str.encode("utf-8"):
28
+ compiler_id_int <<= 8
29
+ compiler_id_int += b
30
+
31
+ # combine the compiler id and compiler version into a version number
32
+ return f"==4.{compiler_id_int}.{compiler_version}"
@@ -32,7 +32,6 @@ dev = [
32
32
  "versioneer",
33
33
  "packaging",
34
34
  "wheel",
35
- "amulet_pybind11_extensions~=1.0",
36
35
  "pybind11_stubgen>=2.5.4",
37
36
  "black>=22.3",
38
37
  "isort",
@@ -5,9 +5,9 @@ import get_compiler
5
5
  AMULET_COMPILER_TARGET_REQUIREMENT = "==2.0"
6
6
 
7
7
  PYBIND11_REQUIREMENT = "==3.0.0"
8
- AMULET_PYBIND11_EXTENSIONS_REQUIREMENT = "~=1.1.0.0a0"
8
+ AMULET_PYBIND11_EXTENSIONS_REQUIREMENT = "~=1.2.0.0a0"
9
9
  AMULET_IO_REQUIREMENT = "~=1.0"
10
- AMULET_UTILS_REQUIREMENT = "~=1.1.3.0a0"
10
+ AMULET_UTILS_REQUIREMENT = "~=1.1.3.0a1"
11
11
  AMULET_ZLIB_REQUIREMENT = "~=1.0.8.0a0"
12
12
  AMULET_NBT_REQUIREMENT = "~=5.0.2.0a0"
13
13
  NUMPY_REQUIREMENT = "~=2.0"
@@ -8,11 +8,11 @@ import json
8
8
 
9
9
  version_json = '''
10
10
  {
11
- "date": "2025-09-01T13:18:18+0100",
11
+ "date": "2025-09-17T11:29:24+0100",
12
12
  "dirty": false,
13
13
  "error": null,
14
- "full-revisionid": "d46ea97b2c67f05ece822c4af0819fa94db55cf3",
15
- "version": "2.0.5a0"
14
+ "full-revisionid": "7ed2b2b5421e7cb0691779cf4861faf812f8cee3",
15
+ "version": "2.0.5a1"
16
16
  }
17
17
  ''' # END VERSION_JSON
18
18
 
@@ -25,9 +25,9 @@ class Biome(amulet.core.version.PlatformVersionContainer):
25
25
  """
26
26
 
27
27
  @typing.overload
28
- def __eq__(self, arg0: Biome) -> bool: ...
28
+ def __eq__(self, other: Biome) -> bool: ...
29
29
  @typing.overload
30
- def __eq__(self, arg0: typing.Any) -> bool | types.NotImplementedType: ...
30
+ def __eq__(self, other: typing.Any) -> bool | types.NotImplementedType: ...
31
31
  def __ge__(self, arg0: Biome) -> bool: ...
32
32
  def __gt__(self, arg0: Biome) -> bool: ...
33
33
  def __hash__(self) -> int: ...
@@ -77,9 +77,9 @@ class Block(amulet.core.version.PlatformVersionContainer):
77
77
  """
78
78
 
79
79
  @typing.overload
80
- def __eq__(self, arg0: Block) -> bool: ...
80
+ def __eq__(self, other: Block) -> bool: ...
81
81
  @typing.overload
82
- def __eq__(self, arg0: typing.Any) -> bool | types.NotImplementedType: ...
82
+ def __eq__(self, other: typing.Any) -> bool | types.NotImplementedType: ...
83
83
  def __ge__(self, arg0: Block) -> bool: ...
84
84
  def __gt__(self, arg0: Block) -> bool: ...
85
85
  def __hash__(self) -> int: ...
@@ -216,16 +216,16 @@ class BlockStack:
216
216
  >>> blocks = list(waterlogged_stone)
217
217
  """
218
218
 
219
- def __contains__(self, arg0: typing.Any) -> bool: ...
219
+ def __contains__(self, item: typing.Any) -> bool: ...
220
220
  @typing.overload
221
- def __eq__(self, arg0: BlockStack) -> bool: ...
221
+ def __eq__(self, other: BlockStack) -> bool: ...
222
222
  @typing.overload
223
- def __eq__(self, arg0: typing.Any) -> bool | types.NotImplementedType: ...
223
+ def __eq__(self, other: typing.Any) -> bool | types.NotImplementedType: ...
224
224
  def __ge__(self, arg0: BlockStack) -> bool: ...
225
225
  @typing.overload
226
226
  def __getitem__(self, arg0: typing.SupportsInt) -> Block: ...
227
227
  @typing.overload
228
- def __getitem__(self, arg0: slice) -> list: ...
228
+ def __getitem__(self, item: slice) -> list[Block]: ...
229
229
  def __gt__(self, arg0: BlockStack) -> bool: ...
230
230
  def __hash__(self) -> int: ...
231
231
  def __init__(self, block: Block, *extra_blocks: Block) -> None: ...
@@ -235,10 +235,10 @@ class BlockStack:
235
235
  def __lt__(self, arg0: BlockStack) -> bool: ...
236
236
  def __repr__(self) -> str: ...
237
237
  def __reversed__(self) -> collections.abc.Iterator[Block]: ...
238
- def count(self, value: typing.Any) -> int: ...
238
+ def count(self, value: Block) -> int: ...
239
239
  def index(
240
240
  self,
241
- value: typing.Any,
241
+ value: Block,
242
242
  start: typing.SupportsInt = 0,
243
243
  stop: typing.SupportsInt = 9223372036854775807,
244
244
  ) -> int: ...
@@ -6,8 +6,8 @@
6
6
  #include <memory>
7
7
  #include <span>
8
8
 
9
- #include <amulet/pybind11_extensions/types.hpp>
10
9
  #include <amulet/pybind11_extensions/py_module.hpp>
10
+ #include <amulet/pybind11_extensions/types.hpp>
11
11
 
12
12
  #include <amulet/pybind11_extensions/sequence.hpp>
13
13
 
@@ -278,8 +278,7 @@ void init_block(py::module m_parent)
278
278
  if (index < 0) {
279
279
  throw py::index_error("");
280
280
  }
281
- }
282
- if (index >= self.size()) {
281
+ } else if (index >= self.size()) {
283
282
  throw py::index_error("");
284
283
  }
285
284
  return self.at(index);
@@ -300,13 +299,14 @@ void init_block(py::module m_parent)
300
299
  return Amulet::deserialise<Amulet::BlockStack>(state.cast<std::string>());
301
300
  }));
302
301
 
303
- pyext::collections::def_Sequence_getitem_slice(BlockStack);
304
- pyext::collections::def_Sequence_contains(BlockStack);
305
- pyext::collections::def_Sequence_iter<Amulet::Block>(BlockStack);
306
- pyext::collections::def_Sequence_reversed<Amulet::Block>(BlockStack);
307
- pyext::collections::def_Sequence_index(BlockStack);
308
- pyext::collections::def_Sequence_count(BlockStack);
309
- pyext::collections::register_Sequence(BlockStack);
302
+ using BlockSequence = pyext::collections::Sequence<Amulet::Block>;
303
+ BlockSequence::def_getitem_slice(BlockStack);
304
+ BlockSequence::def_contains(BlockStack);
305
+ BlockSequence::def_iter(BlockStack);
306
+ BlockSequence::def_reversed(BlockStack);
307
+ BlockSequence::def_index(BlockStack);
308
+ BlockSequence::def_count(BlockStack);
309
+ BlockSequence::register_cls(BlockStack);
310
310
 
311
311
  BlockStack.def(py::self == py::self);
312
312
  BlockStack.def(py::self > py::self);
@@ -14,9 +14,9 @@ class BlockEntity(amulet.core.version.PlatformVersionContainer):
14
14
  """
15
15
 
16
16
  @typing.overload
17
- def __eq__(self, arg0: BlockEntity) -> bool: ...
17
+ def __eq__(self, other: BlockEntity) -> bool: ...
18
18
  @typing.overload
19
- def __eq__(self, arg0: typing.Any) -> bool | types.NotImplementedType: ...
19
+ def __eq__(self, other: typing.Any) -> bool | types.NotImplementedType: ...
20
20
  def __hash__(self) -> int: ...
21
21
  def __init__(
22
22
  self,
@@ -221,17 +221,18 @@ py::module init_section_array_map(py::module m_parent)
221
221
  SectionArrayMap.def(
222
222
  "__contains__",
223
223
  &Amulet::SectionArrayMap::contains_section);
224
- pyext::collections::def_Mapping_keys<std::int64_t>(SectionArrayMap);
225
- pyext::collections::def_Mapping_values<pyext::numpy::array_t<std::uint32_t>>(SectionArrayMap);
226
- pyext::collections::def_Mapping_items<std::int64_t, pyext::numpy::array_t<std::uint32_t>>(SectionArrayMap);
227
- pyext::collections::def_Mapping_get<std::int64_t, pyext::numpy::array_t<std::uint32_t>>(SectionArrayMap);
228
- pyext::collections::def_Mapping_eq(SectionArrayMap);
229
- pyext::collections::def_Mapping_hash(SectionArrayMap);
230
- pyext::collections::def_MutableMapping_pop<std::int64_t, pyext::numpy::array_t<std::uint32_t>>(SectionArrayMap);
231
- pyext::collections::def_MutableMapping_popitem<std::int64_t, pyext::numpy::array_t<std::uint32_t>>(SectionArrayMap);
232
- pyext::collections::def_MutableMapping_update(SectionArrayMap);
233
- pyext::collections::def_MutableMapping_setdefault<std::int64_t, pyext::numpy::array_t<std::uint32_t>>(SectionArrayMap);
234
- pyext::collections::register_MutableMapping(SectionArrayMap);
224
+ using SectionMap = pyext::collections::MutableMapping<std::int64_t, pyext::numpy::array_t<std::uint32_t>>;
225
+ SectionMap::def_keys(SectionArrayMap);
226
+ SectionMap::def_values(SectionArrayMap);
227
+ SectionMap::def_items(SectionArrayMap);
228
+ SectionMap::def_get(SectionArrayMap);
229
+ SectionMap::def_eq(SectionArrayMap);
230
+ SectionMap::def_hash(SectionArrayMap);
231
+ SectionMap::def_pop(SectionArrayMap);
232
+ SectionMap::def_popitem(SectionArrayMap);
233
+ SectionMap::def_update(SectionArrayMap);
234
+ SectionMap::def_setdefault(SectionArrayMap);
235
+ SectionMap::register_cls(SectionArrayMap);
235
236
 
236
237
  SectionArrayMap.def(
237
238
  py::pickle(
@@ -40,7 +40,7 @@ class SectionArrayMap:
40
40
 
41
41
  def __contains__(self, arg0: typing.SupportsInt) -> bool: ...
42
42
  def __delitem__(self, arg0: typing.SupportsInt) -> None: ...
43
- def __eq__(self, arg0: typing.Any) -> bool | types.NotImplementedType: ...
43
+ def __eq__(self, other: typing.Any) -> bool | types.NotImplementedType: ...
44
44
  def __getitem__(
45
45
  self, arg0: typing.SupportsInt
46
46
  ) -> numpy.typing.NDArray[numpy.uint32]: ...
@@ -48,40 +48,61 @@ class SectionArrayMap:
48
48
  def __init__(
49
49
  self,
50
50
  array_shape: tuple[typing.SupportsInt, typing.SupportsInt, typing.SupportsInt],
51
- default_array: (
52
- typing.SupportsInt
53
- | amulet.core.chunk.component.section_array_map.IndexArray3D
54
- | collections.abc.Buffer
55
- ),
51
+ default_array: typing.SupportsInt | IndexArray3D | collections.abc.Buffer,
56
52
  ) -> None: ...
57
53
  def __iter__(self) -> collections.abc.Iterator[int]: ...
58
54
  def __len__(self) -> int: ...
59
55
  def __setitem__(
60
- self,
61
- arg0: typing.SupportsInt,
62
- arg1: (
63
- amulet.core.chunk.component.section_array_map.IndexArray3D
64
- | collections.abc.Buffer
65
- ),
56
+ self, arg0: typing.SupportsInt, arg1: IndexArray3D | collections.abc.Buffer
66
57
  ) -> None: ...
58
+ @typing.overload
67
59
  def get(
68
- self,
69
- key: typing.SupportsInt,
70
- default: numpy.typing.NDArray[numpy.uint32] | None = None,
60
+ self, key: typing.SupportsInt
71
61
  ) -> numpy.typing.NDArray[numpy.uint32] | None: ...
62
+ @typing.overload
63
+ def get(
64
+ self, key: typing.SupportsInt, default: numpy.typing.NDArray[numpy.uint32]
65
+ ) -> numpy.typing.NDArray[numpy.uint32]: ...
66
+ @typing.overload
67
+ def get[T](
68
+ self, key: typing.SupportsInt, default: T
69
+ ) -> numpy.typing.NDArray[numpy.uint32] | T: ...
72
70
  def items(
73
71
  self,
74
72
  ) -> collections.abc.ItemsView[int, numpy.typing.NDArray[numpy.uint32]]: ...
75
73
  def keys(self) -> collections.abc.KeysView[int]: ...
74
+ @typing.overload
75
+ def pop(self, key: typing.SupportsInt) -> numpy.typing.NDArray[numpy.uint32]: ...
76
+ @typing.overload
76
77
  def pop(
77
- self, key: typing.SupportsInt, default: numpy.typing.NDArray[numpy.uint32] = ...
78
+ self, key: typing.SupportsInt, default: numpy.typing.NDArray[numpy.uint32]
78
79
  ) -> numpy.typing.NDArray[numpy.uint32]: ...
80
+ @typing.overload
81
+ def pop[T](
82
+ self, key: typing.SupportsInt, default: T
83
+ ) -> numpy.typing.NDArray[numpy.uint32] | T: ...
79
84
  def popitem(self) -> tuple[int, numpy.typing.NDArray[numpy.uint32]]: ...
80
85
  def populate(self, arg0: typing.SupportsInt) -> None: ...
86
+ @typing.overload
81
87
  def setdefault(
82
- self, arg0: typing.SupportsInt, arg1: numpy.typing.NDArray[numpy.uint32] | None
83
- ) -> numpy.typing.NDArray[numpy.uint32] | None: ...
84
- def update(self, other: typing.Any = (), **kwargs: typing.Any) -> None: ...
88
+ self, key: typing.SupportsInt
89
+ ) -> numpy.typing.NDArray[numpy.uint32]: ...
90
+ @typing.overload
91
+ def setdefault(
92
+ self, key: typing.SupportsInt, default: numpy.typing.NDArray[numpy.uint32]
93
+ ) -> numpy.typing.NDArray[numpy.uint32]: ...
94
+ def update(
95
+ self,
96
+ other: (
97
+ collections.abc.Mapping[
98
+ typing.SupportsInt, numpy.typing.NDArray[numpy.uint32]
99
+ ]
100
+ | collections.abc.Iterable[
101
+ tuple[typing.SupportsInt, numpy.typing.NDArray[numpy.uint32]]
102
+ ]
103
+ ) = (),
104
+ **kwargs: numpy.typing.NDArray[numpy.uint32],
105
+ ) -> None: ...
85
106
  def values(
86
107
  self,
87
108
  ) -> collections.abc.ValuesView[numpy.typing.NDArray[numpy.uint32]]: ...
@@ -91,10 +112,5 @@ class SectionArrayMap:
91
112
  def default_array(self) -> int | numpy.ndarray: ...
92
113
  @default_array.setter
93
114
  def default_array(
94
- self,
95
- arg1: (
96
- typing.SupportsInt
97
- | amulet.core.chunk.component.section_array_map.IndexArray3D
98
- | collections.abc.Buffer
99
- ),
115
+ self, arg1: typing.SupportsInt | IndexArray3D | collections.abc.Buffer
100
116
  ) -> None: ...
@@ -14,9 +14,9 @@ class Entity(amulet.core.version.PlatformVersionContainer):
14
14
  """
15
15
 
16
16
  @typing.overload
17
- def __eq__(self, arg0: Entity) -> bool: ...
17
+ def __eq__(self, other: Entity) -> bool: ...
18
18
  @typing.overload
19
- def __eq__(self, arg0: typing.Any) -> bool | types.NotImplementedType: ...
19
+ def __eq__(self, other: typing.Any) -> bool | types.NotImplementedType: ...
20
20
  def __hash__(self) -> int: ...
21
21
  def __init__(
22
22
  self,
@@ -48,7 +48,7 @@ void init_biome_palette(py::module biome_palette_module)
48
48
  bounds_check(self.size(), index);
49
49
  return self.index_to_biome(index);
50
50
  });
51
- pyext::collections::def_Sequence_getitem_slice(BiomePalette);
51
+
52
52
  BiomePalette.def(
53
53
  "__contains__",
54
54
  [](const Amulet::BiomePalette& self, Py_ssize_t index) {
@@ -57,11 +57,13 @@ void init_biome_palette(py::module biome_palette_module)
57
57
  BiomePalette.def(
58
58
  "__contains__",
59
59
  &Amulet::BiomePalette::contains_biome);
60
- pyext::collections::def_Sequence_iter(BiomePalette);
61
- pyext::collections::def_Sequence_reversed(BiomePalette);
62
- pyext::collections::def_Sequence_index(BiomePalette);
63
- pyext::collections::def_Sequence_count(BiomePalette);
64
- pyext::collections::register_Sequence(BiomePalette);
60
+ using BiomeSequence = pyext::collections::Sequence<Amulet::Biome>;
61
+ BiomeSequence::def_getitem_slice(BiomePalette);
62
+ BiomeSequence::def_iter(BiomePalette);
63
+ BiomeSequence::def_reversed(BiomePalette);
64
+ BiomeSequence::def_index(BiomePalette);
65
+ BiomeSequence::def_count(BiomePalette);
66
+ BiomeSequence::register_cls(BiomePalette);
65
67
 
66
68
  BiomePalette.def(
67
69
  "index_to_biome",
@@ -16,12 +16,12 @@ class BiomePalette(amulet.core.version.VersionRangeContainer):
16
16
  @typing.overload
17
17
  def __getitem__(self, arg0: typing.SupportsInt) -> amulet.core.biome.Biome: ...
18
18
  @typing.overload
19
- def __getitem__(self, arg0: slice) -> list: ...
19
+ def __getitem__(self, item: slice) -> list[amulet.core.biome.Biome]: ...
20
20
  def __init__(self, arg0: amulet.core.version.VersionRange) -> None: ...
21
- def __iter__(self) -> collections.abc.Iterator[typing.Any]: ...
21
+ def __iter__(self) -> collections.abc.Iterator[amulet.core.biome.Biome]: ...
22
22
  def __len__(self) -> int: ...
23
23
  def __repr__(self) -> str: ...
24
- def __reversed__(self) -> collections.abc.Iterator[typing.Any]: ...
24
+ def __reversed__(self) -> collections.abc.Iterator[amulet.core.biome.Biome]: ...
25
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.
@@ -31,10 +31,10 @@ class BiomePalette(amulet.core.version.VersionRangeContainer):
31
31
  :return: The index of the biome in the palette.
32
32
  """
33
33
 
34
- def count(self, value: typing.Any) -> int: ...
34
+ def count(self, value: amulet.core.biome.Biome) -> int: ...
35
35
  def index(
36
36
  self,
37
- value: typing.Any,
37
+ value: amulet.core.biome.Biome,
38
38
  start: typing.SupportsInt = 0,
39
39
  stop: typing.SupportsInt = 9223372036854775807,
40
40
  ) -> int: ...
@@ -48,7 +48,7 @@ void init_block_palette(py::module block_palette_module)
48
48
  bounds_check(self.size(), index);
49
49
  return self.index_to_block_stack(index);
50
50
  });
51
- pyext::collections::def_Sequence_getitem_slice(BlockPalette);
51
+
52
52
  BlockPalette.def(
53
53
  "__contains__",
54
54
  [](const Amulet::BlockPalette& self, Py_ssize_t index) {
@@ -57,11 +57,13 @@ void init_block_palette(py::module block_palette_module)
57
57
  BlockPalette.def(
58
58
  "__contains__",
59
59
  &Amulet::BlockPalette::contains_block);
60
- pyext::collections::def_Sequence_iter<Amulet::BlockStack>(BlockPalette);
61
- pyext::collections::def_Sequence_reversed<Amulet::BlockStack>(BlockPalette);
62
- pyext::collections::def_Sequence_index(BlockPalette);
63
- pyext::collections::def_Sequence_count(BlockPalette);
64
- pyext::collections::register_Sequence(BlockPalette);
60
+ using BlockSequence = pyext::collections::Sequence<Amulet::BlockStack>;
61
+ BlockSequence::def_getitem_slice(BlockPalette);
62
+ BlockSequence::def_iter(BlockPalette);
63
+ BlockSequence::def_reversed(BlockPalette);
64
+ BlockSequence::def_index(BlockPalette);
65
+ BlockSequence::def_count(BlockPalette);
66
+ BlockSequence::register_cls(BlockPalette);
65
67
 
66
68
  BlockPalette.def(
67
69
  "index_to_block_stack",
@@ -16,7 +16,7 @@ class BlockPalette(amulet.core.version.VersionRangeContainer):
16
16
  @typing.overload
17
17
  def __getitem__(self, arg0: typing.SupportsInt) -> amulet.core.block.BlockStack: ...
18
18
  @typing.overload
19
- def __getitem__(self, arg0: slice) -> list: ...
19
+ def __getitem__(self, item: slice) -> list[amulet.core.block.BlockStack]: ...
20
20
  def __init__(self, arg0: amulet.core.version.VersionRange) -> None: ...
21
21
  def __iter__(self) -> collections.abc.Iterator[amulet.core.block.BlockStack]: ...
22
22
  def __len__(self) -> int: ...
@@ -33,10 +33,10 @@ class BlockPalette(amulet.core.version.VersionRangeContainer):
33
33
  :return: The index of the block stack in the palette.
34
34
  """
35
35
 
36
- def count(self, value: typing.Any) -> int: ...
36
+ def count(self, value: amulet.core.block.BlockStack) -> int: ...
37
37
  def index(
38
38
  self,
39
- value: typing.Any,
39
+ value: amulet.core.block.BlockStack,
40
40
  start: typing.SupportsInt = 0,
41
41
  stop: typing.SupportsInt = 9223372036854775807,
42
42
  ) -> int: ...
@@ -4,6 +4,7 @@
4
4
 
5
5
  #include "box.hpp"
6
6
  #include "box_group.hpp"
7
+ #include "shape_group.hpp"
7
8
 
8
9
  namespace py = pybind11;
9
10
  namespace pyext = Amulet::pybind11_extensions;
@@ -11,7 +12,7 @@ namespace pyext = Amulet::pybind11_extensions;
11
12
  void init_selection_box(py::classh<Amulet::SelectionBox>);
12
13
  void init_selection_box_group(py::classh<Amulet::SelectionBoxGroup>);
13
14
  py::object init_selection_shape(py::module);
14
- py::object init_selection_shape_group(py::module);
15
+ void init_selection_shape_group(py::module, py::classh<Amulet::SelectionShapeGroup>);
15
16
  py::object init_selection_cuboid(py::module m_parent);
16
17
  py::object init_selection_ellipsoid(py::module m_parent);
17
18
 
@@ -21,6 +22,7 @@ void init_selection(py::module m_parent)
21
22
 
22
23
  auto selection_box_module = m.def_submodule("box");
23
24
  auto selection_box_group_module = m.def_submodule("box_group");
25
+ auto selection_shape_group_module = m.def_submodule("shape_group");
24
26
 
25
27
  // Low level selection
26
28
  // These classes must be defined before methods can be added
@@ -32,6 +34,8 @@ void init_selection(py::module m_parent)
32
34
  "A container for zero or more :class:`SelectionBox` instances.\n"
33
35
  "\n"
34
36
  "This allows for non-rectangular and non-contiguous selections.");
37
+ py::classh<Amulet::SelectionShapeGroup> SelectionShapeGroup(selection_shape_group_module, "SelectionShapeGroup",
38
+ "A group of selection shapes.");
35
39
 
36
40
  // Shape base class
37
41
  m.attr("SelectionShape") = init_selection_shape(m);
@@ -42,9 +46,10 @@ void init_selection(py::module m_parent)
42
46
 
43
47
  m.attr("SelectionBox") = SelectionBox;
44
48
  m.attr("SelectionBoxGroup") = SelectionBoxGroup;
49
+ m.attr("SelectionShapeGroup") = SelectionShapeGroup;
45
50
 
46
51
  // Init shape classes
47
- m.attr("SelectionShapeGroup") = init_selection_shape_group(m);
52
+ init_selection_shape_group(selection_shape_group_module, SelectionShapeGroup);
48
53
  m.attr("SelectionCuboid") = init_selection_cuboid(m);
49
54
  m.attr("SelectionEllipsoid") = init_selection_ellipsoid(m);
50
55
  }
@@ -16,9 +16,9 @@ class SelectionBox:
16
16
  """
17
17
 
18
18
  @typing.overload
19
- def __eq__(self, arg0: SelectionBox) -> bool: ...
19
+ def __eq__(self, other: SelectionBox) -> bool: ...
20
20
  @typing.overload
21
- def __eq__(self, arg0: typing.Any) -> bool | types.NotImplementedType: ...
21
+ def __eq__(self, other: typing.Any) -> bool | types.NotImplementedType: ...
22
22
  def __ge__(self, arg0: SelectionBox) -> bool: ...
23
23
  def __gt__(self, arg0: SelectionBox) -> bool: ...
24
24
  def __hash__(self) -> int: ...
@@ -39,6 +39,12 @@ void init_selection_box_group(py::classh<Amulet::SelectionBoxGroup> SelectionBox
39
39
  "Create an empty SelectionBoxGroup.\n"
40
40
  "\n"
41
41
  ">>> SelectionBoxGroup()"));
42
+ SelectionBoxGroup.def(
43
+ py::init(
44
+ [](const Amulet::SelectionShapeGroup& shapes) {
45
+ return shapes.voxelise();
46
+ }),
47
+ py::arg("shape_group"));
42
48
  SelectionBoxGroup.def(
43
49
  py::init(
44
50
  [](pyext::collections::Iterable<const Amulet::SelectionBox&> boxes) {
@@ -5,6 +5,7 @@ import types
5
5
  import typing
6
6
 
7
7
  import amulet.core.selection.box
8
+ import amulet.core.selection.shape_group
8
9
  import amulet.utils.matrix
9
10
 
10
11
  __all__: list[str] = ["SelectionBoxGroup"]
@@ -23,7 +24,7 @@ class SelectionBoxGroup:
23
24
  """
24
25
 
25
26
  @typing.overload
26
- def __eq__(self, arg0: SelectionBoxGroup) -> bool:
27
+ def __eq__(self, other: SelectionBoxGroup) -> bool:
27
28
  """
28
29
  Does the contents of this :class:`SelectionBoxGroup` match the other :class:`SelectionBoxGroup`.
29
30
 
@@ -34,7 +35,7 @@ class SelectionBoxGroup:
34
35
  """
35
36
 
36
37
  @typing.overload
37
- def __eq__(self, arg0: typing.Any) -> bool | types.NotImplementedType: ...
38
+ def __eq__(self, other: typing.Any) -> bool | types.NotImplementedType: ...
38
39
  @typing.overload
39
40
  def __init__(self) -> None:
40
41
  """
@@ -43,6 +44,10 @@ class SelectionBoxGroup:
43
44
  >>> SelectionBoxGroup()
44
45
  """
45
46
 
47
+ @typing.overload
48
+ def __init__(
49
+ self, shape_group: amulet.core.selection.shape_group.SelectionShapeGroup
50
+ ) -> None: ...
46
51
  @typing.overload
47
52
  def __init__(
48
53
  self, boxes: collections.abc.Iterable[amulet.core.selection.box.SelectionBox]