amulet-core 2.0.4a0__tar.gz → 2.0.5a0__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.
- {amulet_core-2.0.4a0 → amulet_core-2.0.5a0}/CMakeLists.txt +11 -2
- {amulet_core-2.0.4a0/src/amulet_core.egg-info → amulet_core-2.0.5a0}/PKG-INFO +6 -5
- {amulet_core-2.0.4a0 → amulet_core-2.0.5a0}/get_compiler/__init__.py +2 -2
- {amulet_core-2.0.4a0 → amulet_core-2.0.5a0}/pyproject.toml +1 -1
- {amulet_core-2.0.4a0 → amulet_core-2.0.5a0}/requirements.py +47 -34
- {amulet_core-2.0.4a0 → amulet_core-2.0.5a0}/setup.py +3 -38
- {amulet_core-2.0.4a0 → amulet_core-2.0.5a0}/src/amulet/core/__init__.py +1 -0
- {amulet_core-2.0.4a0 → amulet_core-2.0.5a0}/src/amulet/core/__init__.pyi +1 -1
- {amulet_core-2.0.4a0 → amulet_core-2.0.5a0}/src/amulet/core/_amulet_core.py.cpp +1 -0
- {amulet_core-2.0.4a0 → amulet_core-2.0.5a0}/src/amulet/core/_amulet_core.pyi +1 -1
- {amulet_core-2.0.4a0 → amulet_core-2.0.5a0}/src/amulet/core/_version.py +3 -3
- {amulet_core-2.0.4a0 → amulet_core-2.0.5a0}/src/amulet/core/amulet_coreConfig.cmake +2 -0
- {amulet_core-2.0.4a0 → amulet_core-2.0.5a0}/src/amulet/core/biome/__init__.pyi +1 -1
- {amulet_core-2.0.4a0 → amulet_core-2.0.5a0}/src/amulet/core/block/__init__.pyi +1 -1
- {amulet_core-2.0.4a0 → amulet_core-2.0.5a0}/src/amulet/core/block_entity/__init__.pyi +1 -1
- {amulet_core-2.0.4a0 → amulet_core-2.0.5a0}/src/amulet/core/chunk/__init__.pyi +1 -1
- {amulet_core-2.0.4a0 → amulet_core-2.0.5a0}/src/amulet/core/chunk/component/__init__.pyi +1 -1
- {amulet_core-2.0.4a0 → amulet_core-2.0.5a0}/src/amulet/core/chunk/component/block_component.pyi +1 -1
- {amulet_core-2.0.4a0 → amulet_core-2.0.5a0}/src/amulet/core/chunk/component/section_array_map.pyi +1 -1
- {amulet_core-2.0.4a0 → amulet_core-2.0.5a0}/src/amulet/core/entity/__init__.pyi +1 -1
- {amulet_core-2.0.4a0 → amulet_core-2.0.5a0}/src/amulet/core/palette/__init__.pyi +1 -1
- {amulet_core-2.0.4a0 → amulet_core-2.0.5a0}/src/amulet/core/palette/biome_palette.pyi +1 -1
- {amulet_core-2.0.4a0 → amulet_core-2.0.5a0}/src/amulet/core/palette/block_palette.pyi +1 -1
- amulet_core-2.0.5a0/src/amulet/core/selection/__init__.pyi +25 -0
- amulet_core-2.0.5a0/src/amulet/core/selection/__init_selection.py.cpp +50 -0
- {amulet_core-2.0.4a0 → amulet_core-2.0.5a0}/src/amulet/core/selection/box.cpp +43 -3
- {amulet_core-2.0.4a0 → amulet_core-2.0.5a0}/src/amulet/core/selection/box.hpp +27 -16
- amulet_core-2.0.5a0/src/amulet/core/selection/box.py.cpp +304 -0
- {amulet_core-2.0.4a0 → amulet_core-2.0.5a0}/src/amulet/core/selection/box.pyi +18 -8
- amulet_core-2.0.4a0/src/amulet/core/selection/group.cpp → amulet_core-2.0.5a0/src/amulet/core/selection/box_group.cpp +35 -26
- amulet_core-2.0.5a0/src/amulet/core/selection/box_group.hpp +89 -0
- amulet_core-2.0.5a0/src/amulet/core/selection/box_group.py.cpp +297 -0
- amulet_core-2.0.4a0/src/amulet/core/selection/group.pyi → amulet_core-2.0.5a0/src/amulet/core/selection/box_group.pyi +29 -33
- amulet_core-2.0.5a0/src/amulet/core/selection/cuboid.cpp +205 -0
- amulet_core-2.0.5a0/src/amulet/core/selection/cuboid.hpp +36 -0
- amulet_core-2.0.5a0/src/amulet/core/selection/cuboid.py.cpp +59 -0
- amulet_core-2.0.5a0/src/amulet/core/selection/cuboid.pyi +48 -0
- amulet_core-2.0.5a0/src/amulet/core/selection/ellipsoid.cpp +160 -0
- amulet_core-2.0.5a0/src/amulet/core/selection/ellipsoid.hpp +37 -0
- amulet_core-2.0.5a0/src/amulet/core/selection/ellipsoid.py.cpp +57 -0
- amulet_core-2.0.5a0/src/amulet/core/selection/ellipsoid.pyi +46 -0
- amulet_core-2.0.5a0/src/amulet/core/selection/shape.cpp +21 -0
- amulet_core-2.0.5a0/src/amulet/core/selection/shape.hpp +53 -0
- amulet_core-2.0.5a0/src/amulet/core/selection/shape.py.cpp +47 -0
- amulet_core-2.0.5a0/src/amulet/core/selection/shape.pyi +39 -0
- amulet_core-2.0.5a0/src/amulet/core/selection/shape_group.cpp +27 -0
- amulet_core-2.0.5a0/src/amulet/core/selection/shape_group.hpp +61 -0
- amulet_core-2.0.5a0/src/amulet/core/selection/shape_group.py.cpp +90 -0
- amulet_core-2.0.5a0/src/amulet/core/selection/shape_group.pyi +60 -0
- {amulet_core-2.0.4a0 → amulet_core-2.0.5a0}/src/amulet/core/version/__init__.pyi +1 -1
- {amulet_core-2.0.4a0 → amulet_core-2.0.5a0/src/amulet_core.egg-info}/PKG-INFO +6 -5
- {amulet_core-2.0.4a0 → amulet_core-2.0.5a0}/src/amulet_core.egg-info/SOURCES.txt +21 -3
- {amulet_core-2.0.4a0 → amulet_core-2.0.5a0}/src/amulet_core.egg-info/requires.txt +5 -4
- amulet_core-2.0.4a0/src/amulet/core/selection/__init__.pyi +0 -8
- amulet_core-2.0.4a0/src/amulet/core/selection/__init_selection.py.cpp +0 -598
- amulet_core-2.0.4a0/src/amulet/core/selection/group.hpp +0 -80
- {amulet_core-2.0.4a0 → amulet_core-2.0.5a0}/MANIFEST.in +0 -0
- {amulet_core-2.0.4a0 → amulet_core-2.0.5a0}/README.md +0 -0
- {amulet_core-2.0.4a0 → amulet_core-2.0.5a0}/build_requires.py +0 -0
- {amulet_core-2.0.4a0 → amulet_core-2.0.5a0}/get_compiler/CMakeLists.txt +0 -0
- {amulet_core-2.0.4a0 → amulet_core-2.0.5a0}/setup.cfg +0 -0
- {amulet_core-2.0.4a0 → amulet_core-2.0.5a0}/src/amulet/core/__pyinstaller/__init__.py +0 -0
- {amulet_core-2.0.4a0 → amulet_core-2.0.5a0}/src/amulet/core/__pyinstaller/hook-amulet.core.py +0 -0
- {amulet_core-2.0.4a0 → amulet_core-2.0.5a0}/src/amulet/core/biome/biome.cpp +0 -0
- {amulet_core-2.0.4a0 → amulet_core-2.0.5a0}/src/amulet/core/biome/biome.hpp +0 -0
- {amulet_core-2.0.4a0 → amulet_core-2.0.5a0}/src/amulet/core/biome/biome.py.cpp +0 -0
- {amulet_core-2.0.4a0 → amulet_core-2.0.5a0}/src/amulet/core/block/block.cpp +0 -0
- {amulet_core-2.0.4a0 → amulet_core-2.0.5a0}/src/amulet/core/block/block.hpp +0 -0
- {amulet_core-2.0.4a0 → amulet_core-2.0.5a0}/src/amulet/core/block/block.py.cpp +0 -0
- {amulet_core-2.0.4a0 → amulet_core-2.0.5a0}/src/amulet/core/block_entity/block_entity.cpp +0 -0
- {amulet_core-2.0.4a0 → amulet_core-2.0.5a0}/src/amulet/core/block_entity/block_entity.hpp +0 -0
- {amulet_core-2.0.4a0 → amulet_core-2.0.5a0}/src/amulet/core/block_entity/block_entity.py.cpp +0 -0
- {amulet_core-2.0.4a0 → amulet_core-2.0.5a0}/src/amulet/core/chunk/chunk.cpp +0 -0
- {amulet_core-2.0.4a0 → amulet_core-2.0.5a0}/src/amulet/core/chunk/chunk.hpp +0 -0
- {amulet_core-2.0.4a0 → amulet_core-2.0.5a0}/src/amulet/core/chunk/chunk.py.cpp +0 -0
- {amulet_core-2.0.4a0 → amulet_core-2.0.5a0}/src/amulet/core/chunk/component/__init_chunk_components.py.cpp +0 -0
- {amulet_core-2.0.4a0 → amulet_core-2.0.5a0}/src/amulet/core/chunk/component/biome_3d_component.cpp +0 -0
- {amulet_core-2.0.4a0 → amulet_core-2.0.5a0}/src/amulet/core/chunk/component/biome_3d_component.hpp +0 -0
- {amulet_core-2.0.4a0 → amulet_core-2.0.5a0}/src/amulet/core/chunk/component/block_component.cpp +0 -0
- {amulet_core-2.0.4a0 → amulet_core-2.0.5a0}/src/amulet/core/chunk/component/block_component.hpp +0 -0
- {amulet_core-2.0.4a0 → amulet_core-2.0.5a0}/src/amulet/core/chunk/component/block_component.py.cpp +0 -0
- {amulet_core-2.0.4a0 → amulet_core-2.0.5a0}/src/amulet/core/chunk/component/block_entity_component.cpp +0 -0
- {amulet_core-2.0.4a0 → amulet_core-2.0.5a0}/src/amulet/core/chunk/component/block_entity_component.hpp +0 -0
- {amulet_core-2.0.4a0 → amulet_core-2.0.5a0}/src/amulet/core/chunk/component/section_array_map.cpp +0 -0
- {amulet_core-2.0.4a0 → amulet_core-2.0.5a0}/src/amulet/core/chunk/component/section_array_map.hpp +0 -0
- {amulet_core-2.0.4a0 → amulet_core-2.0.5a0}/src/amulet/core/chunk/component/section_array_map.py.cpp +0 -0
- {amulet_core-2.0.4a0 → amulet_core-2.0.5a0}/src/amulet/core/dll.hpp +0 -0
- {amulet_core-2.0.4a0 → amulet_core-2.0.5a0}/src/amulet/core/entity/entity.cpp +0 -0
- {amulet_core-2.0.4a0 → amulet_core-2.0.5a0}/src/amulet/core/entity/entity.hpp +0 -0
- {amulet_core-2.0.4a0 → amulet_core-2.0.5a0}/src/amulet/core/entity/entity.py.cpp +0 -0
- {amulet_core-2.0.4a0 → amulet_core-2.0.5a0}/src/amulet/core/palette/__init_palette.py.cpp +0 -0
- {amulet_core-2.0.4a0 → amulet_core-2.0.5a0}/src/amulet/core/palette/biome_palette.cpp +0 -0
- {amulet_core-2.0.4a0 → amulet_core-2.0.5a0}/src/amulet/core/palette/biome_palette.hpp +0 -0
- {amulet_core-2.0.4a0 → amulet_core-2.0.5a0}/src/amulet/core/palette/biome_palette.py.cpp +0 -0
- {amulet_core-2.0.4a0 → amulet_core-2.0.5a0}/src/amulet/core/palette/block_palette.cpp +0 -0
- {amulet_core-2.0.4a0 → amulet_core-2.0.5a0}/src/amulet/core/palette/block_palette.hpp +0 -0
- {amulet_core-2.0.4a0 → amulet_core-2.0.5a0}/src/amulet/core/palette/block_palette.py.cpp +0 -0
- {amulet_core-2.0.4a0 → amulet_core-2.0.5a0}/src/amulet/core/py.typed +0 -0
- {amulet_core-2.0.4a0 → amulet_core-2.0.5a0}/src/amulet/core/version/version.cpp +0 -0
- {amulet_core-2.0.4a0 → amulet_core-2.0.5a0}/src/amulet/core/version/version.hpp +0 -0
- {amulet_core-2.0.4a0 → amulet_core-2.0.5a0}/src/amulet/core/version/version.py.cpp +0 -0
- {amulet_core-2.0.4a0 → amulet_core-2.0.5a0}/src/amulet_core.egg-info/dependency_links.txt +0 -0
- {amulet_core-2.0.4a0 → amulet_core-2.0.5a0}/src/amulet_core.egg-info/entry_points.txt +0 -0
- {amulet_core-2.0.4a0 → amulet_core-2.0.5a0}/src/amulet_core.egg-info/top_level.txt +0 -0
|
@@ -3,6 +3,7 @@ cmake_minimum_required(VERSION 3.13)
|
|
|
3
3
|
project(amulet_core LANGUAGES CXX)
|
|
4
4
|
|
|
5
5
|
set(amulet_core_DIR ${CMAKE_CURRENT_LIST_DIR}/src/amulet/core CACHE PATH "")
|
|
6
|
+
set(BUILD_AMULET_CORE_TESTS OFF CACHE BOOL "Should tests be built?")
|
|
6
7
|
|
|
7
8
|
# Set C++20
|
|
8
9
|
set(CMAKE_CXX_STANDARD 20)
|
|
@@ -15,8 +16,10 @@ if (WIN32)
|
|
|
15
16
|
add_definitions(-D_WIN32_WINNT=0x0601)
|
|
16
17
|
elseif(APPLE)
|
|
17
18
|
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.15")
|
|
18
|
-
|
|
19
|
+
elseif(UNIX)
|
|
19
20
|
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
|
21
|
+
else()
|
|
22
|
+
message( FATAL_ERROR "Unsupported platform. Please submit a pull request to support this platform." )
|
|
20
23
|
endif()
|
|
21
24
|
|
|
22
25
|
if (MSVC)
|
|
@@ -33,6 +36,9 @@ endif()
|
|
|
33
36
|
if (NOT TARGET amulet_io)
|
|
34
37
|
find_package(amulet_io CONFIG REQUIRED)
|
|
35
38
|
endif()
|
|
39
|
+
if (NOT TARGET amulet_utils)
|
|
40
|
+
find_package(amulet_utils CONFIG REQUIRED)
|
|
41
|
+
endif()
|
|
36
42
|
if (NOT TARGET amulet_nbt)
|
|
37
43
|
find_package(amulet_nbt CONFIG REQUIRED)
|
|
38
44
|
endif()
|
|
@@ -49,7 +55,10 @@ list(REMOVE_ITEM HEADERS ${EXTENSION_HEADERS})
|
|
|
49
55
|
# Add implementation
|
|
50
56
|
add_library(amulet_core SHARED)
|
|
51
57
|
target_compile_definitions(amulet_core PRIVATE ExportAmuletCore)
|
|
58
|
+
target_link_libraries(amulet_core PUBLIC pybind11::module)
|
|
59
|
+
target_link_libraries(amulet_core PUBLIC amulet_pybind11_extensions)
|
|
52
60
|
target_link_libraries(amulet_core PUBLIC amulet_io)
|
|
61
|
+
target_link_libraries(amulet_core PUBLIC amulet_utils)
|
|
53
62
|
target_link_libraries(amulet_core PUBLIC amulet_nbt)
|
|
54
63
|
target_include_directories(amulet_core PUBLIC ${SOURCE_PATH})
|
|
55
64
|
target_sources(amulet_core PRIVATE ${SOURCES} ${HEADERS})
|
|
@@ -84,6 +93,6 @@ endif()
|
|
|
84
93
|
install(TARGETS amulet_core DESTINATION ${amulet_core_DIR})
|
|
85
94
|
install(TARGETS _amulet_core DESTINATION ${AMULET_CORE_EXT_DIR})
|
|
86
95
|
|
|
87
|
-
if (
|
|
96
|
+
if (BUILD_AMULET_CORE_TESTS)
|
|
88
97
|
add_subdirectory(tests)
|
|
89
98
|
endif()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: amulet-core
|
|
3
|
-
Version: 2.0.
|
|
3
|
+
Version: 2.0.5a0
|
|
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
|
|
@@ -11,12 +11,13 @@ Classifier: Operating System :: OS Independent
|
|
|
11
11
|
Requires-Python: >=3.11
|
|
12
12
|
Description-Content-Type: text/markdown
|
|
13
13
|
Requires-Dist: amulet-compiler-target==2.0
|
|
14
|
-
Requires-Dist: amulet-compiler-version==
|
|
14
|
+
Requires-Dist: amulet-compiler-version==4.309027957683952396889703.17
|
|
15
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-
|
|
19
|
-
Requires-Dist: amulet-
|
|
18
|
+
Requires-Dist: amulet-utils~=1.1.3.0a0
|
|
19
|
+
Requires-Dist: amulet-zlib~=1.0.8.0a0
|
|
20
|
+
Requires-Dist: amulet-nbt~=5.0.2.0a0
|
|
20
21
|
Requires-Dist: numpy~=2.0
|
|
21
22
|
Provides-Extra: docs
|
|
22
23
|
Requires-Dist: Sphinx>=1.7.4; extra == "docs"
|
|
@@ -34,7 +35,7 @@ Requires-Dist: isort; extra == "dev"
|
|
|
34
35
|
Requires-Dist: autoflake; extra == "dev"
|
|
35
36
|
Requires-Dist: mypy; extra == "dev"
|
|
36
37
|
Requires-Dist: types-pyinstaller; extra == "dev"
|
|
37
|
-
Requires-Dist: amulet-test-utils~=1.
|
|
38
|
+
Requires-Dist: amulet-test-utils~=1.3; extra == "dev"
|
|
38
39
|
Dynamic: requires-dist
|
|
39
40
|
|
|
40
41
|
# Amulet Core
|
|
@@ -20,7 +20,7 @@ def main() -> str:
|
|
|
20
20
|
with open(os.path.join(Dir, "build", "compiler_id.txt")) as f:
|
|
21
21
|
compiler_id_str = f.read().strip()
|
|
22
22
|
with open(os.path.join(Dir, "build", "compiler_version.txt")) as f:
|
|
23
|
-
compiler_version = f.read().strip()
|
|
23
|
+
compiler_version = f.read().strip().split(".", 1)[0]
|
|
24
24
|
|
|
25
25
|
# convert the compiler id to an int so it can be used in a version number
|
|
26
26
|
compiler_id_int = 0
|
|
@@ -29,4 +29,4 @@ def main() -> str:
|
|
|
29
29
|
compiler_id_int += b
|
|
30
30
|
|
|
31
31
|
# combine the compiler id and compiler version into a version number
|
|
32
|
-
return f"==
|
|
32
|
+
return f"==4.{compiler_id_int}.{compiler_version}"
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import os
|
|
2
2
|
from packaging.version import Version
|
|
3
|
+
import get_compiler
|
|
3
4
|
|
|
4
5
|
AMULET_COMPILER_TARGET_REQUIREMENT = "==2.0"
|
|
5
|
-
AMULET_COMPILER_VERSION_REQUIREMENT = "==3.0.0"
|
|
6
6
|
|
|
7
7
|
PYBIND11_REQUIREMENT = "==3.0.0"
|
|
8
8
|
AMULET_PYBIND11_EXTENSIONS_REQUIREMENT = "~=1.1.0.0a0"
|
|
9
9
|
AMULET_IO_REQUIREMENT = "~=1.0"
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
AMULET_UTILS_REQUIREMENT = "~=1.1.3.0a0"
|
|
11
|
+
AMULET_ZLIB_REQUIREMENT = "~=1.0.8.0a0"
|
|
12
|
+
AMULET_NBT_REQUIREMENT = "~=5.0.2.0a0"
|
|
12
13
|
NUMPY_REQUIREMENT = "~=2.0"
|
|
13
14
|
|
|
14
15
|
if os.environ.get("AMULET_PYBIND11_EXTENSIONS_REQUIREMENT", None):
|
|
@@ -19,6 +20,11 @@ if os.environ.get("AMULET_IO_REQUIREMENT", None):
|
|
|
19
20
|
f"{AMULET_IO_REQUIREMENT},{os.environ['AMULET_IO_REQUIREMENT']}"
|
|
20
21
|
)
|
|
21
22
|
|
|
23
|
+
if os.environ.get("AMULET_UTILS_REQUIREMENT", None):
|
|
24
|
+
AMULET_UTILS_REQUIREMENT = (
|
|
25
|
+
f"{AMULET_UTILS_REQUIREMENT},{os.environ['AMULET_UTILS_REQUIREMENT']}"
|
|
26
|
+
)
|
|
27
|
+
|
|
22
28
|
if os.environ.get("AMULET_ZLIB_REQUIREMENT", None):
|
|
23
29
|
AMULET_ZLIB_REQUIREMENT = (
|
|
24
30
|
f"{AMULET_ZLIB_REQUIREMENT},{os.environ['AMULET_ZLIB_REQUIREMENT']}"
|
|
@@ -41,40 +47,45 @@ def get_specifier_set(version_str: str) -> str:
|
|
|
41
47
|
return f"~={version.major}.{version.minor}.{version.micro}.0{''.join(map(str, version.pre or ()))}"
|
|
42
48
|
|
|
43
49
|
|
|
44
|
-
|
|
45
|
-
import get_compiler
|
|
46
|
-
|
|
47
|
-
AMULET_COMPILER_VERSION_REQUIREMENT = get_compiler.main()
|
|
50
|
+
AMULET_COMPILER_VERSION_REQUIREMENT = get_compiler.main()
|
|
48
51
|
|
|
49
|
-
try:
|
|
50
|
-
import amulet.pybind11_extensions
|
|
51
|
-
except ImportError:
|
|
52
|
-
pass
|
|
53
|
-
else:
|
|
54
|
-
AMULET_PYBIND11_EXTENSIONS_REQUIREMENT = get_specifier_set(
|
|
55
|
-
amulet.pybind11_extensions.__version__
|
|
56
|
-
)
|
|
57
52
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
import amulet.zlib
|
|
67
|
-
except ImportError:
|
|
68
|
-
pass
|
|
69
|
-
else:
|
|
70
|
-
AMULET_ZLIB_REQUIREMENT = get_specifier_set(amulet.zlib.__version__)
|
|
53
|
+
try:
|
|
54
|
+
import amulet.pybind11_extensions
|
|
55
|
+
except ImportError:
|
|
56
|
+
pass
|
|
57
|
+
else:
|
|
58
|
+
AMULET_PYBIND11_EXTENSIONS_REQUIREMENT = get_specifier_set(
|
|
59
|
+
amulet.pybind11_extensions.__version__
|
|
60
|
+
)
|
|
71
61
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
62
|
+
try:
|
|
63
|
+
import amulet.io
|
|
64
|
+
except ImportError:
|
|
65
|
+
pass
|
|
66
|
+
else:
|
|
67
|
+
AMULET_IO_REQUIREMENT = get_specifier_set(amulet.io.__version__)
|
|
68
|
+
|
|
69
|
+
try:
|
|
70
|
+
import amulet.utils
|
|
71
|
+
except ImportError:
|
|
72
|
+
pass
|
|
73
|
+
else:
|
|
74
|
+
AMULET_UTILS_REQUIREMENT = get_specifier_set(amulet.utils.__version__)
|
|
75
|
+
|
|
76
|
+
try:
|
|
77
|
+
import amulet.zlib
|
|
78
|
+
except ImportError:
|
|
79
|
+
pass
|
|
80
|
+
else:
|
|
81
|
+
AMULET_ZLIB_REQUIREMENT = get_specifier_set(amulet.zlib.__version__)
|
|
82
|
+
|
|
83
|
+
try:
|
|
84
|
+
import amulet.nbt
|
|
85
|
+
except ImportError:
|
|
86
|
+
pass
|
|
87
|
+
else:
|
|
88
|
+
AMULET_NBT_REQUIREMENT = get_specifier_set(amulet.nbt.__version__)
|
|
78
89
|
|
|
79
90
|
|
|
80
91
|
def get_build_dependencies() -> list:
|
|
@@ -83,6 +94,7 @@ def get_build_dependencies() -> list:
|
|
|
83
94
|
f"pybind11{PYBIND11_REQUIREMENT}",
|
|
84
95
|
f"amulet-pybind11-extensions{AMULET_PYBIND11_EXTENSIONS_REQUIREMENT}",
|
|
85
96
|
f"amulet-io{AMULET_IO_REQUIREMENT}",
|
|
97
|
+
f"amulet-utils{AMULET_UTILS_REQUIREMENT}",
|
|
86
98
|
f"amulet-zlib{AMULET_ZLIB_REQUIREMENT}",
|
|
87
99
|
f"amulet-nbt{AMULET_NBT_REQUIREMENT}",
|
|
88
100
|
] * (not os.environ.get("AMULET_SKIP_COMPILE", None))
|
|
@@ -95,6 +107,7 @@ def get_runtime_dependencies() -> list[str]:
|
|
|
95
107
|
f"pybind11{PYBIND11_REQUIREMENT}",
|
|
96
108
|
f"amulet-pybind11-extensions{AMULET_PYBIND11_EXTENSIONS_REQUIREMENT}",
|
|
97
109
|
f"amulet-io{AMULET_IO_REQUIREMENT}",
|
|
110
|
+
f"amulet-utils{AMULET_UTILS_REQUIREMENT}",
|
|
98
111
|
f"amulet-zlib{AMULET_ZLIB_REQUIREMENT}",
|
|
99
112
|
f"amulet-nbt{AMULET_NBT_REQUIREMENT}",
|
|
100
113
|
f"numpy{NUMPY_REQUIREMENT}",
|
|
@@ -3,25 +3,15 @@ import subprocess
|
|
|
3
3
|
import sys
|
|
4
4
|
from pathlib import Path
|
|
5
5
|
import platform
|
|
6
|
-
import datetime
|
|
7
6
|
from tempfile import TemporaryDirectory
|
|
8
7
|
|
|
9
8
|
from setuptools import setup, Extension, Command
|
|
10
9
|
from setuptools.command.build_ext import build_ext
|
|
11
10
|
|
|
12
|
-
from packaging.version import Version
|
|
13
|
-
|
|
14
11
|
import versioneer
|
|
15
12
|
|
|
16
13
|
import requirements
|
|
17
14
|
|
|
18
|
-
if (
|
|
19
|
-
os.environ.get("AMULET_FREEZE_COMPILER", None)
|
|
20
|
-
and sys.platform == "darwin"
|
|
21
|
-
and platform.machine() != "arm64"
|
|
22
|
-
):
|
|
23
|
-
raise Exception("The MacOS frozen build must be created on arm64")
|
|
24
|
-
|
|
25
15
|
|
|
26
16
|
def fix_path(path: str) -> str:
|
|
27
17
|
return os.path.realpath(path).replace(os.sep, "/")
|
|
@@ -35,6 +25,7 @@ class CMakeBuild(cmdclass.get("build_ext", build_ext)):
|
|
|
35
25
|
import pybind11
|
|
36
26
|
import amulet.pybind11_extensions
|
|
37
27
|
import amulet.io
|
|
28
|
+
import amulet.utils
|
|
38
29
|
import amulet.nbt
|
|
39
30
|
|
|
40
31
|
ext_dir = (
|
|
@@ -69,6 +60,7 @@ class CMakeBuild(cmdclass.get("build_ext", build_ext)):
|
|
|
69
60
|
f"-Dpybind11_DIR={fix_path(pybind11.get_cmake_dir())}",
|
|
70
61
|
f"-Damulet_pybind11_extensions_DIR={fix_path(amulet.pybind11_extensions.__path__[0])}",
|
|
71
62
|
f"-Damulet_io_DIR={fix_path(amulet.io.__path__[0])}",
|
|
63
|
+
f"-Damulet_utils_DIR={fix_path(amulet.utils.__path__[0])}",
|
|
72
64
|
f"-Damulet_nbt_DIR={fix_path(amulet.nbt.__path__[0])}",
|
|
73
65
|
f"-Damulet_core_DIR={fix_path(core_src_dir)}",
|
|
74
66
|
f"-DAMULET_CORE_EXT_DIR={fix_path(ext_dir)}",
|
|
@@ -91,35 +83,8 @@ class CMakeBuild(cmdclass.get("build_ext", build_ext)):
|
|
|
91
83
|
cmdclass["build_ext"] = CMakeBuild
|
|
92
84
|
|
|
93
85
|
|
|
94
|
-
def _get_version() -> str:
|
|
95
|
-
version_str: str = versioneer.get_version()
|
|
96
|
-
|
|
97
|
-
if os.environ.get("AMULET_FREEZE_COMPILER", None):
|
|
98
|
-
date_format = "%y%m%d%H%M%S"
|
|
99
|
-
try:
|
|
100
|
-
with open("build/timestamp.txt", "r") as f:
|
|
101
|
-
timestamp = datetime.datetime.strptime(f.read(), date_format)
|
|
102
|
-
except Exception:
|
|
103
|
-
timestamp = datetime.datetime(1, 1, 1)
|
|
104
|
-
if datetime.timedelta(minutes=10) < datetime.datetime.now() - timestamp:
|
|
105
|
-
timestamp = datetime.datetime.now()
|
|
106
|
-
os.makedirs("build", exist_ok=True)
|
|
107
|
-
with open("build/timestamp.txt", "w") as f:
|
|
108
|
-
f.write(timestamp.strftime(date_format))
|
|
109
|
-
|
|
110
|
-
version = Version(version_str)
|
|
111
|
-
epoch = f"{version.epoch}!" if version.epoch else ""
|
|
112
|
-
release = ".".join(map(str, version.release))
|
|
113
|
-
pre = "".join(map(str, version.pre)) if version.is_prerelease else ""
|
|
114
|
-
post = f".post{timestamp.strftime(date_format)}"
|
|
115
|
-
local = f"+{version.local}" if version.local else ""
|
|
116
|
-
version_str = f"{epoch}{release}{pre}{post}{local}"
|
|
117
|
-
|
|
118
|
-
return version_str
|
|
119
|
-
|
|
120
|
-
|
|
121
86
|
setup(
|
|
122
|
-
version=
|
|
87
|
+
version=versioneer.get_version(),
|
|
123
88
|
cmdclass=cmdclass,
|
|
124
89
|
ext_modules=[Extension("amulet.core._amulet_core", [])]
|
|
125
90
|
* (not os.environ.get("AMULET_SKIP_COMPILE", None)),
|
|
@@ -17,6 +17,7 @@ void init_chunk(py::module);
|
|
|
17
17
|
void init_module(py::module m)
|
|
18
18
|
{
|
|
19
19
|
pyext::init_compiler_config(m);
|
|
20
|
+
pyext::check_compatibility(py::module::import("amulet.utils"), m);
|
|
20
21
|
pyext::check_compatibility(py::module::import("amulet.zlib"), m);
|
|
21
22
|
pyext::check_compatibility(py::module::import("amulet.nbt"), m);
|
|
22
23
|
|
|
@@ -8,11 +8,11 @@ import json
|
|
|
8
8
|
|
|
9
9
|
version_json = '''
|
|
10
10
|
{
|
|
11
|
-
"date": "2025-
|
|
11
|
+
"date": "2025-09-01T13:18:18+0100",
|
|
12
12
|
"dirty": false,
|
|
13
13
|
"error": null,
|
|
14
|
-
"full-revisionid": "
|
|
15
|
-
"version": "2.0.
|
|
14
|
+
"full-revisionid": "d46ea97b2c67f05ece822c4af0819fa94db55cf3",
|
|
15
|
+
"version": "2.0.5a0"
|
|
16
16
|
}
|
|
17
17
|
''' # END VERSION_JSON
|
|
18
18
|
|
|
@@ -3,6 +3,7 @@ if (NOT TARGET amulet_core)
|
|
|
3
3
|
|
|
4
4
|
find_package(amulet_io CONFIG REQUIRED)
|
|
5
5
|
find_package(amulet_nbt CONFIG REQUIRED)
|
|
6
|
+
find_package(amulet_utils CONFIG REQUIRED)
|
|
6
7
|
|
|
7
8
|
set(amulet_core_INCLUDE_DIR "${CMAKE_CURRENT_LIST_DIR}/../..")
|
|
8
9
|
find_library(amulet_core_LIBRARY NAMES amulet_core PATHS "${CMAKE_CURRENT_LIST_DIR}")
|
|
@@ -16,6 +17,7 @@ if (NOT TARGET amulet_core)
|
|
|
16
17
|
add_library(amulet_core INTERFACE)
|
|
17
18
|
target_link_libraries(amulet_core INTERFACE amulet_io)
|
|
18
19
|
target_link_libraries(amulet_core INTERFACE amulet_nbt)
|
|
20
|
+
target_link_libraries(amulet_core INTERFACE amulet_utils)
|
|
19
21
|
target_link_libraries(amulet_core INTERFACE amulet_core_bin)
|
|
20
22
|
target_include_directories(amulet_core INTERFACE ${amulet_core_INCLUDE_DIR})
|
|
21
23
|
endif()
|
{amulet_core-2.0.4a0 → amulet_core-2.0.5a0}/src/amulet/core/chunk/component/block_component.pyi
RENAMED
|
@@ -7,7 +7,7 @@ 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__ = ["BlockComponent", "BlockComponentData"]
|
|
10
|
+
__all__: list[str] = ["BlockComponent", "BlockComponentData"]
|
|
11
11
|
|
|
12
12
|
class BlockComponent:
|
|
13
13
|
ComponentID: typing.ClassVar[str] = "Amulet::BlockComponent"
|
|
@@ -5,4 +5,4 @@ from amulet.core.palette.block_palette import BlockPalette
|
|
|
5
5
|
|
|
6
6
|
from . import biome_palette, block_palette
|
|
7
7
|
|
|
8
|
-
__all__ = ["BiomePalette", "BlockPalette", "biome_palette", "block_palette"]
|
|
8
|
+
__all__: list[str] = ["BiomePalette", "BlockPalette", "biome_palette", "block_palette"]
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from amulet.core.selection.box import SelectionBox
|
|
4
|
+
from amulet.core.selection.box_group import SelectionBoxGroup
|
|
5
|
+
from amulet.core.selection.cuboid import SelectionCuboid
|
|
6
|
+
from amulet.core.selection.ellipsoid import SelectionEllipsoid
|
|
7
|
+
from amulet.core.selection.shape import SelectionShape
|
|
8
|
+
from amulet.core.selection.shape_group import SelectionShapeGroup
|
|
9
|
+
|
|
10
|
+
from . import box, box_group, cuboid, ellipsoid, shape, shape_group
|
|
11
|
+
|
|
12
|
+
__all__: list[str] = [
|
|
13
|
+
"SelectionBox",
|
|
14
|
+
"SelectionBoxGroup",
|
|
15
|
+
"SelectionCuboid",
|
|
16
|
+
"SelectionEllipsoid",
|
|
17
|
+
"SelectionShape",
|
|
18
|
+
"SelectionShapeGroup",
|
|
19
|
+
"box",
|
|
20
|
+
"box_group",
|
|
21
|
+
"cuboid",
|
|
22
|
+
"ellipsoid",
|
|
23
|
+
"shape",
|
|
24
|
+
"shape_group",
|
|
25
|
+
]
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
#include <pybind11/pybind11.h>
|
|
2
|
+
|
|
3
|
+
#include <amulet/pybind11_extensions/py_module.hpp>
|
|
4
|
+
|
|
5
|
+
#include "box.hpp"
|
|
6
|
+
#include "box_group.hpp"
|
|
7
|
+
|
|
8
|
+
namespace py = pybind11;
|
|
9
|
+
namespace pyext = Amulet::pybind11_extensions;
|
|
10
|
+
|
|
11
|
+
void init_selection_box(py::classh<Amulet::SelectionBox>);
|
|
12
|
+
void init_selection_box_group(py::classh<Amulet::SelectionBoxGroup>);
|
|
13
|
+
py::object init_selection_shape(py::module);
|
|
14
|
+
py::object init_selection_shape_group(py::module);
|
|
15
|
+
py::object init_selection_cuboid(py::module m_parent);
|
|
16
|
+
py::object init_selection_ellipsoid(py::module m_parent);
|
|
17
|
+
|
|
18
|
+
void init_selection(py::module m_parent)
|
|
19
|
+
{
|
|
20
|
+
auto m = pyext::def_subpackage(m_parent, "selection");
|
|
21
|
+
|
|
22
|
+
auto selection_box_module = m.def_submodule("box");
|
|
23
|
+
auto selection_box_group_module = m.def_submodule("box_group");
|
|
24
|
+
|
|
25
|
+
// Low level selection
|
|
26
|
+
// These classes must be defined before methods can be added
|
|
27
|
+
py::classh<Amulet::SelectionBox> SelectionBox(selection_box_module, "SelectionBox",
|
|
28
|
+
"The SelectionBox class represents a single cuboid selection.\n"
|
|
29
|
+
"\n"
|
|
30
|
+
"When combined with :class:`~amulet.api.selection.SelectionBoxGroup` it can represent any arbitrary shape.");
|
|
31
|
+
py::classh<Amulet::SelectionBoxGroup> SelectionBoxGroup(selection_box_group_module, "SelectionBoxGroup",
|
|
32
|
+
"A container for zero or more :class:`SelectionBox` instances.\n"
|
|
33
|
+
"\n"
|
|
34
|
+
"This allows for non-rectangular and non-contiguous selections.");
|
|
35
|
+
|
|
36
|
+
// Shape base class
|
|
37
|
+
m.attr("SelectionShape") = init_selection_shape(m);
|
|
38
|
+
|
|
39
|
+
// Init box classes
|
|
40
|
+
init_selection_box(SelectionBox);
|
|
41
|
+
init_selection_box_group(SelectionBoxGroup);
|
|
42
|
+
|
|
43
|
+
m.attr("SelectionBox") = SelectionBox;
|
|
44
|
+
m.attr("SelectionBoxGroup") = SelectionBoxGroup;
|
|
45
|
+
|
|
46
|
+
// Init shape classes
|
|
47
|
+
m.attr("SelectionShapeGroup") = init_selection_shape_group(m);
|
|
48
|
+
m.attr("SelectionCuboid") = init_selection_cuboid(m);
|
|
49
|
+
m.attr("SelectionEllipsoid") = init_selection_ellipsoid(m);
|
|
50
|
+
}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
#include <algorithm>
|
|
2
2
|
#include <array>
|
|
3
3
|
|
|
4
|
+
#include <amulet/utils/matrix.hpp>
|
|
5
|
+
|
|
4
6
|
#include "box.hpp"
|
|
5
|
-
#include "
|
|
7
|
+
#include "box_group.hpp"
|
|
8
|
+
#include "cuboid.hpp"
|
|
6
9
|
|
|
7
10
|
namespace Amulet {
|
|
8
11
|
|
|
@@ -34,7 +37,7 @@ bool SelectionBox::intersects(const SelectionBox& other) const
|
|
|
34
37
|
&& _min_y < other.max_y() && other._min_y < max_y()
|
|
35
38
|
&& _min_z < other.max_z() && other._min_z < max_z();
|
|
36
39
|
}
|
|
37
|
-
bool SelectionBox::intersects(const
|
|
40
|
+
bool SelectionBox::intersects(const SelectionBoxGroup& other) const
|
|
38
41
|
{
|
|
39
42
|
return other.intersects(*this);
|
|
40
43
|
}
|
|
@@ -60,6 +63,43 @@ SelectionBox SelectionBox::translate(std::int64_t dx, std::int64_t dy, std::int6
|
|
|
60
63
|
_size_y,
|
|
61
64
|
_size_z);
|
|
62
65
|
}
|
|
63
|
-
|
|
66
|
+
SelectionBoxGroup SelectionBox::transform(const Matrix4x4& matrix) const {
|
|
67
|
+
return SelectionCuboid(_min_x, _min_y, _min_z, _size_x, _size_y, _size_z).transform(matrix)->voxelise();
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
std::strong_ordering SelectionBox::operator<=>(const SelectionBox& other) const
|
|
71
|
+
{
|
|
72
|
+
return std::tie(
|
|
73
|
+
_min_x,
|
|
74
|
+
_min_y,
|
|
75
|
+
_min_z,
|
|
76
|
+
_size_x,
|
|
77
|
+
_size_y,
|
|
78
|
+
_size_z)
|
|
79
|
+
<=> std::tie(
|
|
80
|
+
other._min_x,
|
|
81
|
+
other._min_y,
|
|
82
|
+
other._min_z,
|
|
83
|
+
other._size_x,
|
|
84
|
+
other._size_y,
|
|
85
|
+
other._size_z);
|
|
86
|
+
}
|
|
87
|
+
bool SelectionBox::operator==(const SelectionBox& other) const
|
|
88
|
+
{
|
|
89
|
+
return std::tie(
|
|
90
|
+
_min_x,
|
|
91
|
+
_min_y,
|
|
92
|
+
_min_z,
|
|
93
|
+
_size_x,
|
|
94
|
+
_size_y,
|
|
95
|
+
_size_z)
|
|
96
|
+
== std::tie(
|
|
97
|
+
other._min_x,
|
|
98
|
+
other._min_y,
|
|
99
|
+
other._min_z,
|
|
100
|
+
other._size_x,
|
|
101
|
+
other._size_y,
|
|
102
|
+
other._size_z);
|
|
103
|
+
}
|
|
64
104
|
|
|
65
105
|
} // namespace Amulet
|