amulet-core 2.0.5a0__cp312-cp312-win_amd64.whl → 2.0.5a1__cp312-cp312-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of amulet-core might be problematic. Click here for more details.

amulet/core/_version.py CHANGED
@@ -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
 
Binary file
Binary file
@@ -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: ...
@@ -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,
@@ -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,
@@ -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: ...
@@ -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: ...
@@ -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: ...
@@ -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]
@@ -8,6 +8,7 @@ namespace Amulet {
8
8
 
9
9
  class AMULET_CORE_EXPORT SelectionCuboid : public SelectionShape {
10
10
  public:
11
+ SelectionCuboid();
11
12
  SelectionCuboid(const Matrix4x4&);
12
13
 
13
14
  SelectionCuboid(
@@ -21,6 +22,8 @@ public:
21
22
 
22
23
  SelectionCuboid(const SelectionCuboid& other);
23
24
 
25
+ std::string serialise() const override;
26
+
24
27
  std::unique_ptr<SelectionShape> copy() const override;
25
28
  explicit operator std::set<SelectionBox>() const override;
26
29
 
@@ -31,6 +34,8 @@ public:
31
34
 
32
35
  bool almost_equal(const SelectionCuboid&) const;
33
36
  bool almost_equal(const SelectionShape&) const override;
37
+ bool operator==(const SelectionCuboid&) const;
38
+ bool operator==(const SelectionShape&) const override;
34
39
  };
35
40
 
36
41
  } // namespace Amulet
@@ -24,6 +24,7 @@ class SelectionCuboid(amulet.core.selection.shape.SelectionShape):
24
24
  ) -> None: ...
25
25
  @typing.overload
26
26
  def __init__(self, matrix: amulet.utils.matrix.Matrix4x4) -> None: ...
27
+ def __repr__(self) -> str: ...
27
28
  def transform(self, matrix: amulet.utils.matrix.Matrix4x4) -> SelectionCuboid:
28
29
  """
29
30
  Create a new :class:`SelectionCuboid` based on this one transformed by the given matrix.
@@ -12,6 +12,7 @@ class SelectionBox;
12
12
  // The SelectionEllipsoid class represents a single spherical selection.
13
13
  class AMULET_CORE_EXPORT SelectionEllipsoid : public SelectionShape {
14
14
  public:
15
+ SelectionEllipsoid();
15
16
  SelectionEllipsoid(const Matrix4x4&);
16
17
 
17
18
  SelectionEllipsoid(
@@ -21,6 +22,8 @@ public:
21
22
  double radius);
22
23
 
23
24
  SelectionEllipsoid(const SelectionEllipsoid& other);
25
+
26
+ std::string serialise() const override;
24
27
 
25
28
  std::unique_ptr<SelectionShape> copy() const override;
26
29
  explicit operator std::set<SelectionBox>() const override;
@@ -32,6 +35,8 @@ public:
32
35
 
33
36
  bool almost_equal(const SelectionEllipsoid&) const;
34
37
  bool almost_equal(const SelectionShape&) const override;
38
+ bool operator==(const SelectionEllipsoid&) const;
39
+ bool operator==(const SelectionShape&) const override;
35
40
  };
36
41
 
37
42
  } // namespace Amulet
@@ -22,6 +22,7 @@ class SelectionEllipsoid(amulet.core.selection.shape.SelectionShape):
22
22
  ) -> None: ...
23
23
  @typing.overload
24
24
  def __init__(self, matrix: amulet.utils.matrix.Matrix4x4) -> None: ...
25
+ def __repr__(self) -> str: ...
25
26
  def transform(self, matrix: amulet.utils.matrix.Matrix4x4) -> SelectionEllipsoid:
26
27
  """
27
28
  Create a new :class:`SelectionEllipsoid` based on this one transformed by the given matrix.
@@ -1,7 +1,13 @@
1
1
  #pragma once
2
2
 
3
+ #include <functional>
4
+ #include <list>
3
5
  #include <memory>
6
+ #include <optional>
4
7
  #include <set>
8
+ #include <string>
9
+ #include <string_view>
10
+ #include <utility>
5
11
 
6
12
  #include <amulet/utils/matrix.hpp>
7
13
 
@@ -15,8 +21,8 @@ class SelectionBoxGroup;
15
21
  class AMULET_CORE_EXPORT SelectionShape {
16
22
  private:
17
23
  Matrix4x4 _matrix;
18
- public:
19
24
 
25
+ public:
20
26
  SelectionShape() = default;
21
27
  SelectionShape(const Matrix4x4& matrix)
22
28
  : _matrix(matrix)
@@ -25,6 +31,19 @@ public:
25
31
  virtual ~SelectionShape() = default;
26
32
 
27
33
  const Matrix4x4& get_matrix() const;
34
+ void set_matrix(const Matrix4x4&);
35
+
36
+ // Convert the class to human readable plain text.
37
+ virtual std::string serialise() const = 0;
38
+
39
+ // Deserialise the serialised data back to an object.
40
+ static std::unique_ptr<SelectionShape> deserialise(std::string_view, size_t&);
41
+ static std::unique_ptr<SelectionShape> deserialise(std::string_view);
42
+
43
+ using Deserialiser = std::function<
44
+ std::unique_ptr<SelectionShape>(std::string_view, size_t&)>;
45
+
46
+ static bool register_deserialiser(Deserialiser);
28
47
 
29
48
  // Create a copy of the class.
30
49
  virtual std::unique_ptr<SelectionShape> copy() const = 0;
@@ -48,6 +67,7 @@ public:
48
67
 
49
68
  // Equality
50
69
  virtual bool almost_equal(const SelectionShape&) const = 0;
70
+ virtual bool operator==(const SelectionShape&) const = 0;
51
71
  };
52
72
 
53
73
  } // namespace Amulet
@@ -1,5 +1,6 @@
1
1
  from __future__ import annotations
2
2
 
3
+ import types
3
4
  import typing
4
5
 
5
6
  import amulet.core.selection.box_group
@@ -12,12 +13,28 @@ class SelectionShape:
12
13
  A base class for selection classes.
13
14
  """
14
15
 
16
+ __hash__: typing.ClassVar[None] = None # type: ignore
15
17
  matrix: amulet.utils.matrix.Matrix4x4
18
+ @staticmethod
19
+ def deserialise(s: str) -> SelectionShape:
20
+ """
21
+ Deserialise the serialised data back to an object.
22
+ """
23
+
24
+ @typing.overload
25
+ def __eq__(self, other: SelectionShape) -> bool: ...
26
+ @typing.overload
27
+ def __eq__(self, other: typing.Any) -> bool | types.NotImplementedType: ...
16
28
  def almost_equal(self, other: SelectionShape) -> bool:
17
29
  """
18
30
  Check if this shape is equal or almost equal to another shape.
19
31
  """
20
32
 
33
+ def serialise(self) -> str:
34
+ """
35
+ Convert the class to human readable plain text.
36
+ """
37
+
21
38
  def transform(self, matrix: amulet.utils.matrix.Matrix4x4) -> SelectionShape:
22
39
  """
23
40
  Translate the shape by the given matrix
@@ -1,6 +1,8 @@
1
1
  #pragma once
2
2
 
3
3
  #include <memory>
4
+ #include <string>
5
+ #include <string_view>
4
6
  #include <vector>
5
7
 
6
8
  #include <amulet/core/dll.hpp>
@@ -14,33 +16,40 @@ class SelectionBoxGroup;
14
16
 
15
17
  class AMULET_CORE_EXPORT SelectionShapeGroup {
16
18
  private:
17
- std::vector<std::unique_ptr<const SelectionShape>> _shapes;
19
+ std::vector<std::shared_ptr<SelectionShape>> _shapes;
18
20
 
19
21
  public:
20
- // Forwarding constructor
21
- template <typename... Args>
22
- SelectionShapeGroup(Args&&... args)
23
- : _shapes(std::forward<Args>(args)...)
24
- {
25
- }
22
+ SelectionShapeGroup();
23
+ SelectionShapeGroup(std::vector<std::shared_ptr<SelectionShape>> shapes);
24
+
25
+ SelectionShapeGroup(const SelectionShapeGroup&);
26
+ SelectionShapeGroup& operator=(const SelectionShapeGroup&);
26
27
 
27
- // Disable copying
28
- SelectionShapeGroup(const SelectionShapeGroup&) = delete;
29
- SelectionShapeGroup& operator=(const SelectionShapeGroup&) = delete;
28
+ SelectionShapeGroup(SelectionShapeGroup&&);
29
+ SelectionShapeGroup& operator=(SelectionShapeGroup&&);
30
30
 
31
- // Default move
32
- SelectionShapeGroup(SelectionShapeGroup&&) = default;
33
- SelectionShapeGroup& operator=(SelectionShapeGroup&&) = default;
31
+ SelectionShapeGroup deep_copy() const;
34
32
 
35
- const std::vector<std::unique_ptr<const SelectionShape>>& get_shapes() const
33
+ std::string serialise() const;
34
+ static SelectionShapeGroup deserialise(std::string_view);
35
+
36
+ const std::vector<std::shared_ptr<SelectionShape>>& get_shapes() const
37
+ {
38
+ return _shapes;
39
+ }
40
+ std::vector<std::shared_ptr<SelectionShape>>& get_shapes()
36
41
  {
37
42
  return _shapes;
38
43
  }
39
- std::vector<std::unique_ptr<const SelectionShape>>::const_iterator begin() const
44
+ void set_shapes(std::vector<std::shared_ptr<SelectionShape>> shapes)
45
+ {
46
+ _shapes = std::move(shapes);
47
+ }
48
+ std::vector<std::shared_ptr<SelectionShape>>::const_iterator begin() const
40
49
  {
41
50
  return _shapes.begin();
42
51
  }
43
- std::vector<std::unique_ptr<const SelectionShape>>::const_iterator end() const
52
+ std::vector<std::shared_ptr<SelectionShape>>::const_iterator end() const
44
53
  {
45
54
  return _shapes.end();
46
55
  }
@@ -56,6 +65,9 @@ public:
56
65
  explicit operator SelectionBoxGroup() const;
57
66
  explicit operator std::set<SelectionBox>() const;
58
67
  SelectionBoxGroup voxelise() const;
68
+
69
+ bool almost_equal(const SelectionShapeGroup&) const;
70
+ bool operator==(const SelectionShapeGroup&) const;
59
71
  };
60
72
 
61
73
  }
@@ -1,8 +1,10 @@
1
1
  from __future__ import annotations
2
2
 
3
3
  import collections.abc
4
+ import types
4
5
  import typing
5
6
 
7
+ import amulet.core.selection.box_group
6
8
  import amulet.core.selection.shape
7
9
 
8
10
  __all__: list[str] = ["SelectionShapeGroup"]
@@ -12,11 +14,34 @@ class SelectionShapeGroup:
12
14
  A group of selection shapes.
13
15
  """
14
16
 
17
+ __hash__: typing.ClassVar[None] = None # type: ignore
18
+ @staticmethod
19
+ def deserialise(s: str) -> SelectionShapeGroup: ...
15
20
  def __bool__(self) -> bool:
16
21
  """
17
22
  Are there any selections in the group.
18
23
  """
19
24
 
25
+ def __contains__(self, item: typing.Any) -> bool: ...
26
+ def __copy__(self) -> SelectionShapeGroup: ...
27
+ def __deepcopy__(self, memo: dict) -> SelectionShapeGroup: ...
28
+ def __delitem__(self, index: typing.SupportsInt) -> None: ...
29
+ @typing.overload
30
+ def __eq__(self, other: SelectionShapeGroup) -> bool: ...
31
+ @typing.overload
32
+ def __eq__(self, other: typing.Any) -> bool | types.NotImplementedType: ...
33
+ @typing.overload
34
+ def __getitem__(
35
+ self, index: typing.SupportsInt
36
+ ) -> amulet.core.selection.shape.SelectionShape: ...
37
+ @typing.overload
38
+ def __getitem__(
39
+ self, item: slice
40
+ ) -> list[amulet.core.selection.shape.SelectionShape]: ...
41
+ def __iadd__(
42
+ self,
43
+ values: collections.abc.Iterable[amulet.core.selection.shape.SelectionShape],
44
+ ) -> typing.Any: ...
20
45
  @typing.overload
21
46
  def __init__(self) -> None:
22
47
  """
@@ -25,6 +50,10 @@ class SelectionShapeGroup:
25
50
  >>> SelectionShapeGroup()
26
51
  """
27
52
 
53
+ @typing.overload
54
+ def __init__(
55
+ self, box_group: amulet.core.selection.box_group.SelectionBoxGroup
56
+ ) -> None: ...
28
57
  @typing.overload
29
58
  def __init__(
30
59
  self,
@@ -41,20 +70,49 @@ class SelectionShapeGroup:
41
70
 
42
71
  def __iter__(
43
72
  self,
44
- ) -> collections.abc.Iterator[amulet.core.selection.shape.SelectionShape]:
73
+ ) -> collections.abc.Iterator[amulet.core.selection.shape.SelectionShape]: ...
74
+ def __len__(self) -> int:
45
75
  """
46
- An iterable of all the :class:`SelectionShape` classes in the group.
76
+ The number of :class:`SelectionShape` classes in the group.
47
77
  """
48
78
 
49
- def __len__(self) -> int:
79
+ def __repr__(self) -> str: ...
80
+ def __reversed__(
81
+ self,
82
+ ) -> collections.abc.Iterator[amulet.core.selection.shape.SelectionShape]: ...
83
+ def __setitem__(
84
+ self,
85
+ index: typing.SupportsInt,
86
+ item: amulet.core.selection.shape.SelectionShape,
87
+ ) -> None: ...
88
+ def almost_equal(self, other: SelectionShapeGroup) -> bool:
50
89
  """
51
- The number of :class:`SelectionShape` classes in the group.
90
+ Returns True of the shape groups are equal or almost equal.
52
91
  """
53
92
 
54
- @property
55
- def shapes(
93
+ def append(self, value: amulet.core.selection.shape.SelectionShape) -> None: ...
94
+ def clear(self) -> None: ...
95
+ def count(self, value: amulet.core.selection.shape.SelectionShape) -> int: ...
96
+ def extend(
97
+ self,
98
+ values: collections.abc.Iterable[amulet.core.selection.shape.SelectionShape],
99
+ ) -> None: ...
100
+ def index(
101
+ self,
102
+ value: amulet.core.selection.shape.SelectionShape,
103
+ start: typing.SupportsInt = 0,
104
+ stop: typing.SupportsInt = 9223372036854775807,
105
+ ) -> int: ...
106
+ def insert(
56
107
  self,
57
- ) -> collections.abc.Iterator[amulet.core.selection.shape.SelectionShape]:
108
+ index: typing.SupportsInt,
109
+ item: amulet.core.selection.shape.SelectionShape,
110
+ ) -> None: ...
111
+ def pop(self, index: typing.SupportsInt = -1) -> typing.Any: ...
112
+ def remove(self, value: amulet.core.selection.shape.SelectionShape) -> None: ...
113
+ def reverse(self) -> None: ...
114
+ def serialise(self) -> str: ...
115
+ def voxelise(self) -> amulet.core.selection.box_group.SelectionBoxGroup:
58
116
  """
59
- An iterator of the :class:`SelectionShape` instances stored for this group.
117
+ Convert the shapes to a SelectionBoxGroup.
60
118
  """
@@ -51,9 +51,9 @@ class VersionNumber:
51
51
 
52
52
  def __contains__(self, arg0: typing.SupportsInt) -> bool: ...
53
53
  @typing.overload
54
- def __eq__(self, arg0: VersionNumber) -> bool: ...
54
+ def __eq__(self, other: VersionNumber) -> bool: ...
55
55
  @typing.overload
56
- def __eq__(self, arg0: typing.Any) -> bool | types.NotImplementedType: ...
56
+ def __eq__(self, other: typing.Any) -> bool | types.NotImplementedType: ...
57
57
  def __ge__(self, arg0: VersionNumber) -> bool: ...
58
58
  @typing.overload
59
59
  def __getitem__(self, item: typing.SupportsInt) -> int: ...
@@ -94,9 +94,9 @@ class VersionRange:
94
94
 
95
95
  __hash__: typing.ClassVar[None] = None # type: ignore
96
96
  @typing.overload
97
- def __eq__(self, arg0: VersionRange) -> bool: ...
97
+ def __eq__(self, other: VersionRange) -> bool: ...
98
98
  @typing.overload
99
- def __eq__(self, arg0: typing.Any) -> bool | types.NotImplementedType: ...
99
+ def __eq__(self, other: typing.Any) -> bool | types.NotImplementedType: ...
100
100
  def __init__(
101
101
  self, platform: str, min_version: VersionNumber, max_version: VersionNumber
102
102
  ) -> None: ...
@@ -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,11 +13,11 @@ Description-Content-Type: text/markdown
13
13
  Requires-Dist: amulet-compiler-target==2.0
14
14
  Requires-Dist: amulet-compiler-version==4.1297307203.19
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.0.0
18
- Requires-Dist: amulet-utils~=1.1.3.0a0
19
- Requires-Dist: amulet-zlib~=1.0.8.0a1
20
- Requires-Dist: amulet-nbt~=5.0.2.0a0
18
+ Requires-Dist: amulet-utils~=1.1.3.0a1
19
+ Requires-Dist: amulet-zlib~=1.0.8.0a2
20
+ Requires-Dist: amulet-nbt~=5.0.2.0a1
21
21
  Requires-Dist: numpy~=2.0
22
22
  Provides-Extra: docs
23
23
  Requires-Dist: Sphinx>=1.7.4; extra == "docs"
@@ -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"
@@ -1,20 +1,20 @@
1
1
  amulet/core/__init__.py,sha256=3OSfdYsczg_YNIY2Vv_Rit2Ob61sNt3Bo9mE1Ixx8Sg,978
2
2
  amulet/core/__init__.pyi,sha256=qhxaM6yfnVWokiy9uzRktnKtWJYc2zy_gH3_rh4SxKI,456
3
- amulet/core/_amulet_core.cp312-win_amd64.pyd,sha256=WthPggCy0GEn_ZdE_VHWylzYZHSjT6XxFf8sUnm4gRc,740352
3
+ amulet/core/_amulet_core.cp312-win_amd64.pyd,sha256=Q3PF1SnKAjIwTBaOcT8UQj6-u8F7WibTLA-pCCkSCi8,795648
4
4
  amulet/core/_amulet_core.pyi,sha256=ysIiVDNTMxy3kdBKGkDXr0EDyhZqMITrH_ywsm0HAwM,134
5
- amulet/core/_version.py,sha256=gitjXhnLmSAv0b64-ZM_RMcVw3YOaqJO-XnILYXmx9c,520
6
- amulet/core/amulet_core.dll,sha256=tnH7ycINJJB6l7jBpJTxAU3qBROprvOQ73HSwMe6Pk0,185856
7
- amulet/core/amulet_core.lib,sha256=FPxmYGQKgQqBVRkbrPr8hcYVn9y-MkUwh2u27Nqska4,85958
5
+ amulet/core/_version.py,sha256=mETEQ4ANIIYXuyFSMhjSZwGmU0K2PsT92z1OcojPoxE,520
6
+ amulet/core/amulet_core.dll,sha256=3tFNQSxLh78s8FJxyzpexeDtW48skC9csGAx15rGGF0,221696
7
+ amulet/core/amulet_core.lib,sha256=oiaTgzWvQtrPfiFcz6zG6rH1Nz2kCjkpQAu71dbmoN0,98444
8
8
  amulet/core/amulet_coreConfig.cmake,sha256=iwFn1KmAr-rFh3jafs52FAnTArYjPEd2eVs0w2gidEA,987
9
9
  amulet/core/dll.hpp,sha256=pyhd9lh570R1Qi7TPPnKoiB-fAFmQan8Vnk-oZmuK70,586
10
10
  amulet/core/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
11
11
  amulet/core/__pyinstaller/__init__.py,sha256=vNM3T3GSrs58ywzILHdIsQP2sglKq6Jn4qwCGC3CZVQ,56
12
12
  amulet/core/__pyinstaller/hook-amulet.core.py,sha256=AmV845T4BRjex63_T_KCeKLUlV0DxEk6aWsUJaLqyGE,172
13
- amulet/core/biome/__init__.pyi,sha256=8G-i0vejK0EI3Xs_-pTi5xKpiNAD0eNodpPQY8Ux364,2168
13
+ amulet/core/biome/__init__.pyi,sha256=O3MhAFUQnHRmrM0LNrVZaH4GZGpu0cOqF9M05m1KJPI,2170
14
14
  amulet/core/biome/biome.hpp,sha256=6RftLCHa4jVLr3lmRU8RIuA4K5REU-1J8SmJts7Ty0Y,1539
15
- amulet/core/block/__init__.pyi,sha256=kbundB7zxYtjVFEKBXHDVU23hDAXvKMajVSHbia-h_k,9695
15
+ amulet/core/block/__init__.pyi,sha256=FiH9ZQpGuxa8B9TtdBsozs6NNDYt9jNhuChX1azmBpM,9696
16
16
  amulet/core/block/block.hpp,sha256=iRZyFKwfM7tbiXaHN6MNZeedpVr8SZkkKPPm20Tkgbo,4702
17
- amulet/core/block_entity/__init__.pyi,sha256=sGCIOOcB2Dgt_xpXZqgdHsOmvf5zyX4T4O63k384wrQ,2170
17
+ amulet/core/block_entity/__init__.pyi,sha256=QQ-3_RywLfvpEbN7SGgmTdVNwHb9xZxo56DMg01iEz8,2172
18
18
  amulet/core/block_entity/block_entity.hpp,sha256=q_8rzz4JCQ-L4q025G-ooQ2G47Hf6hyn3Wou4GZZ1Dc,2277
19
19
  amulet/core/chunk/__init__.pyi,sha256=35RyNsGhktLv6LfJkQRJ-OONR947y1HHac6D4NjaOGo,1957
20
20
  amulet/core/chunk/chunk.hpp,sha256=r3s5nPd60XwTyulG8xA7VdPH72OwDFwD-32faKp75ds,3915
@@ -24,31 +24,31 @@ amulet/core/chunk/component/block_component.hpp,sha256=JFk1O1IBWWX9-blvQN0Kv1xNU
24
24
  amulet/core/chunk/component/block_component.pyi,sha256=Yc2ACyeHLOacLqdpA9WyoWkgelLoJNhZa88d2rKSD60,895
25
25
  amulet/core/chunk/component/block_entity_component.hpp,sha256=wCv7Im03GqPoTLmtt0bmvxrS12kJN_qjzqONuRZ2YmE,3918
26
26
  amulet/core/chunk/component/section_array_map.hpp,sha256=V_WAG56rz3SAUWMMLgoPAhY3faH3t4Egg9_PsSERueE,3855
27
- amulet/core/chunk/component/section_array_map.pyi,sha256=QDFcv1qoGMIW7fJGUMOpD_Vozfw5-Z90jFo1dsyNY8M,3391
28
- amulet/core/entity/__init__.pyi,sha256=_eTAV48be_GwKcjuhRFxUBOrD6acomSpwpvKIUNS8qo,2674
27
+ amulet/core/chunk/component/section_array_map.pyi,sha256=H2pNAew6qkqKlWPvHW70jMHVIic9wqDT6GcsBuNpW-4,4072
28
+ amulet/core/entity/__init__.pyi,sha256=KGtjf-QjJijeutbvkhK7S4bwwjrelaUdrR2DqVaA6NI,2676
29
29
  amulet/core/entity/entity.hpp,sha256=02TsWsA2XNmULM92lx0Wby-exVur4Myncu_IY_a2KQ4,2911
30
30
  amulet/core/palette/__init__.pyi,sha256=NHmuFpb2lAK09E9cNb_w9udk0zPpHbg06MraZbEGKZ8,295
31
31
  amulet/core/palette/biome_palette.hpp,sha256=V4OWp4TpLu0rXnyFM-UyP5rFzWhmtqP5MWbDjQC0nX8,2033
32
- amulet/core/palette/biome_palette.pyi,sha256=W7VYudFz4Ji92BXmsACLhKP34LNXqhWsyXBXqYbYB-M,1766
32
+ amulet/core/palette/biome_palette.pyi,sha256=CTyougV7bGGSSZ-KLl2VUY2hRj9-QXK8qDILMsNPozc,1843
33
33
  amulet/core/palette/block_palette.hpp,sha256=e_LLR444vkbMO3KR5xhx0scIcgfd1HqEKyMiwqXqheY,2307
34
- amulet/core/palette/block_palette.pyi,sha256=dTNEQVRpqEA6dOJ0P1crvxhwr6-g3DuelAOninlTGV8,1909
34
+ amulet/core/palette/block_palette.pyi,sha256=Q5MN_9VdLVuiMGHwM0IX_Eu3CHl9SqlMgju2aNhOMTs,1975
35
35
  amulet/core/selection/__init__.pyi,sha256=CAgbMuQfTXdLZAin7QPJnrXnc1JLW5h3GO4BeUWsY5Q,744
36
36
  amulet/core/selection/box.hpp,sha256=eQXFQMmfS7g7qrelM7WtZ6lEhiS0Lll1J04U49-qhpk,3203
37
- amulet/core/selection/box.pyi,sha256=bFhdIXhI4Q0jnE0oRH_3bvZitlOAgz7EfbNzrGovb1o,7164
37
+ amulet/core/selection/box.pyi,sha256=RtHF0-4xUz7NzVx5gPqMvO-xtBb21zgDK_U_F0ZHcsM,7166
38
38
  amulet/core/selection/box_group.hpp,sha256=DHh2a08DCqJkNEdPq3BKeTAs_ORAqxJtxIAmWkFj2FQ,2261
39
- amulet/core/selection/box_group.pyi,sha256=UpUPyMBUBZMkEDuD1bNtrDLmUKLhAtQYPMFaycle4Q8,6601
40
- amulet/core/selection/cuboid.hpp,sha256=68Vtw4XG4lQDZ_yPwv2ywNuvnSXxzgP7zwTD-MPiT14,954
41
- amulet/core/selection/cuboid.pyi,sha256=Q2CclLsJY9YvmRMI3eydndlgyTSkUtsuTvJFZ6pqV08,1525
42
- amulet/core/selection/ellipsoid.hpp,sha256=dNEz7kAE2ui3NMAFDSVixLzqcThN_H2Zy8e4DTsCgK8,1051
43
- amulet/core/selection/ellipsoid.pyi,sha256=c-TbU5154JOKnsC3uvJ5YMyr4yrlrPzsHA-LvnE-ZRw,1456
44
- amulet/core/selection/shape.hpp,sha256=B6MD12LjQu9OYPNfh8ry-lcBF4AHZZXNNxWKtehqcC4,1298
45
- amulet/core/selection/shape.pyi,sha256=H47w08TQgYIlN1S6I7ikIa8BV6sOJ82tITPC0WmVXDc,1017
46
- amulet/core/selection/shape_group.hpp,sha256=qnfPm2dU5HYRWpECFf9SgqFWMC1Zk8L_9EgcSxuNHHU,1490
47
- amulet/core/selection/shape_group.pyi,sha256=hawsPEUwxswk_ug5F6v7IskKNRtTfhPBnb6bSNf1wFo,1527
48
- amulet/core/version/__init__.pyi,sha256=aSNxo_iQtG3eLHM0HmWedUptMaSFiOv_l8zxsyJLw-M,4275
39
+ amulet/core/selection/box_group.pyi,sha256=cx3L-bx_cGdoiEP67urXDWl8mAdmsE7z16zY18IFEpY,6788
40
+ amulet/core/selection/cuboid.hpp,sha256=dE9MD0dvtFzCTJeYz_bH2zQHnpEAtheZTATAtBQ7U2g,1137
41
+ amulet/core/selection/cuboid.pyi,sha256=v9-8G1XNqzREwVJBPSlD07IpntrS7EQwmWmP5ywgqYI,1561
42
+ amulet/core/selection/ellipsoid.hpp,sha256=yyaun4O9cTq0j2cRA9vmDPWME3snFL4flGPlK33ykcw,1240
43
+ amulet/core/selection/ellipsoid.pyi,sha256=UBXhS4o7-B6QVRTaYYhRUMNvzXcULTsfd4BTEk194l0,1492
44
+ amulet/core/selection/shape.hpp,sha256=f1LcDYm37EC4QUUbh1E68OEi-sApwhb5348whJsaTjI,2020
45
+ amulet/core/selection/shape.pyi,sha256=laitz9y2Gb2JFYkiVak5Sy-01ePUJbbPDcA4sEHMQZE,1547
46
+ amulet/core/selection/shape_group.hpp,sha256=Cn1Wo4bHLjcVcqo9IF8jdMaH9LSCx4Jv6SRPoFH65Ro,1858
47
+ amulet/core/selection/shape_group.pyi,sha256=Ik1sWCC0vJ8MHGJmvPiXtQEZkU2HVCFeb_7Q4lGycTE,3927
48
+ amulet/core/version/__init__.pyi,sha256=yBPn3RivWayjrFGm9WhuIgjt0Aro6ubWAUBcb-ZUwZ0,4279
49
49
  amulet/core/version/version.hpp,sha256=yVc_uhBgmHQ0Evo73rXXoRwSQMHakUQxSYR3_fu2KH4,6506
50
- amulet_core-2.0.5a0.dist-info/METADATA,sha256=00v8hAtrJ3rMo3cfy1E2IXWjLyJqfKo6eCC7VqTF74Y,5089
51
- amulet_core-2.0.5a0.dist-info/WHEEL,sha256=8UP9x9puWI0P1V_d7K2oMTBqfeLNm21CTzZ_Ptr0NXU,101
52
- amulet_core-2.0.5a0.dist-info/entry_points.txt,sha256=a64mqk_dgbzVyk-pz0WKpK6kNAhIGdVT9DO2VqDIAc8,68
53
- amulet_core-2.0.5a0.dist-info/top_level.txt,sha256=3ZqHzNDiIb9kV8TwSeeXxK_9haSrsu631Qe4ndDo0rc,7
54
- amulet_core-2.0.5a0.dist-info/RECORD,,
50
+ amulet_core-2.0.5a1.dist-info/METADATA,sha256=2YgrjPzDCZRNuATe0fEXZuJ0O2ZJIf4OUXyRSRszOgw,5025
51
+ amulet_core-2.0.5a1.dist-info/WHEEL,sha256=8UP9x9puWI0P1V_d7K2oMTBqfeLNm21CTzZ_Ptr0NXU,101
52
+ amulet_core-2.0.5a1.dist-info/entry_points.txt,sha256=a64mqk_dgbzVyk-pz0WKpK6kNAhIGdVT9DO2VqDIAc8,68
53
+ amulet_core-2.0.5a1.dist-info/top_level.txt,sha256=3ZqHzNDiIb9kV8TwSeeXxK_9haSrsu631Qe4ndDo0rc,7
54
+ amulet_core-2.0.5a1.dist-info/RECORD,,