amulet-core 2.0.5a1__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 (101) hide show
  1. {amulet_core-2.0.5a1/src/amulet_core.egg-info → amulet_core-2.0.6a0}/PKG-INFO +1 -1
  2. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/src/amulet/core/_version.py +3 -3
  3. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/src/amulet/core/chunk/component/__init__.pyi +2 -5
  4. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/src/amulet/core/chunk/component/__init_chunk_components.py.cpp +1 -1
  5. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/src/amulet/core/chunk/component/biome_3d_component.cpp +7 -7
  6. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/src/amulet/core/chunk/component/biome_3d_component.hpp +9 -9
  7. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/src/amulet/core/chunk/component/block_component.cpp +7 -7
  8. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/src/amulet/core/chunk/component/block_component.hpp +9 -9
  9. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/src/amulet/core/chunk/component/block_component.py.cpp +10 -10
  10. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/src/amulet/core/chunk/component/block_component.pyi +3 -3
  11. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/src/amulet/core/chunk/component/block_entity_component.cpp +9 -9
  12. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/src/amulet/core/chunk/component/block_entity_component.hpp +9 -9
  13. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/src/amulet/core/chunk/component/section_array_map.cpp +1 -1
  14. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/src/amulet/core/selection/shape_group.cpp +6 -1
  15. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0/src/amulet_core.egg-info}/PKG-INFO +1 -1
  16. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/CMakeLists.txt +0 -0
  17. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/MANIFEST.in +0 -0
  18. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/README.md +0 -0
  19. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/build_requires.py +0 -0
  20. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/get_compiler/CMakeLists.txt +0 -0
  21. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/get_compiler/__init__.py +0 -0
  22. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/pyproject.toml +0 -0
  23. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/requirements.py +0 -0
  24. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/setup.cfg +0 -0
  25. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/setup.py +0 -0
  26. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/src/amulet/core/__init__.py +0 -0
  27. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/src/amulet/core/__init__.pyi +0 -0
  28. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/src/amulet/core/__pyinstaller/__init__.py +0 -0
  29. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/src/amulet/core/__pyinstaller/hook-amulet.core.py +0 -0
  30. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/src/amulet/core/_amulet_core.py.cpp +0 -0
  31. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/src/amulet/core/_amulet_core.pyi +0 -0
  32. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/src/amulet/core/amulet_coreConfig.cmake +0 -0
  33. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/src/amulet/core/biome/__init__.pyi +0 -0
  34. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/src/amulet/core/biome/biome.cpp +0 -0
  35. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/src/amulet/core/biome/biome.hpp +0 -0
  36. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/src/amulet/core/biome/biome.py.cpp +0 -0
  37. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/src/amulet/core/block/__init__.pyi +0 -0
  38. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/src/amulet/core/block/block.cpp +0 -0
  39. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/src/amulet/core/block/block.hpp +0 -0
  40. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/src/amulet/core/block/block.py.cpp +0 -0
  41. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/src/amulet/core/block_entity/__init__.pyi +0 -0
  42. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/src/amulet/core/block_entity/block_entity.cpp +0 -0
  43. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/src/amulet/core/block_entity/block_entity.hpp +0 -0
  44. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/src/amulet/core/block_entity/block_entity.py.cpp +0 -0
  45. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/src/amulet/core/chunk/__init__.pyi +0 -0
  46. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/src/amulet/core/chunk/chunk.cpp +0 -0
  47. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/src/amulet/core/chunk/chunk.hpp +0 -0
  48. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/src/amulet/core/chunk/chunk.py.cpp +0 -0
  49. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/src/amulet/core/chunk/component/section_array_map.hpp +0 -0
  50. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/src/amulet/core/chunk/component/section_array_map.py.cpp +0 -0
  51. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/src/amulet/core/chunk/component/section_array_map.pyi +0 -0
  52. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/src/amulet/core/dll.hpp +0 -0
  53. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/src/amulet/core/entity/__init__.pyi +0 -0
  54. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/src/amulet/core/entity/entity.cpp +0 -0
  55. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/src/amulet/core/entity/entity.hpp +0 -0
  56. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/src/amulet/core/entity/entity.py.cpp +0 -0
  57. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/src/amulet/core/palette/__init__.pyi +0 -0
  58. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/src/amulet/core/palette/__init_palette.py.cpp +0 -0
  59. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/src/amulet/core/palette/biome_palette.cpp +0 -0
  60. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/src/amulet/core/palette/biome_palette.hpp +0 -0
  61. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/src/amulet/core/palette/biome_palette.py.cpp +0 -0
  62. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/src/amulet/core/palette/biome_palette.pyi +0 -0
  63. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/src/amulet/core/palette/block_palette.cpp +0 -0
  64. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/src/amulet/core/palette/block_palette.hpp +0 -0
  65. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/src/amulet/core/palette/block_palette.py.cpp +0 -0
  66. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/src/amulet/core/palette/block_palette.pyi +0 -0
  67. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/src/amulet/core/py.typed +0 -0
  68. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/src/amulet/core/selection/__init__.pyi +0 -0
  69. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/src/amulet/core/selection/__init_selection.py.cpp +0 -0
  70. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/src/amulet/core/selection/box.cpp +0 -0
  71. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/src/amulet/core/selection/box.hpp +0 -0
  72. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/src/amulet/core/selection/box.py.cpp +0 -0
  73. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/src/amulet/core/selection/box.pyi +0 -0
  74. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/src/amulet/core/selection/box_group.cpp +0 -0
  75. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/src/amulet/core/selection/box_group.hpp +0 -0
  76. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/src/amulet/core/selection/box_group.py.cpp +0 -0
  77. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/src/amulet/core/selection/box_group.pyi +0 -0
  78. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/src/amulet/core/selection/cuboid.cpp +0 -0
  79. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/src/amulet/core/selection/cuboid.hpp +0 -0
  80. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/src/amulet/core/selection/cuboid.py.cpp +0 -0
  81. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/src/amulet/core/selection/cuboid.pyi +0 -0
  82. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/src/amulet/core/selection/ellipsoid.cpp +0 -0
  83. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/src/amulet/core/selection/ellipsoid.hpp +0 -0
  84. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/src/amulet/core/selection/ellipsoid.py.cpp +0 -0
  85. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/src/amulet/core/selection/ellipsoid.pyi +0 -0
  86. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/src/amulet/core/selection/shape.cpp +0 -0
  87. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/src/amulet/core/selection/shape.hpp +0 -0
  88. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/src/amulet/core/selection/shape.py.cpp +0 -0
  89. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/src/amulet/core/selection/shape.pyi +0 -0
  90. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/src/amulet/core/selection/shape_group.hpp +0 -0
  91. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/src/amulet/core/selection/shape_group.py.cpp +0 -0
  92. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/src/amulet/core/selection/shape_group.pyi +0 -0
  93. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/src/amulet/core/version/__init__.pyi +0 -0
  94. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/src/amulet/core/version/version.cpp +0 -0
  95. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/src/amulet/core/version/version.hpp +0 -0
  96. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/src/amulet/core/version/version.py.cpp +0 -0
  97. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/src/amulet_core.egg-info/SOURCES.txt +0 -0
  98. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/src/amulet_core.egg-info/dependency_links.txt +0 -0
  99. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/src/amulet_core.egg-info/entry_points.txt +0 -0
  100. {amulet_core-2.0.5a1 → amulet_core-2.0.6a0}/src/amulet_core.egg-info/requires.txt +0 -0
  101. {amulet_core-2.0.5a1 → 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.5a1
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
@@ -8,11 +8,11 @@ import json
8
8
 
9
9
  version_json = '''
10
10
  {
11
- "date": "2025-09-17T11:29:24+0100",
11
+ "date": "2025-10-16T14:53:07+0100",
12
12
  "dirty": false,
13
13
  "error": null,
14
- "full-revisionid": "7ed2b2b5421e7cb0691779cf4861faf812f8cee3",
15
- "version": "2.0.5a1"
14
+ "full-revisionid": "c3e4c826d97d6d0ca38d45bbd0595499626b71df",
15
+ "version": "2.0.6a0"
16
16
  }
17
17
  ''' # END VERSION_JSON
18
18
 
@@ -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;
@@ -12,7 +12,7 @@
12
12
 
13
13
  namespace Amulet {
14
14
  typedef std::tuple<std::uint16_t, std::int64_t, std::uint16_t> BlockEntityChunkCoord;
15
- class BlockEntityComponentData : public VersionRangeContainer {
15
+ class BlockEntityStorage : public VersionRangeContainer {
16
16
  private:
17
17
  std::uint16_t _x_size;
18
18
  std::uint16_t _z_size;
@@ -23,7 +23,7 @@ private:
23
23
 
24
24
  public:
25
25
  template <typename VersionRangeT>
26
- BlockEntityComponentData(
26
+ BlockEntityStorage(
27
27
  VersionRangeT&& version_range,
28
28
  std::uint16_t x_size,
29
29
  std::uint16_t z_size)
@@ -35,7 +35,7 @@ public:
35
35
  }
36
36
 
37
37
  AMULET_CORE_EXPORT void serialise(BinaryWriter&) const;
38
- AMULET_CORE_EXPORT static BlockEntityComponentData deserialise(BinaryReader&);
38
+ AMULET_CORE_EXPORT static BlockEntityStorage deserialise(BinaryReader&);
39
39
 
40
40
  std::uint16_t get_x_size() const { return _x_size; }
41
41
  std::uint16_t get_z_size() const { return _z_size; }
@@ -79,12 +79,12 @@ public:
79
79
  }
80
80
  if (!(
81
81
  get_version_range().contains(
82
- block_entity->get_platform(),
83
- block_entity->get_version()))) {
82
+ block_entity_ptr->get_platform(),
83
+ block_entity_ptr->get_version()))) {
84
84
  throw std::invalid_argument(
85
85
  "BlockEntity is incompatible with VersionRange.");
86
86
  }
87
- _block_entities.insert_or_assign(coord, std::move(block_entity));
87
+ _block_entities.insert_or_assign(coord, std::move(block_entity_ptr));
88
88
  }
89
89
 
90
90
  void del(const BlockEntityChunkCoord& coord)
@@ -95,7 +95,7 @@ public:
95
95
 
96
96
  class BlockEntityComponent {
97
97
  private:
98
- std::optional<std::shared_ptr<BlockEntityComponentData>> _value;
98
+ std::optional<std::shared_ptr<BlockEntityStorage>> _value;
99
99
 
100
100
  protected:
101
101
  // Null constructor
@@ -113,7 +113,7 @@ protected:
113
113
 
114
114
  public:
115
115
  AMULET_CORE_EXPORT static const std::string ComponentID;
116
- AMULET_CORE_EXPORT std::shared_ptr<BlockEntityComponentData> get_block_entity();
117
- AMULET_CORE_EXPORT void set_block_entity(std::shared_ptr<BlockEntityComponentData> component);
116
+ AMULET_CORE_EXPORT std::shared_ptr<BlockEntityStorage> get_block_entities();
117
+ AMULET_CORE_EXPORT void set_block_entities(std::shared_ptr<BlockEntityStorage> component);
118
118
  };
119
119
  }
@@ -199,7 +199,7 @@ SectionArrayMap SectionArrayMap::deserialise(BinaryReader& reader)
199
199
  return self;
200
200
  }
201
201
  default:
202
- throw std::invalid_argument("Unsupported BlockComponentData version " + std::to_string(version));
202
+ throw std::invalid_argument("Unsupported BlockStorage version " + std::to_string(version));
203
203
  }
204
204
  }
205
205
 
@@ -27,9 +27,14 @@ SelectionShapeGroup SelectionShapeGroup::deep_copy() const
27
27
  std::string SelectionShapeGroup::serialise() const
28
28
  {
29
29
  std::string s = "SelectionShapeGroup([";
30
+ bool is_first = true;
30
31
  for (const auto& shape : get_shapes()) {
32
+ if (is_first) {
33
+ is_first = false;
34
+ } else {
35
+ s += ",";
36
+ }
31
37
  s += shape->serialise();
32
- s += ",";
33
38
  }
34
39
  s += "])";
35
40
  return s;
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: amulet-core
3
- Version: 2.0.5a1
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
File without changes
File without changes
File without changes
File without changes