amulet-core 2.0.5a0__tar.gz → 2.0.6a0__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.6a0}/PKG-INFO +3 -4
  2. amulet_core-2.0.6a0/get_compiler/__init__.py +32 -0
  3. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/pyproject.toml +0 -1
  4. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/requirements.py +2 -2
  5. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/src/amulet/core/_version.py +3 -3
  6. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/src/amulet/core/biome/__init__.pyi +2 -2
  7. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/src/amulet/core/block/__init__.pyi +8 -8
  8. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/src/amulet/core/block/block.py.cpp +10 -10
  9. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/src/amulet/core/block_entity/__init__.pyi +2 -2
  10. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/src/amulet/core/chunk/component/__init__.pyi +2 -5
  11. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/src/amulet/core/chunk/component/__init_chunk_components.py.cpp +1 -1
  12. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/src/amulet/core/chunk/component/biome_3d_component.cpp +7 -7
  13. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/src/amulet/core/chunk/component/biome_3d_component.hpp +9 -9
  14. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/src/amulet/core/chunk/component/block_component.cpp +7 -7
  15. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/src/amulet/core/chunk/component/block_component.hpp +9 -9
  16. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/src/amulet/core/chunk/component/block_component.py.cpp +10 -10
  17. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/src/amulet/core/chunk/component/block_component.pyi +3 -3
  18. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/src/amulet/core/chunk/component/block_entity_component.cpp +9 -9
  19. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/src/amulet/core/chunk/component/block_entity_component.hpp +9 -9
  20. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/src/amulet/core/chunk/component/section_array_map.cpp +1 -1
  21. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/src/amulet/core/chunk/component/section_array_map.py.cpp +12 -11
  22. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/src/amulet/core/chunk/component/section_array_map.pyi +41 -25
  23. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/src/amulet/core/entity/__init__.pyi +2 -2
  24. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/src/amulet/core/palette/biome_palette.py.cpp +8 -6
  25. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/src/amulet/core/palette/biome_palette.pyi +5 -5
  26. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/src/amulet/core/palette/block_palette.py.cpp +8 -6
  27. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/src/amulet/core/palette/block_palette.pyi +3 -3
  28. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/src/amulet/core/selection/__init_selection.py.cpp +7 -2
  29. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/src/amulet/core/selection/box.pyi +2 -2
  30. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/src/amulet/core/selection/box_group.py.cpp +6 -0
  31. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/src/amulet/core/selection/box_group.pyi +7 -2
  32. amulet_core-2.0.6a0/src/amulet/core/selection/cuboid.cpp +458 -0
  33. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/src/amulet/core/selection/cuboid.hpp +5 -0
  34. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/src/amulet/core/selection/cuboid.pyi +1 -0
  35. amulet_core-2.0.6a0/src/amulet/core/selection/ellipsoid.cpp +347 -0
  36. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/src/amulet/core/selection/ellipsoid.hpp +5 -0
  37. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/src/amulet/core/selection/ellipsoid.pyi +1 -0
  38. amulet_core-2.0.6a0/src/amulet/core/selection/shape.cpp +58 -0
  39. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/src/amulet/core/selection/shape.hpp +21 -1
  40. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/src/amulet/core/selection/shape.py.cpp +15 -2
  41. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/src/amulet/core/selection/shape.pyi +17 -0
  42. amulet_core-2.0.6a0/src/amulet/core/selection/shape_group.cpp +147 -0
  43. amulet_core-2.0.6a0/src/amulet/core/selection/shape_group.hpp +73 -0
  44. amulet_core-2.0.6a0/src/amulet/core/selection/shape_group.py.cpp +202 -0
  45. amulet_core-2.0.6a0/src/amulet/core/selection/shape_group.pyi +118 -0
  46. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/src/amulet/core/version/__init__.pyi +4 -4
  47. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0/src/amulet_core.egg-info}/PKG-INFO +3 -4
  48. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/src/amulet_core.egg-info/requires.txt +2 -3
  49. amulet_core-2.0.5a0/get_compiler/__init__.py +0 -32
  50. amulet_core-2.0.5a0/src/amulet/core/selection/cuboid.cpp +0 -205
  51. amulet_core-2.0.5a0/src/amulet/core/selection/ellipsoid.cpp +0 -160
  52. amulet_core-2.0.5a0/src/amulet/core/selection/shape.cpp +0 -21
  53. amulet_core-2.0.5a0/src/amulet/core/selection/shape_group.cpp +0 -27
  54. amulet_core-2.0.5a0/src/amulet/core/selection/shape_group.hpp +0 -61
  55. amulet_core-2.0.5a0/src/amulet/core/selection/shape_group.py.cpp +0 -90
  56. amulet_core-2.0.5a0/src/amulet/core/selection/shape_group.pyi +0 -60
  57. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/CMakeLists.txt +0 -0
  58. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/MANIFEST.in +0 -0
  59. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/README.md +0 -0
  60. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/build_requires.py +0 -0
  61. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/get_compiler/CMakeLists.txt +0 -0
  62. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/setup.cfg +0 -0
  63. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/setup.py +0 -0
  64. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/src/amulet/core/__init__.py +0 -0
  65. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/src/amulet/core/__init__.pyi +0 -0
  66. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/src/amulet/core/__pyinstaller/__init__.py +0 -0
  67. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/src/amulet/core/__pyinstaller/hook-amulet.core.py +0 -0
  68. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/src/amulet/core/_amulet_core.py.cpp +0 -0
  69. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/src/amulet/core/_amulet_core.pyi +0 -0
  70. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/src/amulet/core/amulet_coreConfig.cmake +0 -0
  71. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/src/amulet/core/biome/biome.cpp +0 -0
  72. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/src/amulet/core/biome/biome.hpp +0 -0
  73. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/src/amulet/core/biome/biome.py.cpp +0 -0
  74. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/src/amulet/core/block/block.cpp +0 -0
  75. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/src/amulet/core/block/block.hpp +0 -0
  76. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/src/amulet/core/block_entity/block_entity.cpp +0 -0
  77. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/src/amulet/core/block_entity/block_entity.hpp +0 -0
  78. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/src/amulet/core/block_entity/block_entity.py.cpp +0 -0
  79. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/src/amulet/core/chunk/__init__.pyi +0 -0
  80. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/src/amulet/core/chunk/chunk.cpp +0 -0
  81. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/src/amulet/core/chunk/chunk.hpp +0 -0
  82. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/src/amulet/core/chunk/chunk.py.cpp +0 -0
  83. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/src/amulet/core/chunk/component/section_array_map.hpp +0 -0
  84. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/src/amulet/core/dll.hpp +0 -0
  85. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/src/amulet/core/entity/entity.cpp +0 -0
  86. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/src/amulet/core/entity/entity.hpp +0 -0
  87. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/src/amulet/core/entity/entity.py.cpp +0 -0
  88. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/src/amulet/core/palette/__init__.pyi +0 -0
  89. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/src/amulet/core/palette/__init_palette.py.cpp +0 -0
  90. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/src/amulet/core/palette/biome_palette.cpp +0 -0
  91. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/src/amulet/core/palette/biome_palette.hpp +0 -0
  92. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/src/amulet/core/palette/block_palette.cpp +0 -0
  93. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/src/amulet/core/palette/block_palette.hpp +0 -0
  94. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/src/amulet/core/py.typed +0 -0
  95. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/src/amulet/core/selection/__init__.pyi +0 -0
  96. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/src/amulet/core/selection/box.cpp +0 -0
  97. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/src/amulet/core/selection/box.hpp +0 -0
  98. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/src/amulet/core/selection/box.py.cpp +0 -0
  99. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/src/amulet/core/selection/box_group.cpp +0 -0
  100. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/src/amulet/core/selection/box_group.hpp +0 -0
  101. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/src/amulet/core/selection/cuboid.py.cpp +0 -0
  102. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/src/amulet/core/selection/ellipsoid.py.cpp +0 -0
  103. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/src/amulet/core/version/version.cpp +0 -0
  104. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/src/amulet/core/version/version.hpp +0 -0
  105. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/src/amulet/core/version/version.py.cpp +0 -0
  106. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/src/amulet_core.egg-info/SOURCES.txt +0 -0
  107. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/src/amulet_core.egg-info/dependency_links.txt +0 -0
  108. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/src/amulet_core.egg-info/entry_points.txt +0 -0
  109. {amulet_core-2.0.5a0 → amulet_core-2.0.6a0}/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.6a0
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-10-16T14:53:07+0100",
12
12
  "dirty": false,
13
13
  "error": null,
14
- "full-revisionid": "d46ea97b2c67f05ece822c4af0819fa94db55cf3",
15
- "version": "2.0.5a0"
14
+ "full-revisionid": "c3e4c826d97d6d0ca38d45bbd0595499626b71df",
15
+ "version": "2.0.6a0"
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,
@@ -1,16 +1,13 @@
1
1
  from __future__ import annotations
2
2
 
3
- from amulet.core.chunk.component.block_component import (
4
- BlockComponent,
5
- BlockComponentData,
6
- )
3
+ from amulet.core.chunk.component.block_component import BlockComponent, BlockStorage
7
4
  from amulet.core.chunk.component.section_array_map import IndexArray3D, SectionArrayMap
8
5
 
9
6
  from . import block_component, section_array_map
10
7
 
11
8
  __all__: list[str] = [
12
9
  "BlockComponent",
13
- "BlockComponentData",
10
+ "BlockStorage",
14
11
  "IndexArray3D",
15
12
  "SectionArrayMap",
16
13
  "block_component",
@@ -17,6 +17,6 @@ void init_chunk_components(py::module m_parent)
17
17
  m.attr("SectionArrayMap") = m_section_array_map.attr("SectionArrayMap");
18
18
 
19
19
  auto m_block_component = init_block_component(m);
20
- m.attr("BlockComponentData") = m_block_component.attr("BlockComponentData");
20
+ m.attr("BlockStorage") = m_block_component.attr("BlockStorage");
21
21
  m.attr("BlockComponent") = m_block_component.attr("BlockComponent");
22
22
  }
@@ -6,23 +6,23 @@ namespace Amulet {
6
6
 
7
7
  // Biome3DComponent
8
8
 
9
- void Biome3DComponentData::serialise(BinaryWriter& writer) const
9
+ void Biome3DStorage::serialise(BinaryWriter& writer) const
10
10
  {
11
11
  writer.write_numeric<std::uint8_t>(1);
12
12
  _palette->serialise(writer);
13
13
  _sections->serialise(writer);
14
14
  }
15
- Biome3DComponentData Biome3DComponentData::deserialise(BinaryReader& reader)
15
+ Biome3DStorage Biome3DStorage::deserialise(BinaryReader& reader)
16
16
  {
17
17
  auto version_number = reader.read_numeric<std::uint8_t>();
18
18
  switch (version_number) {
19
19
  case 1: {
20
20
  auto palette = std::make_shared<BiomePalette>(BiomePalette::deserialise(reader));
21
21
  auto sections = std::make_shared<SectionArrayMap>(SectionArrayMap::deserialise(reader));
22
- return Biome3DComponentData { std::move(palette), std::move(sections) };
22
+ return Biome3DStorage { std::move(palette), std::move(sections) };
23
23
  }
24
24
  default:
25
- throw std::invalid_argument("Unsupported Biome3DComponentData version " + std::to_string(version_number));
25
+ throw std::invalid_argument("Unsupported Biome3DStorage version " + std::to_string(version_number));
26
26
  }
27
27
  }
28
28
 
@@ -38,7 +38,7 @@ std::optional<std::string> Biome3DComponent::serialise() const
38
38
  void Biome3DComponent::deserialise(std::optional<std::string> data)
39
39
  {
40
40
  if (data) {
41
- _value = std::make_shared<Biome3DComponentData>(Amulet::deserialise<Biome3DComponentData>(*data));
41
+ _value = std::make_shared<Biome3DStorage>(Amulet::deserialise<Biome3DStorage>(*data));
42
42
  } else {
43
43
  _value = std::nullopt;
44
44
  }
@@ -46,7 +46,7 @@ void Biome3DComponent::deserialise(std::optional<std::string> data)
46
46
 
47
47
  const std::string Biome3DComponent::ComponentID = "Amulet::Biome3DComponent";
48
48
 
49
- std::shared_ptr<Biome3DComponentData> Biome3DComponent::get_biome()
49
+ std::shared_ptr<Biome3DStorage> Biome3DComponent::get_biome_storage()
50
50
  {
51
51
  if (_value) {
52
52
  return *_value;
@@ -54,7 +54,7 @@ std::shared_ptr<Biome3DComponentData> Biome3DComponent::get_biome()
54
54
  throw std::runtime_error("BiomeComponent has not been loaded.");
55
55
  }
56
56
 
57
- void Biome3DComponent::set_biome(std::shared_ptr<Biome3DComponentData> component)
57
+ void Biome3DComponent::set_biome_storage(std::shared_ptr<Biome3DStorage> component)
58
58
  {
59
59
  if (_value) {
60
60
  auto& old_data = **_value;
@@ -14,14 +14,14 @@
14
14
 
15
15
  namespace Amulet {
16
16
 
17
- class Biome3DComponentData {
17
+ class Biome3DStorage {
18
18
  private:
19
19
  std::shared_ptr<BiomePalette> _palette;
20
20
  std::shared_ptr<SectionArrayMap> _sections;
21
21
 
22
22
  public:
23
23
  template <typename PaletteT, typename SectionsT>
24
- Biome3DComponentData(
24
+ Biome3DStorage(
25
25
  PaletteT&& palette,
26
26
  SectionsT&& sections)
27
27
  : _palette(
@@ -44,11 +44,11 @@ public:
44
44
  }
45
45
 
46
46
  template <typename VersionRangeT>
47
- Biome3DComponentData(
47
+ Biome3DStorage(
48
48
  VersionRangeT&& version_range,
49
49
  const SectionShape& array_shape,
50
50
  const Biome& default_biome)
51
- : Biome3DComponentData(
51
+ : Biome3DStorage(
52
52
  std::make_shared<BiomePalette>(std::forward<VersionRangeT>(version_range)),
53
53
  std::make_shared<SectionArrayMap>(array_shape, static_cast<std::uint32_t>(0)))
54
54
  {
@@ -61,12 +61,12 @@ public:
61
61
  std::shared_ptr<SectionArrayMap> get_sections_ptr() { return _sections; }
62
62
 
63
63
  AMULET_CORE_EXPORT void serialise(BinaryWriter&) const;
64
- AMULET_CORE_EXPORT static Biome3DComponentData deserialise(BinaryReader&);
64
+ AMULET_CORE_EXPORT static Biome3DStorage deserialise(BinaryReader&);
65
65
  };
66
66
 
67
67
  class Biome3DComponent {
68
68
  private:
69
- std::optional<std::shared_ptr<Biome3DComponentData>> _value;
69
+ std::optional<std::shared_ptr<Biome3DStorage>> _value;
70
70
 
71
71
  protected:
72
72
  // Null constructor
@@ -79,7 +79,7 @@ protected:
79
79
  const SectionShape& array_shape,
80
80
  const Biome& default_biome)
81
81
  {
82
- _value = std::make_shared<Biome3DComponentData>(
82
+ _value = std::make_shared<Biome3DStorage>(
83
83
  std::forward<VersionRangeT>(version_range),
84
84
  array_shape,
85
85
  default_biome);
@@ -92,8 +92,8 @@ protected:
92
92
 
93
93
  public:
94
94
  AMULET_CORE_EXPORT static const std::string ComponentID;
95
- AMULET_CORE_EXPORT std::shared_ptr<Biome3DComponentData> get_biome();
96
- AMULET_CORE_EXPORT void set_biome(std::shared_ptr<Biome3DComponentData> component);
95
+ AMULET_CORE_EXPORT std::shared_ptr<Biome3DStorage> get_biome_storage();
96
+ AMULET_CORE_EXPORT void set_biome_storage(std::shared_ptr<Biome3DStorage> component);
97
97
  };
98
98
 
99
99
  } // namespace Amulet
@@ -4,15 +4,15 @@
4
4
 
5
5
  namespace Amulet {
6
6
 
7
- // BlockComponentData
8
- void BlockComponentData::serialise(BinaryWriter& writer) const
7
+ // BlockStorage
8
+ void BlockStorage::serialise(BinaryWriter& writer) const
9
9
  {
10
10
  writer.write_numeric<std::uint8_t>(1);
11
11
  get_palette().serialise(writer);
12
12
  get_sections().serialise(writer);
13
13
  }
14
14
 
15
- BlockComponentData BlockComponentData::deserialise(BinaryReader& reader)
15
+ BlockStorage BlockStorage::deserialise(BinaryReader& reader)
16
16
  {
17
17
  auto version = reader.read_numeric<std::uint8_t>();
18
18
  switch (version) {
@@ -22,7 +22,7 @@ BlockComponentData BlockComponentData::deserialise(BinaryReader& reader)
22
22
  return { palette, sections };
23
23
  }
24
24
  default:
25
- throw std::invalid_argument("Unsupported BlockComponentData version " + std::to_string(version));
25
+ throw std::invalid_argument("Unsupported BlockStorage version " + std::to_string(version));
26
26
  }
27
27
  }
28
28
 
@@ -39,7 +39,7 @@ std::optional<std::string> BlockComponent::serialise() const
39
39
  void BlockComponent::deserialise(std::optional<std::string> data)
40
40
  {
41
41
  if (data) {
42
- _value = std::make_shared<BlockComponentData>(Amulet::deserialise<BlockComponentData>(*data));
42
+ _value = std::make_shared<BlockStorage>(Amulet::deserialise<BlockStorage>(*data));
43
43
  } else {
44
44
  _value = std::nullopt;
45
45
  }
@@ -47,7 +47,7 @@ void BlockComponent::deserialise(std::optional<std::string> data)
47
47
 
48
48
  const std::string BlockComponent::ComponentID = "Amulet::BlockComponent";
49
49
 
50
- std::shared_ptr<BlockComponentData> BlockComponent::get_block()
50
+ std::shared_ptr<BlockStorage> BlockComponent::get_block_storage()
51
51
  {
52
52
  if (_value) {
53
53
  return *_value;
@@ -55,7 +55,7 @@ std::shared_ptr<BlockComponentData> BlockComponent::get_block()
55
55
  throw std::runtime_error("BlockComponent has not been loaded.");
56
56
  }
57
57
 
58
- void BlockComponent::set_block(std::shared_ptr<BlockComponentData> component)
58
+ void BlockComponent::set_block_storage(std::shared_ptr<BlockStorage> component)
59
59
  {
60
60
  if (_value) {
61
61
  auto& old_data = **_value;
@@ -16,14 +16,14 @@
16
16
 
17
17
  namespace Amulet {
18
18
 
19
- class BlockComponentData {
19
+ class BlockStorage {
20
20
  private:
21
21
  std::shared_ptr<BlockPalette> _palette;
22
22
  std::shared_ptr<SectionArrayMap> _sections;
23
23
 
24
24
  public:
25
25
  template <typename PaletteT, typename SectionsT>
26
- BlockComponentData(
26
+ BlockStorage(
27
27
  PaletteT&& palette,
28
28
  SectionsT&& sections)
29
29
  : _palette(
@@ -46,11 +46,11 @@ public:
46
46
  }
47
47
 
48
48
  template <typename VersionRangeT>
49
- BlockComponentData(
49
+ BlockStorage(
50
50
  VersionRangeT&& version_range,
51
51
  const SectionShape& array_shape,
52
52
  const BlockStack& default_block)
53
- : BlockComponentData(
53
+ : BlockStorage(
54
54
  std::make_shared<BlockPalette>(std::forward<VersionRangeT>(version_range)),
55
55
  std::make_shared<SectionArrayMap>(array_shape, static_cast<std::uint32_t>(0)))
56
56
  {
@@ -58,7 +58,7 @@ public:
58
58
  }
59
59
 
60
60
  AMULET_CORE_EXPORT void serialise(BinaryWriter&) const;
61
- AMULET_CORE_EXPORT static BlockComponentData deserialise(BinaryReader&);
61
+ AMULET_CORE_EXPORT static BlockStorage deserialise(BinaryReader&);
62
62
 
63
63
  BlockPalette& get_palette() const { return *_palette; }
64
64
  std::shared_ptr<BlockPalette> get_palette_ptr() const { return _palette; }
@@ -68,7 +68,7 @@ public:
68
68
 
69
69
  class BlockComponent {
70
70
  private:
71
- std::optional<std::shared_ptr<BlockComponentData>> _value;
71
+ std::optional<std::shared_ptr<BlockStorage>> _value;
72
72
 
73
73
  protected:
74
74
  // Null constructor
@@ -81,7 +81,7 @@ protected:
81
81
  const SectionShape& array_shape,
82
82
  const BlockStack& default_block)
83
83
  {
84
- _value = std::make_shared<BlockComponentData>(
84
+ _value = std::make_shared<BlockStorage>(
85
85
  std::forward<VersionRangeT>(version_range),
86
86
  array_shape,
87
87
  default_block);
@@ -94,8 +94,8 @@ protected:
94
94
 
95
95
  public:
96
96
  AMULET_CORE_EXPORT static const std::string ComponentID;
97
- AMULET_CORE_EXPORT std::shared_ptr<BlockComponentData> get_block();
98
- AMULET_CORE_EXPORT void set_block(std::shared_ptr<BlockComponentData> component);
97
+ AMULET_CORE_EXPORT std::shared_ptr<BlockStorage> get_block_storage();
98
+ AMULET_CORE_EXPORT void set_block_storage(std::shared_ptr<BlockStorage> component);
99
99
  };
100
100
 
101
101
  } // namespace Amulet
@@ -16,9 +16,9 @@ py::module init_block_component(py::module m_parent)
16
16
  {
17
17
  auto m = m_parent.def_submodule("block_component");
18
18
 
19
- py::class_<Amulet::BlockComponentData, std::shared_ptr<Amulet::BlockComponentData>>
20
- BlockComponentData(m, "BlockComponentData");
21
- BlockComponentData.def(
19
+ py::class_<Amulet::BlockStorage, std::shared_ptr<Amulet::BlockStorage>>
20
+ BlockStorage(m, "BlockStorage");
21
+ BlockStorage.def(
22
22
  py::init<
23
23
  const Amulet::VersionRange&,
24
24
  const Amulet::SectionShape&,
@@ -26,12 +26,12 @@ py::module init_block_component(py::module m_parent)
26
26
  py::arg("version_range"),
27
27
  py::arg("array_shape"),
28
28
  py::arg("default_block"));
29
- BlockComponentData.def_property_readonly(
29
+ BlockStorage.def_property_readonly(
30
30
  "palette",
31
- &Amulet::BlockComponentData::get_palette_ptr);
32
- BlockComponentData.def_property_readonly(
31
+ &Amulet::BlockStorage::get_palette_ptr);
32
+ BlockStorage.def_property_readonly(
33
33
  "sections",
34
- &Amulet::BlockComponentData::get_sections_ptr);
34
+ &Amulet::BlockStorage::get_sections_ptr);
35
35
 
36
36
  py::class_<Amulet::BlockComponent, std::shared_ptr<Amulet::BlockComponent>>
37
37
  BlockComponent(m, "BlockComponent");
@@ -39,9 +39,9 @@ py::module init_block_component(py::module m_parent)
39
39
  "ComponentID",
40
40
  &Amulet::BlockComponent::ComponentID);
41
41
  BlockComponent.def_property(
42
- "block",
43
- &Amulet::BlockComponent::get_block,
44
- &Amulet::BlockComponent::set_block);
42
+ "block_storage",
43
+ &Amulet::BlockComponent::get_block_storage,
44
+ &Amulet::BlockComponent::set_block_storage);
45
45
 
46
46
  return m;
47
47
  }
@@ -7,13 +7,13 @@ import amulet.core.chunk.component.section_array_map
7
7
  import amulet.core.palette.block_palette
8
8
  import amulet.core.version
9
9
 
10
- __all__: list[str] = ["BlockComponent", "BlockComponentData"]
10
+ __all__: list[str] = ["BlockComponent", "BlockStorage"]
11
11
 
12
12
  class BlockComponent:
13
13
  ComponentID: typing.ClassVar[str] = "Amulet::BlockComponent"
14
- block: BlockComponentData
14
+ block_storage: BlockStorage
15
15
 
16
- class BlockComponentData:
16
+ class BlockStorage:
17
17
  def __init__(
18
18
  self,
19
19
  version_range: amulet.core.version.VersionRange,
@@ -4,9 +4,9 @@
4
4
 
5
5
  namespace Amulet {
6
6
 
7
- // BlockEntityComponentData
7
+ // BlockEntityStorage
8
8
 
9
- void BlockEntityComponentData::serialise(BinaryWriter& writer) const
9
+ void BlockEntityStorage::serialise(BinaryWriter& writer) const
10
10
  {
11
11
  writer.write_numeric<std::uint8_t>(1);
12
12
  get_version_range().serialise(writer);
@@ -21,7 +21,7 @@ void BlockEntityComponentData::serialise(BinaryWriter& writer) const
21
21
  block_entity->serialise(writer);
22
22
  }
23
23
  }
24
- BlockEntityComponentData BlockEntityComponentData::deserialise(BinaryReader& reader)
24
+ BlockEntityStorage BlockEntityStorage::deserialise(BinaryReader& reader)
25
25
  {
26
26
  auto version_number = reader.read_numeric<std::uint8_t>();
27
27
  switch (version_number) {
@@ -29,7 +29,7 @@ BlockEntityComponentData BlockEntityComponentData::deserialise(BinaryReader& rea
29
29
  auto version_range = VersionRange::deserialise(reader);
30
30
  auto x_size = reader.read_numeric<std::uint16_t>();
31
31
  auto z_size = reader.read_numeric<std::uint16_t>();
32
- BlockEntityComponentData block_entities {
32
+ BlockEntityStorage block_entities {
33
33
  std::move(version_range),
34
34
  x_size,
35
35
  z_size
@@ -45,7 +45,7 @@ BlockEntityComponentData BlockEntityComponentData::deserialise(BinaryReader& rea
45
45
  return block_entities;
46
46
  }
47
47
  default:
48
- throw std::invalid_argument("Unsupported BlockEntityComponentData version " + std::to_string(version_number));
48
+ throw std::invalid_argument("Unsupported BlockEntityStorage version " + std::to_string(version_number));
49
49
  }
50
50
  }
51
51
 
@@ -55,7 +55,7 @@ AMULET_CORE_EXPORT void BlockEntityComponent::init(
55
55
  std::uint16_t x_size,
56
56
  std::uint16_t z_size)
57
57
  {
58
- _value = std::make_shared<BlockEntityComponentData>(version_range, x_size, z_size);
58
+ _value = std::make_shared<BlockEntityStorage>(version_range, x_size, z_size);
59
59
  }
60
60
 
61
61
  std::optional<std::string> BlockEntityComponent::serialise() const
@@ -70,7 +70,7 @@ std::optional<std::string> BlockEntityComponent::serialise() const
70
70
  void BlockEntityComponent::deserialise(std::optional<std::string> data)
71
71
  {
72
72
  if (data) {
73
- _value = std::make_shared<BlockEntityComponentData>(Amulet::deserialise<BlockEntityComponentData>(*data));
73
+ _value = std::make_shared<BlockEntityStorage>(Amulet::deserialise<BlockEntityStorage>(*data));
74
74
  } else {
75
75
  _value = std::nullopt;
76
76
  }
@@ -78,7 +78,7 @@ void BlockEntityComponent::deserialise(std::optional<std::string> data)
78
78
 
79
79
  const std::string BlockEntityComponent::ComponentID = "Amulet::BlockEntityComponent";
80
80
 
81
- AMULET_CORE_EXPORT std::shared_ptr<BlockEntityComponentData> BlockEntityComponent::get_block_entity()
81
+ AMULET_CORE_EXPORT std::shared_ptr<BlockEntityStorage> BlockEntityComponent::get_block_entities()
82
82
  {
83
83
  if (_value) {
84
84
  return *_value;
@@ -86,7 +86,7 @@ AMULET_CORE_EXPORT std::shared_ptr<BlockEntityComponentData> BlockEntityComponen
86
86
  throw std::runtime_error("BlockEntityComponent has not been loaded.");
87
87
  }
88
88
 
89
- AMULET_CORE_EXPORT void BlockEntityComponent::set_block_entity(std::shared_ptr<BlockEntityComponentData> component)
89
+ AMULET_CORE_EXPORT void BlockEntityComponent::set_block_entities(std::shared_ptr<BlockEntityStorage> component)
90
90
  {
91
91
  if (_value) {
92
92
  auto& old_data = **_value;