amulet-core 2.0.7a0__cp312-cp312-macosx_10_15_universal2.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.
- amulet/core/__init__.py +38 -0
- amulet/core/__init__.pyi +31 -0
- amulet/core/__pyinstaller/__init__.py +2 -0
- amulet/core/__pyinstaller/hook-amulet.core.py +4 -0
- amulet/core/_amulet_core.cpython-312-darwin.so +0 -0
- amulet/core/_amulet_core.pyi +7 -0
- amulet/core/_version.py +21 -0
- amulet/core/amulet_coreConfig.cmake +23 -0
- amulet/core/biome/__init__.pyi +75 -0
- amulet/core/biome/biome.hpp +53 -0
- amulet/core/block/__init__.pyi +273 -0
- amulet/core/block/block.hpp +156 -0
- amulet/core/block_entity/__init__.pyi +78 -0
- amulet/core/block_entity/block_entity.hpp +84 -0
- amulet/core/chunk/__init__.pyi +67 -0
- amulet/core/chunk/chunk.hpp +126 -0
- amulet/core/chunk/component/__init__.pyi +15 -0
- amulet/core/chunk/component/biome_3d_component.hpp +99 -0
- amulet/core/chunk/component/block_component.hpp +101 -0
- amulet/core/chunk/component/block_component.pyi +28 -0
- amulet/core/chunk/component/block_entity_component.hpp +119 -0
- amulet/core/chunk/component/section_array_map.hpp +178 -0
- amulet/core/chunk/component/section_array_map.pyi +112 -0
- amulet/core/dll.hpp +21 -0
- amulet/core/entity/__init__.pyi +105 -0
- amulet/core/entity/entity.hpp +100 -0
- amulet/core/libamulet_core.dylib +0 -0
- amulet/core/palette/__init__.pyi +8 -0
- amulet/core/palette/biome_palette.hpp +65 -0
- amulet/core/palette/biome_palette.pyi +48 -0
- amulet/core/palette/block_palette.hpp +71 -0
- amulet/core/palette/block_palette.pyi +52 -0
- amulet/core/py.typed +0 -0
- amulet/core/selection/__init__.pyi +25 -0
- amulet/core/selection/box.hpp +97 -0
- amulet/core/selection/box.pyi +239 -0
- amulet/core/selection/box_group.hpp +89 -0
- amulet/core/selection/box_group.pyi +222 -0
- amulet/core/selection/cuboid.hpp +41 -0
- amulet/core/selection/cuboid.pyi +49 -0
- amulet/core/selection/ellipsoid.hpp +42 -0
- amulet/core/selection/ellipsoid.pyi +47 -0
- amulet/core/selection/shape.hpp +73 -0
- amulet/core/selection/shape.pyi +56 -0
- amulet/core/selection/shape_group.hpp +73 -0
- amulet/core/selection/shape_group.pyi +118 -0
- amulet/core/version/__init__.pyi +138 -0
- amulet/core/version/version.hpp +206 -0
- amulet_core-2.0.7a0.dist-info/METADATA +112 -0
- amulet_core-2.0.7a0.dist-info/RECORD +53 -0
- amulet_core-2.0.7a0.dist-info/WHEEL +5 -0
- amulet_core-2.0.7a0.dist-info/entry_points.txt +2 -0
- amulet_core-2.0.7a0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import collections.abc
|
|
4
|
+
import types
|
|
5
|
+
import typing
|
|
6
|
+
|
|
7
|
+
import amulet.core.selection.box_group
|
|
8
|
+
import amulet.core.selection.shape
|
|
9
|
+
|
|
10
|
+
__all__: list[str] = ["SelectionShapeGroup"]
|
|
11
|
+
|
|
12
|
+
class SelectionShapeGroup:
|
|
13
|
+
"""
|
|
14
|
+
A group of selection shapes.
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
__hash__: typing.ClassVar[None] = None # type: ignore
|
|
18
|
+
@staticmethod
|
|
19
|
+
def deserialise(s: str) -> SelectionShapeGroup: ...
|
|
20
|
+
def __bool__(self) -> bool:
|
|
21
|
+
"""
|
|
22
|
+
Are there any selections in the group.
|
|
23
|
+
"""
|
|
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: ...
|
|
45
|
+
@typing.overload
|
|
46
|
+
def __init__(self) -> None:
|
|
47
|
+
"""
|
|
48
|
+
Create an empty SelectionShapeGroup.
|
|
49
|
+
|
|
50
|
+
>>> SelectionShapeGroup()
|
|
51
|
+
"""
|
|
52
|
+
|
|
53
|
+
@typing.overload
|
|
54
|
+
def __init__(
|
|
55
|
+
self, box_group: amulet.core.selection.box_group.SelectionBoxGroup
|
|
56
|
+
) -> None: ...
|
|
57
|
+
@typing.overload
|
|
58
|
+
def __init__(
|
|
59
|
+
self,
|
|
60
|
+
shapes: collections.abc.Iterable[amulet.core.selection.shape.SelectionShape],
|
|
61
|
+
) -> None:
|
|
62
|
+
"""
|
|
63
|
+
Create a SelectionShapeGroup from the selections in the iterable.
|
|
64
|
+
|
|
65
|
+
>>> SelectionShapeGroup([
|
|
66
|
+
>>> SelectionCuboid(0, 0, 0, 5, 5, 5),
|
|
67
|
+
>>> SelectionEllipsoid(7.5, 0, 0, 2.5)
|
|
68
|
+
>>> ])
|
|
69
|
+
"""
|
|
70
|
+
|
|
71
|
+
def __iter__(
|
|
72
|
+
self,
|
|
73
|
+
) -> collections.abc.Iterator[amulet.core.selection.shape.SelectionShape]: ...
|
|
74
|
+
def __len__(self) -> int:
|
|
75
|
+
"""
|
|
76
|
+
The number of :class:`SelectionShape` classes in the group.
|
|
77
|
+
"""
|
|
78
|
+
|
|
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:
|
|
89
|
+
"""
|
|
90
|
+
Returns True of the shape groups are equal or almost equal.
|
|
91
|
+
"""
|
|
92
|
+
|
|
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(
|
|
107
|
+
self,
|
|
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:
|
|
116
|
+
"""
|
|
117
|
+
Convert the shapes to a SelectionBoxGroup.
|
|
118
|
+
"""
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import collections.abc
|
|
4
|
+
import types
|
|
5
|
+
import typing
|
|
6
|
+
from builtins import str as PlatformType
|
|
7
|
+
|
|
8
|
+
__all__: list[str] = [
|
|
9
|
+
"PlatformType",
|
|
10
|
+
"PlatformVersionContainer",
|
|
11
|
+
"VersionNumber",
|
|
12
|
+
"VersionRange",
|
|
13
|
+
"VersionRangeContainer",
|
|
14
|
+
]
|
|
15
|
+
|
|
16
|
+
class PlatformVersionContainer:
|
|
17
|
+
"""
|
|
18
|
+
A class storing platform identifier and version number.
|
|
19
|
+
Thread safe.
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
def __init__(self, platform: str, version: VersionNumber) -> None: ...
|
|
23
|
+
def __repr__(self) -> str: ...
|
|
24
|
+
@property
|
|
25
|
+
def platform(self) -> str:
|
|
26
|
+
"""
|
|
27
|
+
Get the platform identifier.
|
|
28
|
+
"""
|
|
29
|
+
|
|
30
|
+
@property
|
|
31
|
+
def version(self) -> VersionNumber:
|
|
32
|
+
"""
|
|
33
|
+
Get the version number.
|
|
34
|
+
"""
|
|
35
|
+
|
|
36
|
+
class VersionNumber:
|
|
37
|
+
"""
|
|
38
|
+
This class is designed to store semantic versions and data versions and allow comparisons between them.
|
|
39
|
+
It is a wrapper around std::vector<std::int64_t> with special comparison handling.
|
|
40
|
+
The version can contain zero to max(int64) values.
|
|
41
|
+
Undefined trailing values are implied zeros. 1.1 == 1.1.0
|
|
42
|
+
All methods are thread safe.
|
|
43
|
+
|
|
44
|
+
>>> v1 = VersionNumber(1, 0, 0)
|
|
45
|
+
>>> v2 = VersionNumber(1, 0)
|
|
46
|
+
>>> assert v2 == v1
|
|
47
|
+
|
|
48
|
+
This class should also be used to store single number data versions.
|
|
49
|
+
>>> v3 = VersionNumber(3578)
|
|
50
|
+
"""
|
|
51
|
+
|
|
52
|
+
def __contains__(self, arg0: typing.SupportsInt) -> bool: ...
|
|
53
|
+
@typing.overload
|
|
54
|
+
def __eq__(self, other: VersionNumber) -> bool: ...
|
|
55
|
+
@typing.overload
|
|
56
|
+
def __eq__(self, other: typing.Any) -> bool | types.NotImplementedType: ...
|
|
57
|
+
def __ge__(self, arg0: VersionNumber) -> bool: ...
|
|
58
|
+
@typing.overload
|
|
59
|
+
def __getitem__(self, item: typing.SupportsInt) -> int: ...
|
|
60
|
+
@typing.overload
|
|
61
|
+
def __getitem__(self, item: slice) -> list[int]: ...
|
|
62
|
+
def __gt__(self, arg0: VersionNumber) -> bool: ...
|
|
63
|
+
def __hash__(self) -> int: ...
|
|
64
|
+
def __init__(self, *args: typing.SupportsInt) -> None: ...
|
|
65
|
+
def __iter__(self) -> collections.abc.Iterator[int]: ...
|
|
66
|
+
def __le__(self, arg0: VersionNumber) -> bool: ...
|
|
67
|
+
def __len__(self) -> int: ...
|
|
68
|
+
def __lt__(self, arg0: VersionNumber) -> bool: ...
|
|
69
|
+
def __repr__(self) -> str: ...
|
|
70
|
+
def __reversed__(self) -> collections.abc.Iterator[int]: ...
|
|
71
|
+
def __str__(self) -> str: ...
|
|
72
|
+
def count(self, value: typing.SupportsInt) -> int: ...
|
|
73
|
+
def cropped_version(self) -> list[int]:
|
|
74
|
+
"""
|
|
75
|
+
The version number with trailing zeros cut off.
|
|
76
|
+
"""
|
|
77
|
+
|
|
78
|
+
def index(
|
|
79
|
+
self,
|
|
80
|
+
value: typing.SupportsInt,
|
|
81
|
+
start: typing.SupportsInt = 0,
|
|
82
|
+
stop: typing.SupportsInt = 18446744073709551615,
|
|
83
|
+
) -> int: ...
|
|
84
|
+
def padded_version(self, len: typing.SupportsInt) -> list[int]:
|
|
85
|
+
"""
|
|
86
|
+
Get the version number cropped or padded with zeros to the given length.
|
|
87
|
+
"""
|
|
88
|
+
|
|
89
|
+
class VersionRange:
|
|
90
|
+
"""
|
|
91
|
+
A class storing platform identifier and minimum and maximum version numbers.
|
|
92
|
+
Thread safe.
|
|
93
|
+
"""
|
|
94
|
+
|
|
95
|
+
__hash__: typing.ClassVar[None] = None # type: ignore
|
|
96
|
+
@typing.overload
|
|
97
|
+
def __eq__(self, other: VersionRange) -> bool: ...
|
|
98
|
+
@typing.overload
|
|
99
|
+
def __eq__(self, other: typing.Any) -> bool | types.NotImplementedType: ...
|
|
100
|
+
def __init__(
|
|
101
|
+
self, platform: str, min_version: VersionNumber, max_version: VersionNumber
|
|
102
|
+
) -> None: ...
|
|
103
|
+
def __repr__(self) -> str: ...
|
|
104
|
+
def contains(self, platform: str, version: VersionNumber) -> bool:
|
|
105
|
+
"""
|
|
106
|
+
Check if the platform is equal and the version number is within the range.
|
|
107
|
+
"""
|
|
108
|
+
|
|
109
|
+
@property
|
|
110
|
+
def max_version(self) -> VersionNumber:
|
|
111
|
+
"""
|
|
112
|
+
The maximum version number
|
|
113
|
+
"""
|
|
114
|
+
|
|
115
|
+
@property
|
|
116
|
+
def min_version(self) -> VersionNumber:
|
|
117
|
+
"""
|
|
118
|
+
The minimum version number
|
|
119
|
+
"""
|
|
120
|
+
|
|
121
|
+
@property
|
|
122
|
+
def platform(self) -> str:
|
|
123
|
+
"""
|
|
124
|
+
The platform identifier.
|
|
125
|
+
"""
|
|
126
|
+
|
|
127
|
+
class VersionRangeContainer:
|
|
128
|
+
"""
|
|
129
|
+
A class that contains a version range.
|
|
130
|
+
"""
|
|
131
|
+
|
|
132
|
+
def __init__(self, version_range: VersionRange) -> None: ...
|
|
133
|
+
def __repr__(self) -> str: ...
|
|
134
|
+
@property
|
|
135
|
+
def version_range(self) -> VersionRange:
|
|
136
|
+
"""
|
|
137
|
+
The version range.
|
|
138
|
+
"""
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
|
|
3
|
+
#include <algorithm>
|
|
4
|
+
#include <cstdint>
|
|
5
|
+
#include <initializer_list>
|
|
6
|
+
#include <memory>
|
|
7
|
+
#include <sstream>
|
|
8
|
+
#include <string>
|
|
9
|
+
#include <vector>
|
|
10
|
+
|
|
11
|
+
#include <amulet/io/binary_reader.hpp>
|
|
12
|
+
#include <amulet/io/binary_writer.hpp>
|
|
13
|
+
|
|
14
|
+
#include <amulet/core/dll.hpp>
|
|
15
|
+
|
|
16
|
+
namespace Amulet {
|
|
17
|
+
|
|
18
|
+
typedef std::string PlatformType;
|
|
19
|
+
|
|
20
|
+
// This class is designed to store semantic versions and data versions and allow comparisons between them.
|
|
21
|
+
// It is a wrapper around std::vector<std::int64_t> with special comparison handling.
|
|
22
|
+
// The version can contain zero to max(int64) values.
|
|
23
|
+
// Undefined trailing values are implied zeros. 1.1 == 1.1.0
|
|
24
|
+
// All methods are thread safe.
|
|
25
|
+
class VersionNumber {
|
|
26
|
+
private:
|
|
27
|
+
std::vector<std::int64_t> _vec;
|
|
28
|
+
|
|
29
|
+
public:
|
|
30
|
+
// Get the underlying vector.
|
|
31
|
+
// Thread safe.
|
|
32
|
+
const std::vector<std::int64_t>& get_vector() const { return _vec; }
|
|
33
|
+
|
|
34
|
+
// Constructors
|
|
35
|
+
template <typename... Args>
|
|
36
|
+
requires std::is_constructible_v<std::vector<std::int64_t>, Args...>
|
|
37
|
+
&& (!(sizeof...(Args) > 0 && (std::is_integral_v<std::decay_t<Args>> && ...)))
|
|
38
|
+
VersionNumber(Args&&... args)
|
|
39
|
+
: _vec(std::forward<Args>(args)...)
|
|
40
|
+
{
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
VersionNumber(std::initializer_list<std::int64_t> args)
|
|
44
|
+
: _vec(args)
|
|
45
|
+
{
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
AMULET_CORE_EXPORT void serialise(BinaryWriter&) const;
|
|
49
|
+
AMULET_CORE_EXPORT static VersionNumber deserialise(BinaryReader&);
|
|
50
|
+
|
|
51
|
+
// Iterators
|
|
52
|
+
std::vector<std::int64_t>::const_iterator begin() const { return _vec.begin(); }
|
|
53
|
+
std::vector<std::int64_t>::const_iterator end() const { return _vec.end(); }
|
|
54
|
+
std::vector<std::int64_t>::const_reverse_iterator rbegin() const { return _vec.rbegin(); }
|
|
55
|
+
std::vector<std::int64_t>::const_reverse_iterator rend() const { return _vec.rend(); }
|
|
56
|
+
|
|
57
|
+
// Capacity
|
|
58
|
+
size_t size() const { return _vec.size(); }
|
|
59
|
+
|
|
60
|
+
// Element access
|
|
61
|
+
std::int64_t operator[](size_t index) const
|
|
62
|
+
{
|
|
63
|
+
if (index >= _vec.size()) {
|
|
64
|
+
return 0;
|
|
65
|
+
}
|
|
66
|
+
return _vec[index];
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// Comparison
|
|
70
|
+
auto operator<=>(const VersionNumber& other) const
|
|
71
|
+
{
|
|
72
|
+
size_t max_len = std::max(_vec.size(), other.size());
|
|
73
|
+
std::int64_t v1, v2;
|
|
74
|
+
for (size_t i = 0; i < max_len; i++) {
|
|
75
|
+
v1 = (*this)[i];
|
|
76
|
+
v2 = other[i];
|
|
77
|
+
if (v1 < v2) {
|
|
78
|
+
// Less than
|
|
79
|
+
return std::strong_ordering::less;
|
|
80
|
+
}
|
|
81
|
+
if (v1 > v2) {
|
|
82
|
+
// Greater than
|
|
83
|
+
return std::strong_ordering::greater;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
// equal
|
|
87
|
+
return std::strong_ordering::equal;
|
|
88
|
+
}
|
|
89
|
+
bool operator==(const VersionNumber& other) const
|
|
90
|
+
{
|
|
91
|
+
return (*this <=> other) == 0;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// Convert the value to its string representation eg "1.1"
|
|
95
|
+
AMULET_CORE_EXPORT std::string toString() const;
|
|
96
|
+
|
|
97
|
+
// The version number with trailing zeros cut off.
|
|
98
|
+
AMULET_CORE_EXPORT std::vector<std::int64_t> cropped_version() const;
|
|
99
|
+
|
|
100
|
+
// Get the version number cropped or padded with zeros to the given length.
|
|
101
|
+
AMULET_CORE_EXPORT std::vector<std::int64_t> padded_version(size_t len) const;
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
// A class storing platform identifier and version number.
|
|
105
|
+
// Thread safe.
|
|
106
|
+
class PlatformVersionContainer {
|
|
107
|
+
private:
|
|
108
|
+
PlatformType _platform;
|
|
109
|
+
VersionNumber _version;
|
|
110
|
+
|
|
111
|
+
public:
|
|
112
|
+
// Get the platform identifier.
|
|
113
|
+
const PlatformType& get_platform() const { return _platform; }
|
|
114
|
+
|
|
115
|
+
// Get the version number.
|
|
116
|
+
const VersionNumber& get_version() const { return _version; }
|
|
117
|
+
|
|
118
|
+
template <typename PlatformT, typename VersionNumberT>
|
|
119
|
+
PlatformVersionContainer(
|
|
120
|
+
PlatformT&& platform,
|
|
121
|
+
VersionNumberT&& version)
|
|
122
|
+
: _platform(std::forward<PlatformT>(platform))
|
|
123
|
+
, _version(std::forward<VersionNumberT>(version))
|
|
124
|
+
{
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
AMULET_CORE_EXPORT void serialise(BinaryWriter&) const;
|
|
128
|
+
AMULET_CORE_EXPORT static PlatformVersionContainer deserialise(BinaryReader&);
|
|
129
|
+
|
|
130
|
+
// Comparison operators
|
|
131
|
+
auto operator<=>(const PlatformVersionContainer& other) const
|
|
132
|
+
{
|
|
133
|
+
auto cmp = _platform <=> other._platform;
|
|
134
|
+
if (cmp != 0) {
|
|
135
|
+
return cmp;
|
|
136
|
+
}
|
|
137
|
+
return _version <=> other._version;
|
|
138
|
+
}
|
|
139
|
+
bool operator==(const PlatformVersionContainer& other) const
|
|
140
|
+
{
|
|
141
|
+
return (*this <=> other) == 0;
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
// A class storing platform identifier and minimum and maximum version numbers.
|
|
146
|
+
// Thread safe.
|
|
147
|
+
class VersionRange {
|
|
148
|
+
private:
|
|
149
|
+
PlatformType _platform;
|
|
150
|
+
VersionNumber _min_version;
|
|
151
|
+
VersionNumber _max_version;
|
|
152
|
+
|
|
153
|
+
public:
|
|
154
|
+
// Get the platform identifier.
|
|
155
|
+
const PlatformType& get_platform() const { return _platform; }
|
|
156
|
+
|
|
157
|
+
// Get the minimum version number
|
|
158
|
+
const VersionNumber& get_min_version() const { return _min_version; }
|
|
159
|
+
|
|
160
|
+
// Get the maximum version number
|
|
161
|
+
const VersionNumber& get_max_version() const { return _max_version; }
|
|
162
|
+
|
|
163
|
+
template <typename PlatformT, typename MinVersionT, typename MaxVersionT>
|
|
164
|
+
VersionRange(
|
|
165
|
+
PlatformT&& platform,
|
|
166
|
+
MinVersionT&& min_version,
|
|
167
|
+
MaxVersionT&& max_version)
|
|
168
|
+
: _platform(std::forward<PlatformT>(platform))
|
|
169
|
+
, _min_version(std::forward<MinVersionT>(min_version))
|
|
170
|
+
, _max_version(std::forward<MaxVersionT>(max_version))
|
|
171
|
+
{
|
|
172
|
+
if (_min_version > _max_version) {
|
|
173
|
+
throw std::invalid_argument("min_version must be less than or equal to max_version");
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
AMULET_CORE_EXPORT void serialise(BinaryWriter&) const;
|
|
178
|
+
AMULET_CORE_EXPORT static VersionRange deserialise(BinaryReader&);
|
|
179
|
+
|
|
180
|
+
// Check if the platform is equal and the version number is within the range.
|
|
181
|
+
AMULET_CORE_EXPORT bool contains(const PlatformType& platform_, const VersionNumber& version) const;
|
|
182
|
+
|
|
183
|
+
// Equality operator
|
|
184
|
+
AMULET_CORE_EXPORT bool operator==(const VersionRange&) const;
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
// A class that contains a version range.
|
|
188
|
+
class VersionRangeContainer {
|
|
189
|
+
private:
|
|
190
|
+
VersionRange _version_range;
|
|
191
|
+
|
|
192
|
+
public:
|
|
193
|
+
// Get the version range.
|
|
194
|
+
const VersionRange& get_version_range() const { return _version_range; }
|
|
195
|
+
|
|
196
|
+
template <typename VersionRangeT>
|
|
197
|
+
VersionRangeContainer(
|
|
198
|
+
VersionRangeT&& version_range)
|
|
199
|
+
: _version_range(std::forward<VersionRangeT>(version_range))
|
|
200
|
+
{
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
AMULET_CORE_EXPORT void serialise(BinaryWriter&) const;
|
|
204
|
+
AMULET_CORE_EXPORT static VersionRangeContainer deserialise(BinaryReader&);
|
|
205
|
+
};
|
|
206
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: amulet-core
|
|
3
|
+
Version: 2.0.7a0
|
|
4
|
+
Summary: A Python library for reading/writing Minecraft's various save formats.
|
|
5
|
+
Author: James Clare, Ben Gothard
|
|
6
|
+
Project-URL: Homepage, https://www.amuletmc.com
|
|
7
|
+
Project-URL: Repository, https://github.com/Amulet-Team/Amulet-Core
|
|
8
|
+
Project-URL: Issues, https://github.com/Amulet-Team/Amulet-Core/issues
|
|
9
|
+
Classifier: Programming Language :: Python :: 3
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Requires-Python: >=3.11
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
Requires-Dist: amulet-compiler-target==2.0
|
|
14
|
+
Requires-Dist: amulet-compiler-version==4.309027957683952396889703.17
|
|
15
|
+
Requires-Dist: pybind11==3.0.1
|
|
16
|
+
Requires-Dist: amulet-pybind11-extensions~=1.2.0.0a2
|
|
17
|
+
Requires-Dist: amulet-io~=1.0.1.0
|
|
18
|
+
Requires-Dist: amulet-utils~=1.1.3.0a6
|
|
19
|
+
Requires-Dist: amulet-zlib~=1.0.8.0a4
|
|
20
|
+
Requires-Dist: amulet-nbt~=5.0.2.0a4
|
|
21
|
+
Requires-Dist: numpy~=2.0
|
|
22
|
+
Provides-Extra: docs
|
|
23
|
+
Requires-Dist: Sphinx>=1.7.4; extra == "docs"
|
|
24
|
+
Requires-Dist: sphinx-autodoc-typehints>=1.3.0; extra == "docs"
|
|
25
|
+
Requires-Dist: sphinx_rtd_theme>=0.3.1; extra == "docs"
|
|
26
|
+
Provides-Extra: dev
|
|
27
|
+
Requires-Dist: setuptools>=42; extra == "dev"
|
|
28
|
+
Requires-Dist: types-setuptools; extra == "dev"
|
|
29
|
+
Requires-Dist: versioneer; extra == "dev"
|
|
30
|
+
Requires-Dist: types-versioneer; extra == "dev"
|
|
31
|
+
Requires-Dist: packaging; extra == "dev"
|
|
32
|
+
Requires-Dist: wheel; extra == "dev"
|
|
33
|
+
Requires-Dist: pybind11_stubgen>=2.5.4; extra == "dev"
|
|
34
|
+
Requires-Dist: black>=22.3; extra == "dev"
|
|
35
|
+
Requires-Dist: isort; extra == "dev"
|
|
36
|
+
Requires-Dist: autoflake; extra == "dev"
|
|
37
|
+
Requires-Dist: mypy; extra == "dev"
|
|
38
|
+
Requires-Dist: types-pyinstaller; extra == "dev"
|
|
39
|
+
Requires-Dist: amulet-test-utils~=1.3; extra == "dev"
|
|
40
|
+
Dynamic: requires-dist
|
|
41
|
+
|
|
42
|
+
# Amulet Core
|
|
43
|
+
|
|
44
|
+

|
|
45
|
+

|
|
46
|
+

|
|
47
|
+
[](https://amulet-core.readthedocs.io)
|
|
48
|
+
|
|
49
|
+
A Python 3 library to read and write data from Minecraft's various save formats.
|
|
50
|
+
|
|
51
|
+
This library provides the main world editing functionality for Amulet Map Editor
|
|
52
|
+
|
|
53
|
+
#### If you are looking for the actual editor it can be found at [Amulet Map Editor](https://github.com/Amulet-Team/Amulet-Map-Editor)
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
## Documentation
|
|
57
|
+
|
|
58
|
+
Our online documentation can be found here: https://amulet-core.readthedocs.io
|
|
59
|
+
|
|
60
|
+
## Installing
|
|
61
|
+
1) Install Python 3.7
|
|
62
|
+
2) We recommend setting up a [python virtual environment](https://docs.python.org/3/tutorial/venv.html) so you don't run into issues with dependency conflicts.
|
|
63
|
+
3) run `pip install amulet-core` to install the library and all its dependencies.
|
|
64
|
+
|
|
65
|
+
## Dependencies
|
|
66
|
+
|
|
67
|
+
This library uses a number of other libraries. These will be automatically installed when running the command above.
|
|
68
|
+
- Numpy
|
|
69
|
+
- [Amulet_NBT](https://github.com/Amulet-Team/Amulet-NBT)
|
|
70
|
+
- [PyMCTranslate](https://github.com/gentlegiantJGC/PyMCTranslate)
|
|
71
|
+
|
|
72
|
+
## Contributing
|
|
73
|
+
|
|
74
|
+
### For Development
|
|
75
|
+
Download the code to your computer, install python and run the following command from the root directory.
|
|
76
|
+
run `pip install -e .[dev]`
|
|
77
|
+
This command will install the library in development mode with the libraries required for development.
|
|
78
|
+
- [Black](https://github.com/ambv/black) (Required for formatting)
|
|
79
|
+
- Must be run before pushing a Pull Request
|
|
80
|
+
|
|
81
|
+
For information about contributing to this project, please see the contribution section [below](#contributing)
|
|
82
|
+
|
|
83
|
+
### Code Formatting
|
|
84
|
+
For code formatting, we use the formatting utility [black](https://github.com/psf/black).
|
|
85
|
+
To run it, run the following command from your favorite terminal after installing: `black amulet tests`
|
|
86
|
+
|
|
87
|
+
In order for your pull request to be accepted, this command must be run to format every file.
|
|
88
|
+
|
|
89
|
+
### Building the Documentation
|
|
90
|
+
To build the documentation locally, run the following command: `make html` and then navigate to the
|
|
91
|
+
generated directory `docs_build/html` in your favorite web browser
|
|
92
|
+
|
|
93
|
+
### Branch Naming
|
|
94
|
+
Branches should be created when a certain bug or feature may take multiple attempts to fix. Naming
|
|
95
|
+
them should follow the following convention (even for forked repositories when a pull request is being made):
|
|
96
|
+
|
|
97
|
+
* For features, use: `impl-<feature name>`
|
|
98
|
+
* For bug fixes, use: `bug-<bug tracker ID>`
|
|
99
|
+
* For improvements/rewrites, use: `improv-<feature name>`
|
|
100
|
+
* For prototyping, use: `proto-<feature name>`
|
|
101
|
+
|
|
102
|
+
### Pull Requests
|
|
103
|
+
We ask that submitted Pull Requests give moderately detailed notes about the changes and explain
|
|
104
|
+
any changes that were made to the program outside of those directly related to the feature/bug-fix.
|
|
105
|
+
Make sure to run all tests and formatting otherwise we cannot accept your pull request.
|
|
106
|
+
|
|
107
|
+
_Note: We will also re-run all tests before reviewing, this is to mitigate additional changes/commits
|
|
108
|
+
needed to pass all tests._
|
|
109
|
+
|
|
110
|
+
Once a Pull Request is submitted, we will mark the request for review, once that is done, we will
|
|
111
|
+
review the changes and provide any notes/things to change. Once all additional changes have been made,
|
|
112
|
+
we will merge the request.
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
amulet/core/__init__.py,sha256=JQpKBz0y0Q-c4zdSv7gZc1m-Tr9GEbBSfvzfqFwrG40,940
|
|
2
|
+
amulet/core/__init__.pyi,sha256=N4xBZJAyanS_IgNA0Q_8p6MDHtt5I3ztV8fwLbYb7Ww,425
|
|
3
|
+
amulet/core/_amulet_core.cpython-312-darwin.so,sha256=C3d5RFDy9ayBujb0jisXvmIo7gphQTlAfbMk0cdc_iE,3998112
|
|
4
|
+
amulet/core/_amulet_core.pyi,sha256=PpYXEiMl6KyjsXhxV3ttyyO4KdF1qxNiie-0CJNIEf8,124
|
|
5
|
+
amulet/core/_version.py,sha256=ED8M-85D5vmlV9aiGKdbU3DC8JbUOWY1AUxFnfGgeh0,499
|
|
6
|
+
amulet/core/amulet_coreConfig.cmake,sha256=2US5pjw9MQiPAdcXNMR0Sw3vqhRUXNezlCa74Fh1lKQ,964
|
|
7
|
+
amulet/core/dll.hpp,sha256=_c9iVJsleEm4wqsbzZr18mJng7CjcNeHk3Uc0uyphVY,565
|
|
8
|
+
amulet/core/libamulet_core.dylib,sha256=dP2jsySe8MW9TMTkQHGoFwLhE_CoObU9UIP1bnoGDvQ,3578776
|
|
9
|
+
amulet/core/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10
|
+
amulet/core/__pyinstaller/__init__.py,sha256=D1_UuaYmG8_m59EtvoWT0apEUDJigfFPskLnnnzG9dw,54
|
|
11
|
+
amulet/core/__pyinstaller/hook-amulet.core.py,sha256=Byk3AkxwTBUi5bfCYQ3tAm9JWpEborm5Jz8B813ZBjQ,168
|
|
12
|
+
amulet/core/biome/__init__.pyi,sha256=yamCRyeQjj0ecTMb-gerRpWljNEcoElKCqWDq5NkqPs,2095
|
|
13
|
+
amulet/core/biome/biome.hpp,sha256=2yIagr579svGynHX35VkJWKM7ZAQj4D-lX126LZpO7w,1486
|
|
14
|
+
amulet/core/block/__init__.pyi,sha256=P-r33wW-WaQG9J2N9bf1pAusDr3EQixmI-1Jgufq4OA,9406
|
|
15
|
+
amulet/core/block/block.hpp,sha256=M6fgE37_VkO_hcoBbt-_YCHILdrtdsp_uzMY44xXYNw,4546
|
|
16
|
+
amulet/core/block_entity/__init__.pyi,sha256=XYWdIC5BshWO-EFIIxupwkS9dq9BkmUdCb7rRxwMTyc,2094
|
|
17
|
+
amulet/core/block_entity/block_entity.hpp,sha256=SWVk6o0De2BJfWxomI4oWEDhvsFaFmPNcd5iiybWdJ0,2193
|
|
18
|
+
amulet/core/chunk/__init__.pyi,sha256=vkIH7g81ZNH_Jx2mC0A2diRNe4s_T0PEm-uCuhnQX4U,1890
|
|
19
|
+
amulet/core/chunk/chunk.hpp,sha256=TbdYHODG7pPpwk1i7DfvNxX9U4Nvkt1O4Hc4yVheipw,3789
|
|
20
|
+
amulet/core/chunk/component/__init__.pyi,sha256=8MV30__Joo3wqOZqb_PklZBfbJtgLqK-QGA2EtNWk8Q,418
|
|
21
|
+
amulet/core/chunk/component/biome_3d_component.hpp,sha256=5jvWj3Nj081883H-3YibDo4oAbxxKpaQKQpdzQ5lzoE,3144
|
|
22
|
+
amulet/core/chunk/component/block_component.hpp,sha256=r0dBakayW6cbSRVeghkVHKZrSmZO0IK8nszKsa0C_aw,3222
|
|
23
|
+
amulet/core/chunk/component/block_component.pyi,sha256=rcRum530zmiC2FlzzlxY65mOCyYlVJj1bEq0z1fes2Y,857
|
|
24
|
+
amulet/core/chunk/component/block_entity_component.hpp,sha256=nN_4r3hNgrf2bMlMY-odlgQJjz9woZPNBnJy8b5e0p0,3779
|
|
25
|
+
amulet/core/chunk/component/section_array_map.hpp,sha256=xsJwaoSBm3LufVZ5oQCB5CGonTDNR8jJ47tUUM-c5NI,5070
|
|
26
|
+
amulet/core/chunk/component/section_array_map.pyi,sha256=d6eI1T582IVOL5CXU0441WgO_6REYafAjs_KOy-pFHQ,3866
|
|
27
|
+
amulet/core/entity/__init__.pyi,sha256=FW9S3L1fSoV0VSd0dWTtiJGH41UlQ4qjJfPMmeJsFUQ,2571
|
|
28
|
+
amulet/core/entity/entity.hpp,sha256=ieYDVtbfvIQ6tOKIp24O3-Ds9V41_0kWQGLVvxWLsdo,2811
|
|
29
|
+
amulet/core/palette/__init__.pyi,sha256=MPYCwnZrUPnG8-aE88W1_7f24hPvJZBvio_epeRHyKA,287
|
|
30
|
+
amulet/core/palette/biome_palette.hpp,sha256=Cl-wx_kNvI519GfO0qTl0Jti-TvXJh0kfLWJaRkzXyE,1968
|
|
31
|
+
amulet/core/palette/biome_palette.pyi,sha256=VFuWDGRKBZEiPw6SSKWGGKbW8Mtv0hyEeeiGEYwI8aA,1795
|
|
32
|
+
amulet/core/palette/block_palette.hpp,sha256=z14VBS_AEdxHHGqO4AmvuYtAZbG6LaWdFbmHFs-NkvQ,2236
|
|
33
|
+
amulet/core/palette/block_palette.pyi,sha256=chMssE4RZPay3rf57Oj_QBE1e659COwtLx0ndfHMLhw,1923
|
|
34
|
+
amulet/core/selection/__init__.pyi,sha256=ut5ZvzPHcHllpL2WqBmGJEfq6B2ujhW7PiMJeiv9Z78,719
|
|
35
|
+
amulet/core/selection/box.hpp,sha256=UetYyAZt6xnmzowfVR1BNOfC9Q4uVixu9kvwS3P4-3E,3106
|
|
36
|
+
amulet/core/selection/box.pyi,sha256=2dCke2AIZ_9iHFXvSL0FQDLhCJmY9bIpGB4ekUZ6VlQ,6927
|
|
37
|
+
amulet/core/selection/box_group.hpp,sha256=MIdIPm9Xgzo3xJwACrrgu3uocvF6zFmaLZamBdXJurY,2172
|
|
38
|
+
amulet/core/selection/box_group.pyi,sha256=-ZY8od30co_GNiM0WBnZB7crkFEft7eYr9FoUjsYoPA,6566
|
|
39
|
+
amulet/core/selection/cuboid.hpp,sha256=8wqbFXmhy7jWu6TvVFdH_6txC0LAT_JnHuoVaocRMq0,1096
|
|
40
|
+
amulet/core/selection/cuboid.pyi,sha256=J-ZsEAveL6I8_sPwXYrSQAh4dO-q4NeLPoUIoKE1DD8,1512
|
|
41
|
+
amulet/core/selection/ellipsoid.hpp,sha256=26GUv6-puhzY_O4OkA8qVaSz91_MZ5iMmvnIyvdAiRE,1198
|
|
42
|
+
amulet/core/selection/ellipsoid.pyi,sha256=44028_5-5ALuB-XfYyt3gXDzE12UkkghMCF_lkbZp88,1445
|
|
43
|
+
amulet/core/selection/shape.hpp,sha256=y6L5hDd-xrnrMWOxCTdkmq50o0B9BNnCUVUaYe-MbYQ,1947
|
|
44
|
+
amulet/core/selection/shape.pyi,sha256=QK44CDJkju0xFOEvca8po61VHrB2Z94nrJaQ1MKFCH4,1491
|
|
45
|
+
amulet/core/selection/shape_group.hpp,sha256=hSzaRlQeq6HPAPkiQYoSMAMxrFba4QQNH10ytZVTpfc,1785
|
|
46
|
+
amulet/core/selection/shape_group.pyi,sha256=ZTF9vJg-RwkhPL61umOyghuT2eW23VkhgKswu--wZM4,3809
|
|
47
|
+
amulet/core/version/__init__.pyi,sha256=0xMOcs7fynOPSRof0yiNkQBp7yoPT-B_IKJPFmNpd2c,4148
|
|
48
|
+
amulet/core/version/version.hpp,sha256=iHPkgrATZswMmE8chn0ZcVO-KVUU1QtlwxQqk8gAAoY,6393
|
|
49
|
+
amulet_core-2.0.7a0.dist-info/METADATA,sha256=1O9Y2DjIdcNoz-e0_GpKbAnpYgDXjTQuGEeiEv4mDDs,5025
|
|
50
|
+
amulet_core-2.0.7a0.dist-info/WHEEL,sha256=DrI-inJlZGR_w5tvDEYdoeg1yM0ECr55HXrOuFDI4nI,115
|
|
51
|
+
amulet_core-2.0.7a0.dist-info/entry_points.txt,sha256=a64mqk_dgbzVyk-pz0WKpK6kNAhIGdVT9DO2VqDIAc8,68
|
|
52
|
+
amulet_core-2.0.7a0.dist-info/top_level.txt,sha256=3ZqHzNDiIb9kV8TwSeeXxK_9haSrsu631Qe4ndDo0rc,7
|
|
53
|
+
amulet_core-2.0.7a0.dist-info/RECORD,,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
amulet
|