amulet-core 2.0.3a2__tar.gz → 2.0.4a0__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 (85) hide show
  1. {amulet_core-2.0.3a2 → amulet_core-2.0.4a0}/CMakeLists.txt +14 -4
  2. {amulet_core-2.0.3a2/src/amulet_core.egg-info → amulet_core-2.0.4a0}/PKG-INFO +4 -4
  3. {amulet_core-2.0.3a2 → amulet_core-2.0.4a0}/requirements.py +3 -3
  4. amulet_core-2.0.4a0/src/amulet/core/__init__.pyi +31 -0
  5. {amulet_core-2.0.3a2 → amulet_core-2.0.4a0}/src/amulet/core/_version.py +3 -3
  6. {amulet_core-2.0.3a2 → amulet_core-2.0.4a0}/src/amulet/core/biome/biome.cpp +1 -1
  7. {amulet_core-2.0.3a2 → amulet_core-2.0.4a0}/src/amulet/core/block/__init__.pyi +6 -3
  8. {amulet_core-2.0.3a2 → amulet_core-2.0.4a0}/src/amulet/core/block/block.py.cpp +9 -0
  9. amulet_core-2.0.4a0/src/amulet/core/block_entity/block_entity.cpp +51 -0
  10. {amulet_core-2.0.3a2 → amulet_core-2.0.4a0}/src/amulet/core/chunk/component/biome_3d_component.cpp +31 -3
  11. {amulet_core-2.0.3a2 → amulet_core-2.0.4a0}/src/amulet/core/chunk/component/biome_3d_component.hpp +3 -0
  12. {amulet_core-2.0.3a2 → amulet_core-2.0.4a0}/src/amulet/core/chunk/component/block_component.pyi +1 -1
  13. {amulet_core-2.0.3a2 → amulet_core-2.0.4a0}/src/amulet/core/chunk/component/block_entity_component.cpp +38 -4
  14. {amulet_core-2.0.3a2 → amulet_core-2.0.4a0}/src/amulet/core/chunk/component/section_array_map.py.cpp +9 -0
  15. {amulet_core-2.0.3a2 → amulet_core-2.0.4a0}/src/amulet/core/chunk/component/section_array_map.pyi +38 -15
  16. {amulet_core-2.0.3a2 → amulet_core-2.0.4a0}/src/amulet/core/entity/__init__.pyi +6 -6
  17. amulet_core-2.0.4a0/src/amulet/core/entity/entity.cpp +64 -0
  18. {amulet_core-2.0.3a2 → amulet_core-2.0.4a0}/src/amulet/core/palette/biome_palette.pyi +7 -4
  19. {amulet_core-2.0.3a2 → amulet_core-2.0.4a0}/src/amulet/core/palette/block_palette.pyi +9 -4
  20. {amulet_core-2.0.3a2 → amulet_core-2.0.4a0}/src/amulet/core/selection/box.pyi +19 -5
  21. {amulet_core-2.0.3a2 → amulet_core-2.0.4a0}/src/amulet/core/selection/group.pyi +13 -5
  22. {amulet_core-2.0.3a2 → amulet_core-2.0.4a0}/src/amulet/core/version/__init__.pyi +10 -6
  23. {amulet_core-2.0.3a2 → amulet_core-2.0.4a0}/src/amulet/core/version/version.cpp +4 -4
  24. {amulet_core-2.0.3a2 → amulet_core-2.0.4a0/src/amulet_core.egg-info}/PKG-INFO +4 -4
  25. {amulet_core-2.0.3a2 → amulet_core-2.0.4a0}/src/amulet_core.egg-info/SOURCES.txt +1 -0
  26. {amulet_core-2.0.3a2 → amulet_core-2.0.4a0}/src/amulet_core.egg-info/requires.txt +3 -3
  27. amulet_core-2.0.3a2/src/amulet/core/block_entity/block_entity.cpp +0 -26
  28. amulet_core-2.0.3a2/src/amulet/core/entity/entity.cpp +0 -29
  29. {amulet_core-2.0.3a2 → amulet_core-2.0.4a0}/MANIFEST.in +0 -0
  30. {amulet_core-2.0.3a2 → amulet_core-2.0.4a0}/README.md +0 -0
  31. {amulet_core-2.0.3a2 → amulet_core-2.0.4a0}/build_requires.py +0 -0
  32. {amulet_core-2.0.3a2 → amulet_core-2.0.4a0}/get_compiler/CMakeLists.txt +0 -0
  33. {amulet_core-2.0.3a2 → amulet_core-2.0.4a0}/get_compiler/__init__.py +0 -0
  34. {amulet_core-2.0.3a2 → amulet_core-2.0.4a0}/pyproject.toml +0 -0
  35. {amulet_core-2.0.3a2 → amulet_core-2.0.4a0}/setup.cfg +0 -0
  36. {amulet_core-2.0.3a2 → amulet_core-2.0.4a0}/setup.py +0 -0
  37. {amulet_core-2.0.3a2 → amulet_core-2.0.4a0}/src/amulet/core/__init__.py +0 -0
  38. {amulet_core-2.0.3a2 → amulet_core-2.0.4a0}/src/amulet/core/__pyinstaller/__init__.py +0 -0
  39. {amulet_core-2.0.3a2 → amulet_core-2.0.4a0}/src/amulet/core/__pyinstaller/hook-amulet.core.py +0 -0
  40. {amulet_core-2.0.3a2 → amulet_core-2.0.4a0}/src/amulet/core/_amulet_core.py.cpp +0 -0
  41. {amulet_core-2.0.3a2 → amulet_core-2.0.4a0}/src/amulet/core/_amulet_core.pyi +0 -0
  42. {amulet_core-2.0.3a2 → amulet_core-2.0.4a0}/src/amulet/core/amulet_coreConfig.cmake +0 -0
  43. {amulet_core-2.0.3a2 → amulet_core-2.0.4a0}/src/amulet/core/biome/__init__.pyi +0 -0
  44. {amulet_core-2.0.3a2 → amulet_core-2.0.4a0}/src/amulet/core/biome/biome.hpp +0 -0
  45. {amulet_core-2.0.3a2 → amulet_core-2.0.4a0}/src/amulet/core/biome/biome.py.cpp +0 -0
  46. {amulet_core-2.0.3a2 → amulet_core-2.0.4a0}/src/amulet/core/block/block.cpp +0 -0
  47. {amulet_core-2.0.3a2 → amulet_core-2.0.4a0}/src/amulet/core/block/block.hpp +0 -0
  48. {amulet_core-2.0.3a2 → amulet_core-2.0.4a0}/src/amulet/core/block_entity/__init__.pyi +0 -0
  49. {amulet_core-2.0.3a2 → amulet_core-2.0.4a0}/src/amulet/core/block_entity/block_entity.hpp +0 -0
  50. {amulet_core-2.0.3a2 → amulet_core-2.0.4a0}/src/amulet/core/block_entity/block_entity.py.cpp +0 -0
  51. {amulet_core-2.0.3a2 → amulet_core-2.0.4a0}/src/amulet/core/chunk/__init__.pyi +0 -0
  52. {amulet_core-2.0.3a2 → amulet_core-2.0.4a0}/src/amulet/core/chunk/chunk.cpp +0 -0
  53. {amulet_core-2.0.3a2 → amulet_core-2.0.4a0}/src/amulet/core/chunk/chunk.hpp +0 -0
  54. {amulet_core-2.0.3a2 → amulet_core-2.0.4a0}/src/amulet/core/chunk/chunk.py.cpp +0 -0
  55. {amulet_core-2.0.3a2 → amulet_core-2.0.4a0}/src/amulet/core/chunk/component/__init__.pyi +0 -0
  56. {amulet_core-2.0.3a2 → amulet_core-2.0.4a0}/src/amulet/core/chunk/component/__init_chunk_components.py.cpp +0 -0
  57. {amulet_core-2.0.3a2 → amulet_core-2.0.4a0}/src/amulet/core/chunk/component/block_component.cpp +0 -0
  58. {amulet_core-2.0.3a2 → amulet_core-2.0.4a0}/src/amulet/core/chunk/component/block_component.hpp +0 -0
  59. {amulet_core-2.0.3a2 → amulet_core-2.0.4a0}/src/amulet/core/chunk/component/block_component.py.cpp +0 -0
  60. {amulet_core-2.0.3a2 → amulet_core-2.0.4a0}/src/amulet/core/chunk/component/block_entity_component.hpp +0 -0
  61. {amulet_core-2.0.3a2 → amulet_core-2.0.4a0}/src/amulet/core/chunk/component/section_array_map.cpp +0 -0
  62. {amulet_core-2.0.3a2 → amulet_core-2.0.4a0}/src/amulet/core/chunk/component/section_array_map.hpp +0 -0
  63. {amulet_core-2.0.3a2 → amulet_core-2.0.4a0}/src/amulet/core/dll.hpp +0 -0
  64. {amulet_core-2.0.3a2 → amulet_core-2.0.4a0}/src/amulet/core/entity/entity.hpp +0 -0
  65. {amulet_core-2.0.3a2 → amulet_core-2.0.4a0}/src/amulet/core/entity/entity.py.cpp +0 -0
  66. {amulet_core-2.0.3a2 → amulet_core-2.0.4a0}/src/amulet/core/palette/__init__.pyi +0 -0
  67. {amulet_core-2.0.3a2 → amulet_core-2.0.4a0}/src/amulet/core/palette/__init_palette.py.cpp +0 -0
  68. {amulet_core-2.0.3a2 → amulet_core-2.0.4a0}/src/amulet/core/palette/biome_palette.cpp +0 -0
  69. {amulet_core-2.0.3a2 → amulet_core-2.0.4a0}/src/amulet/core/palette/biome_palette.hpp +0 -0
  70. {amulet_core-2.0.3a2 → amulet_core-2.0.4a0}/src/amulet/core/palette/biome_palette.py.cpp +0 -0
  71. {amulet_core-2.0.3a2 → amulet_core-2.0.4a0}/src/amulet/core/palette/block_palette.cpp +0 -0
  72. {amulet_core-2.0.3a2 → amulet_core-2.0.4a0}/src/amulet/core/palette/block_palette.hpp +0 -0
  73. {amulet_core-2.0.3a2 → amulet_core-2.0.4a0}/src/amulet/core/palette/block_palette.py.cpp +0 -0
  74. {amulet_core-2.0.3a2 → amulet_core-2.0.4a0}/src/amulet/core/py.typed +0 -0
  75. {amulet_core-2.0.3a2 → amulet_core-2.0.4a0}/src/amulet/core/selection/__init__.pyi +0 -0
  76. {amulet_core-2.0.3a2 → amulet_core-2.0.4a0}/src/amulet/core/selection/__init_selection.py.cpp +0 -0
  77. {amulet_core-2.0.3a2 → amulet_core-2.0.4a0}/src/amulet/core/selection/box.cpp +0 -0
  78. {amulet_core-2.0.3a2 → amulet_core-2.0.4a0}/src/amulet/core/selection/box.hpp +0 -0
  79. {amulet_core-2.0.3a2 → amulet_core-2.0.4a0}/src/amulet/core/selection/group.cpp +0 -0
  80. {amulet_core-2.0.3a2 → amulet_core-2.0.4a0}/src/amulet/core/selection/group.hpp +0 -0
  81. {amulet_core-2.0.3a2 → amulet_core-2.0.4a0}/src/amulet/core/version/version.hpp +0 -0
  82. {amulet_core-2.0.3a2 → amulet_core-2.0.4a0}/src/amulet/core/version/version.py.cpp +0 -0
  83. {amulet_core-2.0.3a2 → amulet_core-2.0.4a0}/src/amulet_core.egg-info/dependency_links.txt +0 -0
  84. {amulet_core-2.0.3a2 → amulet_core-2.0.4a0}/src/amulet_core.egg-info/entry_points.txt +0 -0
  85. {amulet_core-2.0.3a2 → amulet_core-2.0.4a0}/src/amulet_core.egg-info/top_level.txt +0 -0
@@ -2,6 +2,8 @@ cmake_minimum_required(VERSION 3.13)
2
2
 
3
3
  project(amulet_core LANGUAGES CXX)
4
4
 
5
+ set(amulet_core_DIR ${CMAKE_CURRENT_LIST_DIR}/src/amulet/core CACHE PATH "")
6
+
5
7
  # Set C++20
6
8
  set(CMAKE_CXX_STANDARD 20)
7
9
  set(CMAKE_CXX_STANDARD_REQUIRED ON)
@@ -22,10 +24,18 @@ if (MSVC)
22
24
  endif()
23
25
 
24
26
  # Find libraries
25
- find_package(pybind11 CONFIG REQUIRED)
26
- find_package(amulet_pybind11_extensions CONFIG REQUIRED)
27
- find_package(amulet_io CONFIG REQUIRED)
28
- find_package(amulet_nbt CONFIG REQUIRED)
27
+ if (NOT TARGET pybind11::module)
28
+ find_package(pybind11 CONFIG REQUIRED)
29
+ endif()
30
+ if (NOT TARGET amulet_pybind11_extensions)
31
+ find_package(amulet_pybind11_extensions CONFIG REQUIRED)
32
+ endif()
33
+ if (NOT TARGET amulet_io)
34
+ find_package(amulet_io CONFIG REQUIRED)
35
+ endif()
36
+ if (NOT TARGET amulet_nbt)
37
+ find_package(amulet_nbt CONFIG REQUIRED)
38
+ endif()
29
39
 
30
40
  # Find C++ files
31
41
  file(REAL_PATH src SOURCE_PATH)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: amulet-core
3
- Version: 2.0.3a2
3
+ Version: 2.0.4a0
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
@@ -12,11 +12,11 @@ Requires-Python: >=3.11
12
12
  Description-Content-Type: text/markdown
13
13
  Requires-Dist: amulet-compiler-target==2.0
14
14
  Requires-Dist: amulet-compiler-version==3.0.0
15
- Requires-Dist: pybind11==2.13.6
15
+ Requires-Dist: pybind11==3.0.0
16
16
  Requires-Dist: amulet-pybind11-extensions~=1.1.0.0a0
17
17
  Requires-Dist: amulet-io~=1.0
18
- Requires-Dist: amulet-zlib~=1.0.0.0a7
19
- Requires-Dist: amulet-nbt~=5.0.0.0a7
18
+ Requires-Dist: amulet-zlib~=1.0.1.0a0
19
+ Requires-Dist: amulet-nbt~=5.0.1.0a0
20
20
  Requires-Dist: numpy~=2.0
21
21
  Provides-Extra: docs
22
22
  Requires-Dist: Sphinx>=1.7.4; extra == "docs"
@@ -4,11 +4,11 @@ from packaging.version import Version
4
4
  AMULET_COMPILER_TARGET_REQUIREMENT = "==2.0"
5
5
  AMULET_COMPILER_VERSION_REQUIREMENT = "==3.0.0"
6
6
 
7
- PYBIND11_REQUIREMENT = "==2.13.6"
7
+ PYBIND11_REQUIREMENT = "==3.0.0"
8
8
  AMULET_PYBIND11_EXTENSIONS_REQUIREMENT = "~=1.1.0.0a0"
9
9
  AMULET_IO_REQUIREMENT = "~=1.0"
10
- AMULET_ZLIB_REQUIREMENT = "~=1.0.0.0a7"
11
- AMULET_NBT_REQUIREMENT = "~=5.0.0.0a7"
10
+ AMULET_ZLIB_REQUIREMENT = "~=1.0.1.0a0"
11
+ AMULET_NBT_REQUIREMENT = "~=5.0.1.0a0"
12
12
  NUMPY_REQUIREMENT = "~=2.0"
13
13
 
14
14
  if os.environ.get("AMULET_PYBIND11_EXTENSIONS_REQUIREMENT", None):
@@ -0,0 +1,31 @@
1
+ from __future__ import annotations
2
+
3
+ from . import (
4
+ _amulet_core,
5
+ _version,
6
+ biome,
7
+ block,
8
+ block_entity,
9
+ chunk,
10
+ entity,
11
+ palette,
12
+ selection,
13
+ version,
14
+ )
15
+
16
+ __all__ = [
17
+ "biome",
18
+ "block",
19
+ "block_entity",
20
+ "chunk",
21
+ "compiler_config",
22
+ "entity",
23
+ "palette",
24
+ "selection",
25
+ "version",
26
+ ]
27
+
28
+ def _init() -> None: ...
29
+
30
+ __version__: str
31
+ compiler_config: dict
@@ -8,11 +8,11 @@ import json
8
8
 
9
9
  version_json = '''
10
10
  {
11
- "date": "2025-06-27T16:04:02+0100",
11
+ "date": "2025-07-28T11:25:11+0100",
12
12
  "dirty": false,
13
13
  "error": null,
14
- "full-revisionid": "e066fffa9dd7f65769e62a638a8b55659eae70d0",
15
- "version": "2.0.3a2"
14
+ "full-revisionid": "dc592d63267cf51ecdff3972fd21b2fa4711de47",
15
+ "version": "2.0.4a0"
16
16
  }
17
17
  ''' # END VERSION_JSON
18
18
 
@@ -34,7 +34,7 @@ Biome Biome::deserialise(BinaryReader& reader)
34
34
  return { platform, version, namespace_, base_name };
35
35
  }
36
36
  default:
37
- throw std::invalid_argument("Unsupported version " + std::to_string(version_number));
37
+ throw std::invalid_argument("Unsupported Biome version " + std::to_string(version_number));
38
38
  }
39
39
  }
40
40
 
@@ -89,7 +89,7 @@ class Block(amulet.core.version.PlatformVersionContainer):
89
89
  version: amulet.core.version.VersionNumber,
90
90
  namespace: str,
91
91
  base_name: str,
92
- properties: dict[
92
+ properties: collections.abc.Mapping[
93
93
  str,
94
94
  amulet.nbt.ByteTag
95
95
  | amulet.nbt.ShortTag
@@ -223,7 +223,7 @@ class BlockStack:
223
223
  def __eq__(self, arg0: typing.Any) -> bool | types.NotImplementedType: ...
224
224
  def __ge__(self, arg0: BlockStack) -> bool: ...
225
225
  @typing.overload
226
- def __getitem__(self, arg0: int) -> Block: ...
226
+ def __getitem__(self, arg0: typing.SupportsInt) -> Block: ...
227
227
  @typing.overload
228
228
  def __getitem__(self, arg0: slice) -> list: ...
229
229
  def __gt__(self, arg0: BlockStack) -> bool: ...
@@ -237,7 +237,10 @@ class BlockStack:
237
237
  def __reversed__(self) -> collections.abc.Iterator[Block]: ...
238
238
  def count(self, value: typing.Any) -> int: ...
239
239
  def index(
240
- self, value: typing.Any, start: int = 0, stop: int = 9223372036854775807
240
+ self,
241
+ value: typing.Any,
242
+ start: typing.SupportsInt = 0,
243
+ stop: typing.SupportsInt = 9223372036854775807,
241
244
  ) -> int: ...
242
245
  @property
243
246
  def base_block(self) -> Block:
@@ -291,6 +291,15 @@ void init_block(py::module m_parent)
291
291
  py::tuple(py::cast(self.get_blocks())));
292
292
  });
293
293
 
294
+ BlockStack.def(
295
+ py::pickle(
296
+ [](const Amulet::BlockStack& self) -> py::bytes {
297
+ return py::bytes(Amulet::serialise(self));
298
+ },
299
+ [](py::bytes state) {
300
+ return Amulet::deserialise<Amulet::BlockStack>(state.cast<std::string>());
301
+ }));
302
+
294
303
  pyext::collections::def_Sequence_getitem_slice(BlockStack);
295
304
  pyext::collections::def_Sequence_contains(BlockStack);
296
305
  pyext::collections::def_Sequence_iter<Amulet::Block>(BlockStack);
@@ -0,0 +1,51 @@
1
+ #include <amulet/nbt/nbt_encoding/binary.hpp>
2
+
3
+ #include <amulet/core/dll.hpp>
4
+
5
+ #include "block_entity.hpp"
6
+
7
+ namespace Amulet {
8
+
9
+ void BlockEntity::serialise(BinaryWriter& writer) const
10
+ {
11
+ writer.write_numeric<std::uint8_t>(1);
12
+ writer.write_size_and_bytes(get_platform());
13
+ get_version().serialise(writer);
14
+ writer.write_size_and_bytes(_namespace);
15
+ writer.write_size_and_bytes(_base_name);
16
+ Amulet::NBT::encode_nbt(writer, *_nbt);
17
+ }
18
+
19
+ BlockEntity BlockEntity::deserialise(BinaryReader& reader)
20
+ {
21
+ auto version_number = reader.read_numeric<std::uint8_t>();
22
+ switch (version_number) {
23
+ case 1: {
24
+ std::string platform { reader.read_size_and_bytes() };
25
+ VersionNumber version = VersionNumber::deserialise(reader);
26
+ std::string namespace_ { reader.read_size_and_bytes() };
27
+ std::string base_name { reader.read_size_and_bytes() };
28
+ auto named_tag = std::make_shared<Amulet::NBT::NamedTag>(Amulet::NBT::decode_nbt(reader));
29
+ return BlockEntity {
30
+ std::move(platform),
31
+ std::move(version),
32
+ std::move(namespace_),
33
+ std::move(base_name),
34
+ std::move(named_tag)
35
+ };
36
+ }
37
+ default:
38
+ throw std::invalid_argument("Unsupported BlockEntity version " + std::to_string(version_number));
39
+ }
40
+ }
41
+
42
+ bool BlockEntity::operator==(const BlockEntity& other) const
43
+ {
44
+ return (
45
+ PlatformVersionContainer::operator==(other)
46
+ && _namespace == other._namespace
47
+ && _base_name == other._base_name
48
+ && Amulet::NBT::NBTTag_eq(*_nbt, *other._nbt));
49
+ }
50
+
51
+ }
@@ -6,14 +6,42 @@ namespace Amulet {
6
6
 
7
7
  // Biome3DComponent
8
8
 
9
+ void Biome3DComponentData::serialise(BinaryWriter& writer) const
10
+ {
11
+ writer.write_numeric<std::uint8_t>(1);
12
+ _palette->serialise(writer);
13
+ _sections->serialise(writer);
14
+ }
15
+ Biome3DComponentData Biome3DComponentData::deserialise(BinaryReader& reader)
16
+ {
17
+ auto version_number = reader.read_numeric<std::uint8_t>();
18
+ switch (version_number) {
19
+ case 1: {
20
+ auto palette = std::make_shared<BiomePalette>(BiomePalette::deserialise(reader));
21
+ auto sections = std::make_shared<SectionArrayMap>(SectionArrayMap::deserialise(reader));
22
+ return Biome3DComponentData { std::move(palette), std::move(sections) };
23
+ }
24
+ default:
25
+ throw std::invalid_argument("Unsupported Biome3DComponentData version " + std::to_string(version_number));
26
+ }
27
+ }
28
+
9
29
  std::optional<std::string> Biome3DComponent::serialise() const
10
30
  {
11
- throw std::runtime_error("NotImplementedError");
31
+ if (_value) {
32
+ return Amulet::serialise(**_value);
33
+ } else {
34
+ return std::nullopt;
35
+ }
12
36
  }
13
37
  // Deserialise the component
14
- void Biome3DComponent::deserialise(std::optional<std::string>)
38
+ void Biome3DComponent::deserialise(std::optional<std::string> data)
15
39
  {
16
- throw std::runtime_error("NotImplementedError");
40
+ if (data) {
41
+ _value = std::make_shared<Biome3DComponentData>(Amulet::deserialise<Biome3DComponentData>(*data));
42
+ } else {
43
+ _value = std::nullopt;
44
+ }
17
45
  }
18
46
 
19
47
  const std::string Biome3DComponent::ComponentID = "Amulet::Biome3DComponent";
@@ -59,6 +59,9 @@ public:
59
59
  std::shared_ptr<BiomePalette> get_palette_ptr() { return _palette; }
60
60
  SectionArrayMap& get_sections() { return *_sections; }
61
61
  std::shared_ptr<SectionArrayMap> get_sections_ptr() { return _sections; }
62
+
63
+ AMULET_CORE_EXPORT void serialise(BinaryWriter&) const;
64
+ AMULET_CORE_EXPORT static Biome3DComponentData deserialise(BinaryReader&);
62
65
  };
63
66
 
64
67
  class Biome3DComponent {
@@ -17,7 +17,7 @@ class BlockComponentData:
17
17
  def __init__(
18
18
  self,
19
19
  version_range: amulet.core.version.VersionRange,
20
- array_shape: tuple[int, int, int],
20
+ array_shape: tuple[typing.SupportsInt, typing.SupportsInt, typing.SupportsInt],
21
21
  default_block: amulet.core.block.BlockStack,
22
22
  ) -> None: ...
23
23
  @property
@@ -6,13 +6,47 @@ namespace Amulet {
6
6
 
7
7
  // BlockEntityComponentData
8
8
 
9
- void BlockEntityComponentData::serialise(BinaryWriter&) const
9
+ void BlockEntityComponentData::serialise(BinaryWriter& writer) const
10
10
  {
11
- throw std::runtime_error("NotImplementedError");
11
+ writer.write_numeric<std::uint8_t>(1);
12
+ get_version_range().serialise(writer);
13
+ writer.write_numeric<std::uint16_t>(get_x_size());
14
+ writer.write_numeric<std::uint16_t>(get_z_size());
15
+
16
+ writer.write_numeric<std::uint64_t>(get_block_entities().size());
17
+ for (const auto& [coord, block_entity] : get_block_entities()) {
18
+ writer.write_numeric<std::uint16_t>(std::get<0>(coord));
19
+ writer.write_numeric<std::int64_t>(std::get<1>(coord));
20
+ writer.write_numeric<std::uint16_t>(std::get<2>(coord));
21
+ block_entity->serialise(writer);
22
+ }
12
23
  }
13
- BlockEntityComponentData BlockEntityComponentData::deserialise(BinaryReader&)
24
+ BlockEntityComponentData BlockEntityComponentData::deserialise(BinaryReader& reader)
14
25
  {
15
- throw std::runtime_error("NotImplementedError");
26
+ auto version_number = reader.read_numeric<std::uint8_t>();
27
+ switch (version_number) {
28
+ case 1: {
29
+ auto version_range = VersionRange::deserialise(reader);
30
+ auto x_size = reader.read_numeric<std::uint16_t>();
31
+ auto z_size = reader.read_numeric<std::uint16_t>();
32
+ BlockEntityComponentData block_entities {
33
+ std::move(version_range),
34
+ x_size,
35
+ z_size
36
+ };
37
+ auto block_entity_count = reader.read_numeric<std::uint64_t>();
38
+ for (std::uint16_t i = 0; i < block_entity_count; i++) {
39
+ auto dx = reader.read_numeric<std::uint16_t>();
40
+ auto y = reader.read_numeric<std::int64_t>();
41
+ auto dz = reader.read_numeric<std::uint16_t>();
42
+ auto block_entity = std::make_shared<BlockEntity>(BlockEntity::deserialise(reader));
43
+ block_entities.set({ dx, y, dz }, std::move(block_entity));
44
+ }
45
+ return block_entities;
46
+ }
47
+ default:
48
+ throw std::invalid_argument("Unsupported BlockEntityComponentData version " + std::to_string(version_number));
49
+ }
16
50
  }
17
51
 
18
52
  // BlockEntityComponent
@@ -233,5 +233,14 @@ py::module init_section_array_map(py::module m_parent)
233
233
  pyext::collections::def_MutableMapping_setdefault<std::int64_t, pyext::numpy::array_t<std::uint32_t>>(SectionArrayMap);
234
234
  pyext::collections::register_MutableMapping(SectionArrayMap);
235
235
 
236
+ SectionArrayMap.def(
237
+ py::pickle(
238
+ [](const Amulet::SectionArrayMap& self) -> py::bytes {
239
+ return py::bytes(Amulet::serialise(self));
240
+ },
241
+ [](py::bytes state) {
242
+ return Amulet::deserialise<Amulet::SectionArrayMap>(state.cast<std::string>());
243
+ }));
244
+
236
245
  return m;
237
246
  }
@@ -6,7 +6,6 @@ import typing
6
6
 
7
7
  import numpy
8
8
  import numpy.typing
9
- import typing_extensions
10
9
 
11
10
  __all__ = ["IndexArray3D", "SectionArrayMap"]
12
11
 
@@ -16,13 +15,19 @@ class IndexArray3D:
16
15
  """
17
16
 
18
17
  @typing.overload
19
- def __init__(self, shape: tuple[int, int, int]) -> None: ...
18
+ def __init__(
19
+ self, shape: tuple[typing.SupportsInt, typing.SupportsInt, typing.SupportsInt]
20
+ ) -> None: ...
20
21
  @typing.overload
21
- def __init__(self, shape: tuple[int, int, int], value: int) -> None: ...
22
+ def __init__(
23
+ self,
24
+ shape: tuple[typing.SupportsInt, typing.SupportsInt, typing.SupportsInt],
25
+ value: typing.SupportsInt,
26
+ ) -> None: ...
22
27
  @typing.overload
23
28
  def __init__(self, other: IndexArray3D) -> None: ...
24
29
  @typing.overload
25
- def __init__(self, arg0: typing_extensions.Buffer) -> None: ...
30
+ def __init__(self, arg0: collections.abc.Buffer) -> None: ...
26
31
  @property
27
32
  def shape(self) -> tuple[int, int, int]: ...
28
33
  @property
@@ -33,35 +38,48 @@ class SectionArrayMap:
33
38
  A container of sub-chunk arrays.
34
39
  """
35
40
 
36
- def __contains__(self, arg0: int) -> bool: ...
37
- def __delitem__(self, arg0: int) -> None: ...
41
+ def __contains__(self, arg0: typing.SupportsInt) -> bool: ...
42
+ def __delitem__(self, arg0: typing.SupportsInt) -> None: ...
38
43
  def __eq__(self, arg0: typing.Any) -> bool | types.NotImplementedType: ...
39
- def __getitem__(self, arg0: int) -> numpy.typing.NDArray[numpy.uint32]: ...
44
+ def __getitem__(
45
+ self, arg0: typing.SupportsInt
46
+ ) -> numpy.typing.NDArray[numpy.uint32]: ...
40
47
  def __hash__(self) -> int: ...
41
48
  def __init__(
42
49
  self,
43
- array_shape: tuple[int, int, int],
44
- default_array: int | IndexArray3D | typing_extensions.Buffer,
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
+ ),
45
56
  ) -> None: ...
46
57
  def __iter__(self) -> collections.abc.Iterator[int]: ...
47
58
  def __len__(self) -> int: ...
48
59
  def __setitem__(
49
- self, arg0: int, arg1: IndexArray3D | typing_extensions.Buffer
60
+ self,
61
+ arg0: typing.SupportsInt,
62
+ arg1: (
63
+ amulet.core.chunk.component.section_array_map.IndexArray3D
64
+ | collections.abc.Buffer
65
+ ),
50
66
  ) -> None: ...
51
67
  def get(
52
- self, key: int, default: numpy.typing.NDArray[numpy.uint32] | None = None
68
+ self,
69
+ key: typing.SupportsInt,
70
+ default: numpy.typing.NDArray[numpy.uint32] | None = None,
53
71
  ) -> numpy.typing.NDArray[numpy.uint32] | None: ...
54
72
  def items(
55
73
  self,
56
74
  ) -> collections.abc.ItemsView[int, numpy.typing.NDArray[numpy.uint32]]: ...
57
75
  def keys(self) -> collections.abc.KeysView[int]: ...
58
76
  def pop(
59
- self, key: int, default: numpy.typing.NDArray[numpy.uint32] = ...
77
+ self, key: typing.SupportsInt, default: numpy.typing.NDArray[numpy.uint32] = ...
60
78
  ) -> numpy.typing.NDArray[numpy.uint32]: ...
61
79
  def popitem(self) -> tuple[int, numpy.typing.NDArray[numpy.uint32]]: ...
62
- def populate(self, arg0: int) -> None: ...
80
+ def populate(self, arg0: typing.SupportsInt) -> None: ...
63
81
  def setdefault(
64
- self, arg0: int, arg1: numpy.typing.NDArray[numpy.uint32] | None
82
+ self, arg0: typing.SupportsInt, arg1: numpy.typing.NDArray[numpy.uint32] | None
65
83
  ) -> numpy.typing.NDArray[numpy.uint32] | None: ...
66
84
  def update(self, other: typing.Any = (), **kwargs: typing.Any) -> None: ...
67
85
  def values(
@@ -73,5 +91,10 @@ class SectionArrayMap:
73
91
  def default_array(self) -> int | numpy.ndarray: ...
74
92
  @default_array.setter
75
93
  def default_array(
76
- self, arg1: int | IndexArray3D | typing_extensions.Buffer
94
+ self,
95
+ arg1: (
96
+ typing.SupportsInt
97
+ | amulet.core.chunk.component.section_array_map.IndexArray3D
98
+ | collections.abc.Buffer
99
+ ),
77
100
  ) -> None: ...
@@ -24,9 +24,9 @@ class Entity(amulet.core.version.PlatformVersionContainer):
24
24
  version: amulet.core.version.VersionNumber,
25
25
  namespace: str,
26
26
  base_name: str,
27
- x: float,
28
- y: float,
29
- z: float,
27
+ x: typing.SupportsFloat,
28
+ y: typing.SupportsFloat,
29
+ z: typing.SupportsFloat,
30
30
  nbt: amulet.nbt.NamedTag,
31
31
  ) -> None: ...
32
32
  def __repr__(self) -> str: ...
@@ -86,7 +86,7 @@ class Entity(amulet.core.version.PlatformVersionContainer):
86
86
  """
87
87
 
88
88
  @x.setter
89
- def x(self, arg1: float) -> None: ...
89
+ def x(self, arg1: typing.SupportsFloat) -> None: ...
90
90
  @property
91
91
  def y(self) -> float:
92
92
  """
@@ -94,7 +94,7 @@ class Entity(amulet.core.version.PlatformVersionContainer):
94
94
  """
95
95
 
96
96
  @y.setter
97
- def y(self, arg1: float) -> None: ...
97
+ def y(self, arg1: typing.SupportsFloat) -> None: ...
98
98
  @property
99
99
  def z(self) -> float:
100
100
  """
@@ -102,4 +102,4 @@ class Entity(amulet.core.version.PlatformVersionContainer):
102
102
  """
103
103
 
104
104
  @z.setter
105
- def z(self, arg1: float) -> None: ...
105
+ def z(self, arg1: typing.SupportsFloat) -> None: ...
@@ -0,0 +1,64 @@
1
+ #include <amulet/nbt/nbt_encoding/binary.hpp>
2
+
3
+ #include <amulet/core/dll.hpp>
4
+ #include <amulet/core/version/version.hpp>
5
+
6
+ #include "entity.hpp"
7
+
8
+ namespace Amulet {
9
+
10
+ void Entity::serialise(BinaryWriter& writer) const
11
+ {
12
+ writer.write_numeric<std::uint8_t>(1);
13
+ writer.write_size_and_bytes(get_platform());
14
+ get_version().serialise(writer);
15
+ writer.write_size_and_bytes(_namespace);
16
+ writer.write_size_and_bytes(_base_name);
17
+ writer.write_numeric<double>(_x);
18
+ writer.write_numeric<double>(_y);
19
+ writer.write_numeric<double>(_z);
20
+ Amulet::NBT::encode_nbt(writer, *_nbt);
21
+ }
22
+
23
+ Entity Entity::deserialise(BinaryReader& reader)
24
+ {
25
+ auto version_number = reader.read_numeric<std::uint8_t>();
26
+ switch (version_number) {
27
+ case 1: {
28
+ std::string platform { reader.read_size_and_bytes() };
29
+ VersionNumber version = VersionNumber::deserialise(reader);
30
+ std::string namespace_ { reader.read_size_and_bytes() };
31
+ std::string base_name { reader.read_size_and_bytes() };
32
+ double x = reader.read_numeric<double>();
33
+ double y = reader.read_numeric<double>();
34
+ double z = reader.read_numeric<double>();
35
+ auto named_tag = std::make_shared<Amulet::NBT::NamedTag>(Amulet::NBT::decode_nbt(reader));
36
+ return Entity {
37
+ std::move(platform),
38
+ std::move(version),
39
+ std::move(namespace_),
40
+ std::move(base_name),
41
+ x,
42
+ y,
43
+ z,
44
+ std::move(named_tag)
45
+ };
46
+ }
47
+ default:
48
+ throw std::invalid_argument("Unsupported BlockEntity version " + std::to_string(version_number));
49
+ }
50
+ }
51
+
52
+ bool Entity::operator==(const Entity& other) const
53
+ {
54
+ return (
55
+ PlatformVersionContainer::operator==(other)
56
+ && _namespace == other._namespace
57
+ && _base_name == other._base_name
58
+ && _x == other._x
59
+ && _y == other._y
60
+ && _z == other._z
61
+ && Amulet::NBT::NBTTag_eq(*_nbt, *other._nbt));
62
+ }
63
+
64
+ } // namespace Amulet
@@ -10,11 +10,11 @@ __all__ = ["BiomePalette"]
10
10
 
11
11
  class BiomePalette(amulet.core.version.VersionRangeContainer):
12
12
  @typing.overload
13
- def __contains__(self, arg0: int) -> bool: ...
13
+ def __contains__(self, arg0: typing.SupportsInt) -> bool: ...
14
14
  @typing.overload
15
15
  def __contains__(self, arg0: amulet.core.biome.Biome) -> bool: ...
16
16
  @typing.overload
17
- def __getitem__(self, arg0: int) -> amulet.core.biome.Biome: ...
17
+ def __getitem__(self, arg0: typing.SupportsInt) -> amulet.core.biome.Biome: ...
18
18
  @typing.overload
19
19
  def __getitem__(self, arg0: slice) -> list: ...
20
20
  def __init__(self, arg0: amulet.core.version.VersionRange) -> None: ...
@@ -33,9 +33,12 @@ class BiomePalette(amulet.core.version.VersionRangeContainer):
33
33
 
34
34
  def count(self, value: typing.Any) -> int: ...
35
35
  def index(
36
- self, value: typing.Any, start: int = 0, stop: int = 9223372036854775807
36
+ self,
37
+ value: typing.Any,
38
+ start: typing.SupportsInt = 0,
39
+ stop: typing.SupportsInt = 9223372036854775807,
37
40
  ) -> int: ...
38
- def index_to_biome(self, arg0: int) -> amulet.core.biome.Biome:
41
+ def index_to_biome(self, arg0: typing.SupportsInt) -> amulet.core.biome.Biome:
39
42
  """
40
43
  Get the biome at the specified palette index.
41
44
 
@@ -10,11 +10,11 @@ __all__ = ["BlockPalette"]
10
10
 
11
11
  class BlockPalette(amulet.core.version.VersionRangeContainer):
12
12
  @typing.overload
13
- def __contains__(self, arg0: int) -> bool: ...
13
+ def __contains__(self, arg0: typing.SupportsInt) -> bool: ...
14
14
  @typing.overload
15
15
  def __contains__(self, arg0: amulet.core.block.BlockStack) -> bool: ...
16
16
  @typing.overload
17
- def __getitem__(self, arg0: int) -> amulet.core.block.BlockStack: ...
17
+ def __getitem__(self, arg0: typing.SupportsInt) -> amulet.core.block.BlockStack: ...
18
18
  @typing.overload
19
19
  def __getitem__(self, arg0: slice) -> list: ...
20
20
  def __init__(self, arg0: amulet.core.version.VersionRange) -> None: ...
@@ -35,9 +35,14 @@ class BlockPalette(amulet.core.version.VersionRangeContainer):
35
35
 
36
36
  def count(self, value: typing.Any) -> int: ...
37
37
  def index(
38
- self, value: typing.Any, start: int = 0, stop: int = 9223372036854775807
38
+ self,
39
+ value: typing.Any,
40
+ start: typing.SupportsInt = 0,
41
+ stop: typing.SupportsInt = 9223372036854775807,
39
42
  ) -> int: ...
40
- def index_to_block_stack(self, arg0: int) -> amulet.core.block.BlockStack:
43
+ def index_to_block_stack(
44
+ self, arg0: typing.SupportsInt
45
+ ) -> amulet.core.block.BlockStack:
41
46
  """
42
47
  Get the block stack at the specified palette index.
43
48
 
@@ -23,7 +23,13 @@ class SelectionBox:
23
23
  def __hash__(self) -> int: ...
24
24
  @typing.overload
25
25
  def __init__(
26
- self, min_x: int, min_y: int, min_z: int, size_x: int, size_y: int, size_z: int
26
+ self,
27
+ min_x: typing.SupportsInt,
28
+ min_y: typing.SupportsInt,
29
+ min_z: typing.SupportsInt,
30
+ size_x: typing.SupportsInt,
31
+ size_y: typing.SupportsInt,
32
+ size_z: typing.SupportsInt,
27
33
  ) -> None:
28
34
  """
29
35
  Construct a new SelectionBox instance.
@@ -41,7 +47,9 @@ class SelectionBox:
41
47
 
42
48
  @typing.overload
43
49
  def __init__(
44
- self, point_1: tuple[int, int, int], point_2: tuple[int, int, int]
50
+ self,
51
+ point_1: tuple[typing.SupportsInt, typing.SupportsInt, typing.SupportsInt],
52
+ point_2: tuple[typing.SupportsInt, typing.SupportsInt, typing.SupportsInt],
45
53
  ) -> None:
46
54
  """
47
55
  Construct a new SelectionBox instance.
@@ -57,7 +65,9 @@ class SelectionBox:
57
65
  def __lt__(self, arg0: SelectionBox) -> bool: ...
58
66
  def __repr__(self) -> str: ...
59
67
  def __str__(self) -> str: ...
60
- def contains_block(self, x: int, y: int, z: int) -> bool:
68
+ def contains_block(
69
+ self, x: typing.SupportsInt, y: typing.SupportsInt, z: typing.SupportsInt
70
+ ) -> bool:
61
71
  """
62
72
  Is the block contained within the selection.
63
73
 
@@ -79,7 +89,9 @@ class SelectionBox:
79
89
  :return: True if other fits in self, False otherwise.
80
90
  """
81
91
 
82
- def contains_point(self, x: float, y: float, z: float) -> bool:
92
+ def contains_point(
93
+ self, x: typing.SupportsFloat, y: typing.SupportsFloat, z: typing.SupportsFloat
94
+ ) -> bool:
83
95
  """
84
96
  Is the point contained within the selection.
85
97
 
@@ -120,7 +132,9 @@ class SelectionBox:
120
132
  :return: True if the two :class:`SelectionBox` instances touch or intersect, False otherwise.
121
133
  """
122
134
 
123
- def translate(self, x: int, y: int, z: int) -> SelectionBox:
135
+ def translate(
136
+ self, x: typing.SupportsInt, y: typing.SupportsInt, z: typing.SupportsInt
137
+ ) -> SelectionBox:
124
138
  """
125
139
  Create a new :class:`SelectionBox` based on this one with the coordinates moved by the given offset.
126
140
 
@@ -63,7 +63,9 @@ class SelectionGroup:
63
63
  >>> ])
64
64
  """
65
65
 
66
- def __iter__(self) -> typing.Iterator[amulet.core.selection.box.SelectionBox]:
66
+ def __iter__(
67
+ self,
68
+ ) -> collections.abc.Iterator[amulet.core.selection.box.SelectionBox]:
67
69
  """
68
70
  An iterable of all the :class:`SelectionBox` classes in the group.
69
71
  """
@@ -75,7 +77,9 @@ class SelectionGroup:
75
77
 
76
78
  def __repr__(self) -> str: ...
77
79
  def __str__(self) -> str: ...
78
- def contains_block(self, x: int, y: int, z: int) -> bool:
80
+ def contains_block(
81
+ self, x: typing.SupportsInt, y: typing.SupportsInt, z: typing.SupportsInt
82
+ ) -> bool:
79
83
  """
80
84
  Is the block contained within the selection.
81
85
 
@@ -89,7 +93,9 @@ class SelectionGroup:
89
93
  :return: True if the block is in the selection.
90
94
  """
91
95
 
92
- def contains_point(self, x: float, y: float, z: float) -> bool:
96
+ def contains_point(
97
+ self, x: typing.SupportsFloat, y: typing.SupportsFloat, z: typing.SupportsFloat
98
+ ) -> bool:
93
99
  """
94
100
  Is the point contained within the selection.
95
101
 
@@ -114,7 +120,9 @@ class SelectionGroup:
114
120
 
115
121
  @typing.overload
116
122
  def intersects(self, other: SelectionGroup) -> bool: ...
117
- def translate(self, x: int, y: int, z: int) -> SelectionGroup:
123
+ def translate(
124
+ self, x: typing.SupportsInt, y: typing.SupportsInt, z: typing.SupportsInt
125
+ ) -> SelectionGroup:
118
126
  """
119
127
  Create a new :class:`SelectionGroup` based on this one with the coordinates moved by the given offset.
120
128
 
@@ -207,7 +215,7 @@ class SelectionGroup:
207
215
  @property
208
216
  def selection_boxes(
209
217
  self,
210
- ) -> typing.Iterator[amulet.core.selection.box.SelectionBox]:
218
+ ) -> collections.abc.Iterator[amulet.core.selection.box.SelectionBox]:
211
219
  """
212
220
  An iterator of the :class:`SelectionBox` instances stored for this group.
213
221
  """
@@ -1,5 +1,6 @@
1
1
  from __future__ import annotations
2
2
 
3
+ import collections.abc
3
4
  import types
4
5
  import typing
5
6
  from builtins import str as PlatformType
@@ -48,7 +49,7 @@ class VersionNumber:
48
49
  >>> v3 = VersionNumber(3578)
49
50
  """
50
51
 
51
- def __contains__(self, arg0: int) -> bool: ...
52
+ def __contains__(self, arg0: typing.SupportsInt) -> bool: ...
52
53
  @typing.overload
53
54
  def __eq__(self, arg0: VersionNumber) -> bool: ...
54
55
  @typing.overload
@@ -61,23 +62,26 @@ class VersionNumber:
61
62
  def __gt__(self, arg0: VersionNumber) -> bool: ...
62
63
  def __hash__(self) -> int: ...
63
64
  def __init__(self, *args: typing.SupportsInt) -> None: ...
64
- def __iter__(self) -> typing.Iterator[int]: ...
65
+ def __iter__(self) -> collections.abc.Iterator[int]: ...
65
66
  def __le__(self, arg0: VersionNumber) -> bool: ...
66
67
  def __len__(self) -> int: ...
67
68
  def __lt__(self, arg0: VersionNumber) -> bool: ...
68
69
  def __repr__(self) -> str: ...
69
- def __reversed__(self) -> typing.Iterator[int]: ...
70
+ def __reversed__(self) -> collections.abc.Iterator[int]: ...
70
71
  def __str__(self) -> str: ...
71
- def count(self, value: int) -> int: ...
72
+ def count(self, value: typing.SupportsInt) -> int: ...
72
73
  def cropped_version(self) -> list[int]:
73
74
  """
74
75
  The version number with trailing zeros cut off.
75
76
  """
76
77
 
77
78
  def index(
78
- self, value: int, start: int = 0, stop: int = 18446744073709551615
79
+ self,
80
+ value: typing.SupportsInt,
81
+ start: typing.SupportsInt = 0,
82
+ stop: typing.SupportsInt = 18446744073709551615,
79
83
  ) -> int: ...
80
- def padded_version(self, len: int) -> list[int]:
84
+ def padded_version(self, len: typing.SupportsInt) -> list[int]:
81
85
  """
82
86
  Get the version number cropped or padded with zeros to the given length.
83
87
  """
@@ -31,7 +31,7 @@ VersionNumber VersionNumber::deserialise(BinaryReader& reader)
31
31
  return vec;
32
32
  }
33
33
  default:
34
- throw std::invalid_argument("Unsupported version " + std::to_string(version_number));
34
+ throw std::invalid_argument("Unsupported VersionNumber version " + std::to_string(version_number));
35
35
  }
36
36
  }
37
37
 
@@ -89,7 +89,7 @@ PlatformVersionContainer PlatformVersionContainer::deserialise(BinaryReader& rea
89
89
  return { platform, version };
90
90
  }
91
91
  default:
92
- throw std::invalid_argument("Unsupported version " + std::to_string(version_number));
92
+ throw std::invalid_argument("Unsupported PlatformVersionContainer version " + std::to_string(version_number));
93
93
  }
94
94
  }
95
95
 
@@ -112,7 +112,7 @@ VersionRange VersionRange::deserialise(BinaryReader& reader)
112
112
  return { platform, min_version, max_version };
113
113
  }
114
114
  default:
115
- throw std::invalid_argument("Unsupported version " + std::to_string(version_number));
115
+ throw std::invalid_argument("Unsupported VersionRange version " + std::to_string(version_number));
116
116
  }
117
117
  }
118
118
 
@@ -140,7 +140,7 @@ VersionRangeContainer VersionRangeContainer::deserialise(BinaryReader& reader)
140
140
  return VersionRange::deserialise(reader);
141
141
  }
142
142
  default:
143
- throw std::invalid_argument("Unsupported version " + std::to_string(version_number));
143
+ throw std::invalid_argument("Unsupported VersionRangeContainer version " + std::to_string(version_number));
144
144
  }
145
145
  }
146
146
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: amulet-core
3
- Version: 2.0.3a2
3
+ Version: 2.0.4a0
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
@@ -12,11 +12,11 @@ Requires-Python: >=3.11
12
12
  Description-Content-Type: text/markdown
13
13
  Requires-Dist: amulet-compiler-target==2.0
14
14
  Requires-Dist: amulet-compiler-version==3.0.0
15
- Requires-Dist: pybind11==2.13.6
15
+ Requires-Dist: pybind11==3.0.0
16
16
  Requires-Dist: amulet-pybind11-extensions~=1.1.0.0a0
17
17
  Requires-Dist: amulet-io~=1.0
18
- Requires-Dist: amulet-zlib~=1.0.0.0a7
19
- Requires-Dist: amulet-nbt~=5.0.0.0a7
18
+ Requires-Dist: amulet-zlib~=1.0.1.0a0
19
+ Requires-Dist: amulet-nbt~=5.0.1.0a0
20
20
  Requires-Dist: numpy~=2.0
21
21
  Provides-Extra: docs
22
22
  Requires-Dist: Sphinx>=1.7.4; extra == "docs"
@@ -8,6 +8,7 @@ setup.py
8
8
  get_compiler/CMakeLists.txt
9
9
  get_compiler/__init__.py
10
10
  src/amulet/core/__init__.py
11
+ src/amulet/core/__init__.pyi
11
12
  src/amulet/core/_amulet_core.py.cpp
12
13
  src/amulet/core/_amulet_core.pyi
13
14
  src/amulet/core/_version.py
@@ -1,10 +1,10 @@
1
1
  amulet-compiler-target==2.0
2
2
  amulet-compiler-version==3.0.0
3
- pybind11==2.13.6
3
+ pybind11==3.0.0
4
4
  amulet-pybind11-extensions~=1.1.0.0a0
5
5
  amulet-io~=1.0
6
- amulet-zlib~=1.0.0.0a7
7
- amulet-nbt~=5.0.0.0a7
6
+ amulet-zlib~=1.0.1.0a0
7
+ amulet-nbt~=5.0.1.0a0
8
8
  numpy~=2.0
9
9
 
10
10
  [dev]
@@ -1,26 +0,0 @@
1
- #include <amulet/core/dll.hpp>
2
-
3
- #include "block_entity.hpp"
4
-
5
- namespace Amulet {
6
-
7
- void BlockEntity::serialise(BinaryWriter&) const
8
- {
9
- throw std::runtime_error("NotImplementedError");
10
- }
11
-
12
- BlockEntity BlockEntity::deserialise(BinaryReader&)
13
- {
14
- throw std::runtime_error("NotImplementedError");
15
- }
16
-
17
- bool BlockEntity::operator==(const BlockEntity& other) const
18
- {
19
- return (
20
- PlatformVersionContainer::operator==(other)
21
- && _namespace == other._namespace
22
- && _base_name == other._base_name
23
- && Amulet::NBT::NBTTag_eq(*_nbt, *other._nbt));
24
- }
25
-
26
- }
@@ -1,29 +0,0 @@
1
- #include <amulet/core/dll.hpp>
2
- #include <amulet/core/version/version.hpp>
3
-
4
- #include "entity.hpp"
5
-
6
- namespace Amulet {
7
-
8
- void Entity::serialise(BinaryWriter&) const
9
- {
10
- throw std::runtime_error("NotImplementedError");
11
- }
12
- Entity Entity::deserialise(BinaryReader&)
13
- {
14
- throw std::runtime_error("NotImplementedError");
15
- }
16
-
17
- bool Entity::operator==(const Entity& other) const
18
- {
19
- return (
20
- PlatformVersionContainer::operator==(other)
21
- && _namespace == other._namespace
22
- && _base_name == other._base_name
23
- && _x == other._x
24
- && _y == other._y
25
- && _z == other._z
26
- && Amulet::NBT::NBTTag_eq(*_nbt, *other._nbt));
27
- }
28
-
29
- } // namespace Amulet
File without changes
File without changes
File without changes
File without changes