amulet-core 2.0a8__cp312-cp312-win_amd64.whl → 2.0.1.0.1297307203.19.43.34808.0a1__cp312-cp312-win_amd64.whl

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

Potentially problematic release.


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

Files changed (271) hide show
  1. amulet/core/__init__.py +36 -0
  2. amulet/core/__pyinstaller/hook-amulet.core.py +4 -0
  3. amulet/core/_amulet_core.cp312-win_amd64.pyd +0 -0
  4. amulet/core/_amulet_core.pyi +7 -0
  5. amulet/{_version.py → core/_version.py} +3 -3
  6. amulet/core/amulet_core.dll +0 -0
  7. amulet/core/amulet_core.lib +0 -0
  8. amulet/core/amulet_coreConfig.cmake +18 -0
  9. amulet/{biome.pyi → core/biome/__init__.pyi} +3 -3
  10. amulet/core/biome/biome.hpp +53 -0
  11. amulet/{block.pyi → core/block/__init__.pyi} +25 -26
  12. amulet/core/block/block.hpp +156 -0
  13. amulet/{block_entity.pyi → core/block_entity/__init__.pyi} +7 -7
  14. amulet/core/block_entity/block_entity.hpp +84 -0
  15. amulet/{errors.py → core/chunk/__init__.pyi} +37 -33
  16. amulet/core/chunk/chunk.hpp +126 -0
  17. amulet/core/chunk/component/__init__.pyi +18 -0
  18. amulet/core/chunk/component/biome_3d_component.hpp +96 -0
  19. amulet/core/chunk/component/block_component.hpp +101 -0
  20. amulet/core/chunk/component/block_component.pyi +28 -0
  21. amulet/core/chunk/component/block_entity_component.hpp +119 -0
  22. amulet/core/chunk/component/section_array_map.hpp +129 -0
  23. amulet/{chunk_components.pyi → core/chunk/component/section_array_map.pyi} +4 -24
  24. amulet/core/dll.hpp +21 -0
  25. amulet/core/entity/__init__.pyi +105 -0
  26. amulet/core/entity/entity.hpp +100 -0
  27. amulet/{palette → core/palette}/__init__.pyi +2 -2
  28. amulet/core/palette/biome_palette.hpp +65 -0
  29. amulet/{palette → core/palette}/biome_palette.pyi +8 -8
  30. amulet/core/palette/block_palette.hpp +71 -0
  31. amulet/{palette → core/palette}/block_palette.pyi +12 -10
  32. amulet/core/selection/__init__.pyi +8 -0
  33. amulet/core/selection/box.hpp +86 -0
  34. amulet/core/selection/box.pyi +215 -0
  35. amulet/core/selection/group.hpp +80 -0
  36. amulet/core/selection/group.pyi +213 -0
  37. amulet/{version.pyi → core/version/__init__.pyi} +58 -10
  38. amulet/core/version/version.hpp +204 -0
  39. {amulet_core-2.0a8.dist-info → amulet_core-2.0.1.0.1297307203.19.43.34808.0a1.dist-info}/METADATA +25 -20
  40. amulet_core-2.0.1.0.1297307203.19.43.34808.0a1.dist-info/RECORD +45 -0
  41. {amulet_core-2.0a8.dist-info → amulet_core-2.0.1.0.1297307203.19.43.34808.0a1.dist-info}/WHEEL +1 -1
  42. amulet_core-2.0.1.0.1297307203.19.43.34808.0a1.dist-info/entry_points.txt +2 -0
  43. amulet/__init__.cp312-win_amd64.pyd +0 -0
  44. amulet/__init__.py.cpp +0 -45
  45. amulet/__init__.pyi +0 -30
  46. amulet/__pyinstaller/hook-amulet.py +0 -4
  47. amulet/_init.py +0 -26
  48. amulet/biome.cpp +0 -36
  49. amulet/biome.hpp +0 -43
  50. amulet/biome.py.cpp +0 -122
  51. amulet/block.cpp +0 -435
  52. amulet/block.hpp +0 -119
  53. amulet/block.py.cpp +0 -377
  54. amulet/block_entity.cpp +0 -12
  55. amulet/block_entity.hpp +0 -56
  56. amulet/block_entity.py.cpp +0 -115
  57. amulet/chunk.cpp +0 -16
  58. amulet/chunk.hpp +0 -100
  59. amulet/chunk.py.cpp +0 -80
  60. amulet/chunk.pyi +0 -28
  61. amulet/chunk_components/biome_3d_component.cpp +0 -5
  62. amulet/chunk_components/biome_3d_component.hpp +0 -79
  63. amulet/chunk_components/block_component.cpp +0 -41
  64. amulet/chunk_components/block_component.hpp +0 -88
  65. amulet/chunk_components/block_entity_component.cpp +0 -5
  66. amulet/chunk_components/block_entity_component.hpp +0 -147
  67. amulet/chunk_components/section_array_map.cpp +0 -129
  68. amulet/chunk_components/section_array_map.hpp +0 -147
  69. amulet/collections/eq.py.hpp +0 -37
  70. amulet/collections/hash.py.hpp +0 -27
  71. amulet/collections/holder.py.hpp +0 -37
  72. amulet/collections/iterator.py.hpp +0 -80
  73. amulet/collections/mapping.py.hpp +0 -199
  74. amulet/collections/mutable_mapping.py.hpp +0 -226
  75. amulet/collections/sequence.py.hpp +0 -163
  76. amulet/collections.pyi +0 -40
  77. amulet/data_types.py +0 -29
  78. amulet/entity.py +0 -182
  79. amulet/game/__init__.py +0 -7
  80. amulet/game/_game.py +0 -152
  81. amulet/game/_universal/__init__.py +0 -1
  82. amulet/game/_universal/_biome.py +0 -17
  83. amulet/game/_universal/_block.py +0 -47
  84. amulet/game/_universal/_version.py +0 -68
  85. amulet/game/abc/__init__.py +0 -22
  86. amulet/game/abc/_block_specification.py +0 -150
  87. amulet/game/abc/biome.py +0 -213
  88. amulet/game/abc/block.py +0 -331
  89. amulet/game/abc/game_version_container.py +0 -25
  90. amulet/game/abc/json_interface.py +0 -27
  91. amulet/game/abc/version.py +0 -44
  92. amulet/game/bedrock/__init__.py +0 -1
  93. amulet/game/bedrock/_biome.py +0 -35
  94. amulet/game/bedrock/_block.py +0 -42
  95. amulet/game/bedrock/_version.py +0 -165
  96. amulet/game/java/__init__.py +0 -2
  97. amulet/game/java/_biome.py +0 -35
  98. amulet/game/java/_block.py +0 -60
  99. amulet/game/java/_version.py +0 -176
  100. amulet/game/translate/__init__.py +0 -12
  101. amulet/game/translate/_functions/__init__.py +0 -15
  102. amulet/game/translate/_functions/_code_functions/__init__.py +0 -0
  103. amulet/game/translate/_functions/_code_functions/_text.py +0 -553
  104. amulet/game/translate/_functions/_code_functions/banner_pattern.py +0 -67
  105. amulet/game/translate/_functions/_code_functions/bedrock_chest_connection.py +0 -152
  106. amulet/game/translate/_functions/_code_functions/bedrock_moving_block_pos.py +0 -88
  107. amulet/game/translate/_functions/_code_functions/bedrock_sign.py +0 -152
  108. amulet/game/translate/_functions/_code_functions/bedrock_skull_rotation.py +0 -16
  109. amulet/game/translate/_functions/_code_functions/custom_name.py +0 -146
  110. amulet/game/translate/_functions/_frozen.py +0 -66
  111. amulet/game/translate/_functions/_state.py +0 -54
  112. amulet/game/translate/_functions/_typing.py +0 -98
  113. amulet/game/translate/_functions/abc.py +0 -123
  114. amulet/game/translate/_functions/carry_nbt.py +0 -160
  115. amulet/game/translate/_functions/carry_properties.py +0 -80
  116. amulet/game/translate/_functions/code.py +0 -143
  117. amulet/game/translate/_functions/map_block_name.py +0 -66
  118. amulet/game/translate/_functions/map_nbt.py +0 -111
  119. amulet/game/translate/_functions/map_properties.py +0 -93
  120. amulet/game/translate/_functions/multiblock.py +0 -112
  121. amulet/game/translate/_functions/new_block.py +0 -42
  122. amulet/game/translate/_functions/new_entity.py +0 -43
  123. amulet/game/translate/_functions/new_nbt.py +0 -206
  124. amulet/game/translate/_functions/new_properties.py +0 -64
  125. amulet/game/translate/_functions/sequence.py +0 -51
  126. amulet/game/translate/_functions/walk_input_nbt.py +0 -331
  127. amulet/game/translate/_translator.py +0 -433
  128. amulet/img/__init__.py +0 -10
  129. amulet/img/missing_no.png +0 -0
  130. amulet/img/missing_pack.png +0 -0
  131. amulet/img/missing_world.png +0 -0
  132. amulet/io/binary_reader.hpp +0 -45
  133. amulet/io/binary_writer.hpp +0 -30
  134. amulet/item.py +0 -75
  135. amulet/level/__init__.pyi +0 -23
  136. amulet/level/_load.py +0 -100
  137. amulet/level/abc/__init__.py +0 -12
  138. amulet/level/abc/_chunk_handle.py +0 -358
  139. amulet/level/abc/_dimension.py +0 -86
  140. amulet/level/abc/_history/__init__.py +0 -1
  141. amulet/level/abc/_history/_cache.py +0 -224
  142. amulet/level/abc/_history/_history_manager.py +0 -291
  143. amulet/level/abc/_level/__init__.py +0 -5
  144. amulet/level/abc/_level/_compactable_level.py +0 -10
  145. amulet/level/abc/_level/_creatable_level.py +0 -28
  146. amulet/level/abc/_level/_disk_level.py +0 -17
  147. amulet/level/abc/_level/_level.py +0 -449
  148. amulet/level/abc/_level/_loadable_level.py +0 -42
  149. amulet/level/abc/_player_storage.py +0 -7
  150. amulet/level/abc/_raw_level.py +0 -187
  151. amulet/level/abc/_registry.py +0 -40
  152. amulet/level/java/__init__.pyi +0 -16
  153. amulet/level/java/_chunk_handle.py +0 -17
  154. amulet/level/java/_dimension.py +0 -20
  155. amulet/level/java/_level.py +0 -184
  156. amulet/level/java/_raw/__init__.pyi +0 -15
  157. amulet/level/java/_raw/_chunk.pyi +0 -23
  158. amulet/level/java/_raw/_constant.py +0 -9
  159. amulet/level/java/_raw/_data_pack/__init__.py +0 -2
  160. amulet/level/java/_raw/_data_pack/data_pack.py +0 -241
  161. amulet/level/java/_raw/_data_pack/data_pack_manager.py +0 -77
  162. amulet/level/java/_raw/_dimension.py +0 -86
  163. amulet/level/java/_raw/_level.py +0 -507
  164. amulet/level/java/_raw/_typing.py +0 -3
  165. amulet/level/java/_raw/java_chunk_decode.cpp +0 -531
  166. amulet/level/java/_raw/java_chunk_decode.hpp +0 -23
  167. amulet/level/java/_raw/java_chunk_encode.cpp +0 -25
  168. amulet/level/java/_raw/java_chunk_encode.hpp +0 -23
  169. amulet/level/java/anvil/__init__.py +0 -2
  170. amulet/level/java/anvil/_dimension.py +0 -170
  171. amulet/level/java/anvil/_region.py +0 -421
  172. amulet/level/java/anvil/_sector_manager.py +0 -223
  173. amulet/level/java/chunk.pyi +0 -81
  174. amulet/level/java/chunk_/_chunk.py +0 -260
  175. amulet/level/java/chunk_/components/inhabited_time.py +0 -12
  176. amulet/level/java/chunk_/components/last_update.py +0 -12
  177. amulet/level/java/chunk_/components/legacy_version.py +0 -12
  178. amulet/level/java/chunk_/components/light_populated.py +0 -12
  179. amulet/level/java/chunk_/components/named_height_2d.py +0 -37
  180. amulet/level/java/chunk_/components/status.py +0 -11
  181. amulet/level/java/chunk_/components/terrain_populated.py +0 -12
  182. amulet/level/java/chunk_components/data_version_component.cpp +0 -32
  183. amulet/level/java/chunk_components/data_version_component.hpp +0 -31
  184. amulet/level/java/chunk_components/java_raw_chunk_component.cpp +0 -56
  185. amulet/level/java/chunk_components/java_raw_chunk_component.hpp +0 -45
  186. amulet/level/java/chunk_components.pyi +0 -22
  187. amulet/level/java/java_chunk.cpp +0 -170
  188. amulet/level/java/java_chunk.hpp +0 -141
  189. amulet/level/java/long_array.hpp +0 -175
  190. amulet/level/java/long_array.pyi +0 -39
  191. amulet/level/temporary_level/__init__.py +0 -1
  192. amulet/level/temporary_level/_level.py +0 -16
  193. amulet/mesh/__init__.py +0 -0
  194. amulet/mesh/block/__init__.pyi +0 -301
  195. amulet/mesh/block/_cube.py +0 -198
  196. amulet/mesh/block/_missing_block.py +0 -20
  197. amulet/mesh/block/block_mesh.cpp +0 -107
  198. amulet/mesh/block/block_mesh.hpp +0 -207
  199. amulet/mesh/util.py +0 -17
  200. amulet/palette/biome_palette.hpp +0 -85
  201. amulet/palette/block_palette.cpp +0 -32
  202. amulet/palette/block_palette.hpp +0 -93
  203. amulet/player.py +0 -62
  204. amulet/pybind11/collections.hpp +0 -118
  205. amulet/pybind11/numpy.hpp +0 -26
  206. amulet/pybind11/py_module.hpp +0 -34
  207. amulet/pybind11/type_hints.hpp +0 -51
  208. amulet/pybind11/types.hpp +0 -25
  209. amulet/pybind11/typing.hpp +0 -7
  210. amulet/resource_pack/__init__.py +0 -63
  211. amulet/resource_pack/abc/__init__.py +0 -2
  212. amulet/resource_pack/abc/resource_pack.py +0 -38
  213. amulet/resource_pack/abc/resource_pack_manager.py +0 -85
  214. amulet/resource_pack/java/__init__.py +0 -2
  215. amulet/resource_pack/java/download_resources.py +0 -212
  216. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_black.png +0 -0
  217. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_blue.png +0 -0
  218. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_brown.png +0 -0
  219. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_cyan.png +0 -0
  220. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_gray.png +0 -0
  221. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_green.png +0 -0
  222. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_light_blue.png +0 -0
  223. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_light_gray.png +0 -0
  224. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_lime.png +0 -0
  225. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_magenta.png +0 -0
  226. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_orange.png +0 -0
  227. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_pink.png +0 -0
  228. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_purple.png +0 -0
  229. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_red.png +0 -0
  230. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_white.png +0 -0
  231. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_yellow.png +0 -0
  232. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/barrier.png +0 -0
  233. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/end_portal.png +0 -0
  234. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/grass.png +0 -0
  235. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/lava.png +0 -0
  236. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/structure_void.png +0 -0
  237. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/water.png +0 -0
  238. amulet/resource_pack/java/java_vanilla_fix/pack.png +0 -0
  239. amulet/resource_pack/java/resource_pack.py +0 -44
  240. amulet/resource_pack/java/resource_pack_manager.py +0 -563
  241. amulet/resource_pack/unknown_resource_pack.py +0 -10
  242. amulet/selection/__init__.py +0 -2
  243. amulet/selection/abstract_selection.py +0 -342
  244. amulet/selection/box.py +0 -852
  245. amulet/selection/group.py +0 -481
  246. amulet/utils/__init__.pyi +0 -23
  247. amulet/utils/call_spec/__init__.py +0 -24
  248. amulet/utils/call_spec/_call_spec.py +0 -257
  249. amulet/utils/cast.py +0 -10
  250. amulet/utils/comment_json.py +0 -188
  251. amulet/utils/format_utils.py +0 -41
  252. amulet/utils/generator.py +0 -18
  253. amulet/utils/matrix.py +0 -243
  254. amulet/utils/numpy.hpp +0 -36
  255. amulet/utils/numpy.pyi +0 -11
  256. amulet/utils/numpy_helpers.py +0 -19
  257. amulet/utils/shareable_lock.py +0 -335
  258. amulet/utils/signal/__init__.py +0 -10
  259. amulet/utils/signal/_signal.py +0 -228
  260. amulet/utils/task_manager.py +0 -235
  261. amulet/utils/typed_property.py +0 -111
  262. amulet/utils/weakref.py +0 -70
  263. amulet/utils/world_utils.py +0 -102
  264. amulet/version.cpp +0 -136
  265. amulet/version.hpp +0 -142
  266. amulet/version.py.cpp +0 -281
  267. amulet_core-2.0a8.dist-info/RECORD +0 -241
  268. amulet_core-2.0a8.dist-info/entry_points.txt +0 -2
  269. /amulet/{__pyinstaller → core/__pyinstaller}/__init__.py +0 -0
  270. /amulet/{py.typed → core/py.typed} +0 -0
  271. {amulet_core-2.0a8.dist-info → amulet_core-2.0.1.0.1297307203.19.43.34808.0a1.dist-info}/top_level.txt +0 -0
@@ -1,39 +0,0 @@
1
- from __future__ import annotations
2
-
3
- import numpy
4
- import numpy.typing
5
- import typing_extensions
6
-
7
- __all__ = ["decode_long_array", "encode_long_array"]
8
-
9
- def decode_long_array(
10
- long_array: typing_extensions.Buffer,
11
- size: int,
12
- bits_per_entry: int,
13
- dense: bool = True,
14
- ) -> numpy.ndarray:
15
- """
16
- Decode a long array (from BlockStates or Heightmaps)
17
-
18
- :param long_array: Encoded long array
19
- :param size: The expected size of the returned array
20
- :param bits_per_entry: The number of bits per entry in the encoded array.
21
- :param dense: If true the long arrays will be treated as a bit stream. If false they are distinct values with padding
22
- :return: Decoded array as numpy array
23
- """
24
-
25
- def encode_long_array(
26
- array: typing_extensions.Buffer,
27
- bits_per_entry: None | int = None,
28
- dense: bool = True,
29
- min_bits_per_entry: int = 1,
30
- ) -> numpy.typing.NDArray[numpy.uint64]:
31
- """
32
- Encode a long array (from BlockStates or Heightmaps)
33
-
34
- :param array: A numpy array of the data to be encoded.
35
- :param bits_per_entry: The number of bits to use to store each value. If left as None will use the smallest bits per entry.
36
- :param dense: If true the long arrays will be treated as a bit stream. If false they are distinct values with padding
37
- :param min_bits_per_entry: The mimimum value that bits_per_entry can be. If it is less than this it will be capped at this value.
38
- :return: Encoded array as numpy array
39
- """
@@ -1 +0,0 @@
1
- from ._level import TemporaryLevel
@@ -1,16 +0,0 @@
1
- from __future__ import annotations
2
-
3
- from typing import Any
4
- from amulet.level.abc import Level, CreatableLevel
5
- from amulet.utils.call_spec import method_spec
6
-
7
-
8
- class TemporaryLevel(Level, CreatableLevel):
9
- """A temporary level that exists only in memory."""
10
-
11
- __slots__ = ()
12
-
13
- @classmethod
14
- @method_spec()
15
- def create(cls, *args: Any, **kwargs: Any) -> TemporaryLevel:
16
- raise NotImplementedError
amulet/mesh/__init__.py DELETED
File without changes
@@ -1,301 +0,0 @@
1
- from __future__ import annotations
2
-
3
- import collections.abc
4
- import typing
5
-
6
- import numpy
7
- import pybind11_stubgen.typing_ext
8
- from amulet.mesh.block._cube import get_cube, get_unit_cube
9
- from amulet.mesh.block._missing_block import get_missing_block
10
-
11
- from . import _cube, _missing_block
12
-
13
- __all__ = [
14
- "BlockMesh",
15
- "BlockMeshCullDirection",
16
- "BlockMeshPart",
17
- "BlockMeshTransparency",
18
- "CUBE_FACE_LUT",
19
- "FACE_KEYS",
20
- "FloatVec2",
21
- "FloatVec3",
22
- "TRI_FACE",
23
- "Triangle",
24
- "UV_ROTATION_LUT",
25
- "Vertex",
26
- "get_cube",
27
- "get_missing_block",
28
- "get_unit_cube",
29
- "merge_block_meshes",
30
- ]
31
-
32
- class BlockMesh:
33
- """
34
- All the data that makes up a block mesh.
35
- """
36
-
37
- def __init__(
38
- self,
39
- transparency: BlockMeshTransparency,
40
- textures: list[str],
41
- parts: tuple[
42
- BlockMeshPart | None,
43
- BlockMeshPart | None,
44
- BlockMeshPart | None,
45
- BlockMeshPart | None,
46
- BlockMeshPart | None,
47
- BlockMeshPart | None,
48
- BlockMeshPart | None,
49
- ],
50
- ) -> None: ...
51
- def rotate(self, rotx: int, roty: int) -> BlockMesh:
52
- """
53
- Rotate the mesh in the x and y axis. Accepted values are -3 to 3 which corrospond to 90 degree rotations.
54
- """
55
-
56
- @property
57
- def parts(
58
- self,
59
- ) -> typing.Annotated[
60
- list[BlockMeshPart | None], pybind11_stubgen.typing_ext.FixedSize(7)
61
- ]:
62
- """
63
- The mesh parts that make up this mesh. The index corrosponds to the value of BlockMeshCullDirection.
64
- """
65
-
66
- @parts.setter
67
- def parts(
68
- self,
69
- arg0: typing.Annotated[
70
- list[BlockMeshPart | None], pybind11_stubgen.typing_ext.FixedSize(7)
71
- ],
72
- ) -> None: ...
73
- @property
74
- def textures(self) -> list[str]:
75
- """
76
- The texture paths used in this block mesh. The Triangle's texture_index attribute is an index into this list.
77
- """
78
-
79
- @textures.setter
80
- def textures(self, arg0: list[str]) -> None: ...
81
- @property
82
- def transparency(self) -> BlockMeshTransparency:
83
- """
84
- The transparency state of this block mesh.
85
- """
86
-
87
- @transparency.setter
88
- def transparency(self, arg0: BlockMeshTransparency) -> None: ...
89
-
90
- class BlockMeshCullDirection:
91
- """
92
- The direction a mesh part is culled by. The value corrosponds to the index in the mesh parts array.
93
-
94
- Members:
95
-
96
- CullNone : Is not culled by any neighbouring blocks.
97
-
98
- CullUp : Is culled by an opaque block above.
99
-
100
- CullDown : Is culled by an opaque block below.
101
-
102
- CullNorth : Is culled by an opaque block to the north.
103
-
104
- CullEast : Is culled by an opaque block to the east.
105
-
106
- CullSouth : Is culled by an opaque block to the south.
107
-
108
- CullWest : Is culled by an opaque block to the west.
109
- """
110
-
111
- CullDown: typing.ClassVar[
112
- BlockMeshCullDirection
113
- ] # value = <BlockMeshCullDirection.CullDown: 2>
114
- CullEast: typing.ClassVar[
115
- BlockMeshCullDirection
116
- ] # value = <BlockMeshCullDirection.CullEast: 4>
117
- CullNone: typing.ClassVar[
118
- BlockMeshCullDirection
119
- ] # value = <BlockMeshCullDirection.CullNone: 0>
120
- CullNorth: typing.ClassVar[
121
- BlockMeshCullDirection
122
- ] # value = <BlockMeshCullDirection.CullNorth: 3>
123
- CullSouth: typing.ClassVar[
124
- BlockMeshCullDirection
125
- ] # value = <BlockMeshCullDirection.CullSouth: 5>
126
- CullUp: typing.ClassVar[
127
- BlockMeshCullDirection
128
- ] # value = <BlockMeshCullDirection.CullUp: 1>
129
- CullWest: typing.ClassVar[
130
- BlockMeshCullDirection
131
- ] # value = <BlockMeshCullDirection.CullWest: 6>
132
- __members__: typing.ClassVar[
133
- dict[str, BlockMeshCullDirection]
134
- ] # value = {'CullNone': <BlockMeshCullDirection.CullNone: 0>, 'CullUp': <BlockMeshCullDirection.CullUp: 1>, 'CullDown': <BlockMeshCullDirection.CullDown: 2>, 'CullNorth': <BlockMeshCullDirection.CullNorth: 3>, 'CullEast': <BlockMeshCullDirection.CullEast: 4>, 'CullSouth': <BlockMeshCullDirection.CullSouth: 5>, 'CullWest': <BlockMeshCullDirection.CullWest: 6>}
135
- def __and__(self, other: typing.Any) -> typing.Any: ...
136
- def __eq__(self, other: typing.Any) -> bool: ...
137
- def __ge__(self, other: typing.Any) -> bool: ...
138
- def __gt__(self, other: typing.Any) -> bool: ...
139
- def __hash__(self) -> int: ...
140
- def __index__(self) -> int: ...
141
- def __init__(self, value: int) -> None: ...
142
- def __int__(self) -> int: ...
143
- def __invert__(self) -> typing.Any: ...
144
- def __le__(self, other: typing.Any) -> bool: ...
145
- def __lt__(self, other: typing.Any) -> bool: ...
146
- def __ne__(self, other: typing.Any) -> bool: ...
147
- def __or__(self, other: typing.Any) -> typing.Any: ...
148
- def __rand__(self, other: typing.Any) -> typing.Any: ...
149
- def __repr__(self) -> str: ...
150
- def __ror__(self, other: typing.Any) -> typing.Any: ...
151
- def __rxor__(self, other: typing.Any) -> typing.Any: ...
152
- def __str__(self) -> str: ...
153
- def __xor__(self, other: typing.Any) -> typing.Any: ...
154
- @property
155
- def name(self) -> str: ...
156
- @property
157
- def value(self) -> int: ...
158
-
159
- class BlockMeshPart:
160
- """
161
- A part of a block mesh for one of the culling directions.
162
- """
163
-
164
- def __init__(self, verts: list[Vertex], triangles: list[Triangle]) -> None: ...
165
- @property
166
- def triangles(self) -> list[Triangle]:
167
- """
168
- The triangles in this block mesh part.
169
- """
170
-
171
- @triangles.setter
172
- def triangles(self, arg0: list[Triangle]) -> None: ...
173
- @property
174
- def verts(self) -> list[Vertex]:
175
- """
176
- The vertices in this block mesh part.
177
- """
178
-
179
- @verts.setter
180
- def verts(self, arg0: list[Vertex]) -> None: ...
181
-
182
- class BlockMeshTransparency:
183
- """
184
- The transparency of a block mesh.
185
-
186
- Members:
187
-
188
- FullOpaque : A block that occupies the whole block and is opaque.
189
-
190
- FullTranslucent : A block that occupies the whole block and has at least one translucent face.
191
-
192
- Partial : A block that does not occupy the whole block.
193
- """
194
-
195
- FullOpaque: typing.ClassVar[
196
- BlockMeshTransparency
197
- ] # value = <BlockMeshTransparency.FullOpaque: 0>
198
- FullTranslucent: typing.ClassVar[
199
- BlockMeshTransparency
200
- ] # value = <BlockMeshTransparency.FullTranslucent: 1>
201
- Partial: typing.ClassVar[
202
- BlockMeshTransparency
203
- ] # value = <BlockMeshTransparency.Partial: 2>
204
- __members__: typing.ClassVar[
205
- dict[str, BlockMeshTransparency]
206
- ] # value = {'FullOpaque': <BlockMeshTransparency.FullOpaque: 0>, 'FullTranslucent': <BlockMeshTransparency.FullTranslucent: 1>, 'Partial': <BlockMeshTransparency.Partial: 2>}
207
- def __eq__(self, other: typing.Any) -> bool: ...
208
- def __ge__(self, other: typing.Any) -> bool: ...
209
- def __gt__(self, other: typing.Any) -> bool: ...
210
- def __hash__(self) -> int: ...
211
- def __index__(self) -> int: ...
212
- def __init__(self, value: int) -> None: ...
213
- def __int__(self) -> int: ...
214
- def __le__(self, other: typing.Any) -> bool: ...
215
- def __lt__(self, other: typing.Any) -> bool: ...
216
- def __ne__(self, other: typing.Any) -> bool: ...
217
- def __repr__(self) -> str: ...
218
- def __str__(self) -> str: ...
219
- @property
220
- def name(self) -> str: ...
221
- @property
222
- def value(self) -> int: ...
223
-
224
- class FloatVec2:
225
- """
226
- A 2D floating point vector
227
- """
228
-
229
- x: float
230
- y: float
231
- def __init__(self, x: float, y: float) -> None: ...
232
-
233
- class FloatVec3:
234
- """
235
- A 3D floating point vector
236
- """
237
-
238
- x: float
239
- y: float
240
- z: float
241
- def __init__(self, x: float, y: float, z: float) -> None: ...
242
-
243
- class Triangle:
244
- """
245
- The vertex and texture indexes that make up a triangle.
246
- """
247
-
248
- texture_index: int
249
- vert_index_a: int
250
- vert_index_b: int
251
- vert_index_c: int
252
- def __init__(
253
- self,
254
- vert_index_a: int,
255
- vert_index_b: int,
256
- vert_index_c: int,
257
- texture_index: int,
258
- ) -> None: ...
259
-
260
- class Vertex:
261
- """
262
- Attributes for a single vertex.
263
- """
264
-
265
- def __init__(
266
- self, coord: FloatVec3, texture_coord: FloatVec2, tint: FloatVec3
267
- ) -> None: ...
268
- @property
269
- def coord(self) -> FloatVec3:
270
- """
271
- The spatial coordinate of the vertex.
272
- """
273
-
274
- @coord.setter
275
- def coord(self, arg0: FloatVec3) -> None: ...
276
- @property
277
- def texture_coord(self) -> FloatVec2:
278
- """
279
- The texture coordinate of the vertex.
280
- """
281
-
282
- @texture_coord.setter
283
- def texture_coord(self, arg0: FloatVec2) -> None: ...
284
- @property
285
- def tint(self) -> FloatVec3:
286
- """
287
- The tint colour for the vertex.
288
- """
289
-
290
- @tint.setter
291
- def tint(self, arg0: FloatVec3) -> None: ...
292
-
293
- def merge_block_meshes(meshes: collections.abc.Sequence[BlockMesh]) -> BlockMesh:
294
- """
295
- Merge multiple block mesh objects into one block mesh.
296
- """
297
-
298
- CUBE_FACE_LUT: dict # value = {'down': array([0, 4, 5, 1]), 'up': array([3, 7, 6, 2]), 'north': array([4, 0, 2, 6]), 'east': array([5, 4, 6, 7]), 'south': array([1, 5, 7, 3]), 'west': array([0, 1, 3, 2])}
299
- FACE_KEYS: dict # value = {None: <BlockMeshCullDirection.CullNone: 0>, 'up': <BlockMeshCullDirection.CullUp: 1>, 'down': <BlockMeshCullDirection.CullDown: 2>, 'north': <BlockMeshCullDirection.CullNorth: 3>, 'east': <BlockMeshCullDirection.CullEast: 4>, 'south': <BlockMeshCullDirection.CullSouth: 5>, 'west': <BlockMeshCullDirection.CullWest: 6>}
300
- TRI_FACE: numpy.ndarray # value = array([0, 1, 2, 0, 2, 3], dtype=uint32)
301
- UV_ROTATION_LUT: list = [0, 3, 2, 3, 2, 1, 0, 1]
@@ -1,198 +0,0 @@
1
- from typing import TypeAlias
2
- import numpy
3
- import itertools
4
-
5
- from amulet.mesh.block import (
6
- BlockMesh,
7
- BlockMeshPart,
8
- Triangle,
9
- Vertex,
10
- FloatVec3,
11
- FloatVec2,
12
- BlockMeshTransparency,
13
- BlockMeshCullDirection,
14
- )
15
-
16
- BoundsType: TypeAlias = tuple[
17
- tuple[float, float], tuple[float, float], tuple[float, float]
18
- ]
19
- TextureUVType: TypeAlias = tuple[
20
- tuple[float, float, float, float],
21
- tuple[float, float, float, float],
22
- tuple[float, float, float, float],
23
- tuple[float, float, float, float],
24
- tuple[float, float, float, float],
25
- tuple[float, float, float, float],
26
- ]
27
-
28
- UNIT_BOX_COORDINATES = numpy.array(
29
- list(itertools.product((0, 1), (0, 1), (0, 1)))
30
- ) # X, Y, Z
31
-
32
- CULL_DIRECTION_NAMES = (
33
- "down",
34
- "up",
35
- "north",
36
- "east",
37
- "south",
38
- "west",
39
- )
40
-
41
- # This maps face direction to the vertices used (defined in UNIT_BOX_COORDINATES)
42
- VERTEX_INDEXES = (
43
- numpy.array([0, 4, 5, 1]),
44
- numpy.array([3, 7, 6, 2]),
45
- numpy.array([4, 0, 2, 6]),
46
- numpy.array([5, 4, 6, 7]),
47
- numpy.array([1, 5, 7, 3]),
48
- numpy.array([0, 1, 3, 2]),
49
- )
50
-
51
- # This maps face direction to the vertices used (defined in UNIT_BOX_COORDINATES)
52
- CUBE_FACE_LUT = dict(zip(CULL_DIRECTION_NAMES, VERTEX_INDEXES))
53
-
54
- TRI_FACE = numpy.array([0, 1, 2, 0, 2, 3], numpy.uint32)
55
-
56
- # cube_vert_lut = { # This maps from vertex index to index in [minx, miny, minz, maxx, maxy, maxz]
57
- # 1: [0, 1, 5],
58
- # 3: [0, 4, 5],
59
- # 0: [0, 1, 2],
60
- # 2: [0, 4, 2],
61
- # 5: [3, 1, 5],
62
- # 7: [3, 4, 5],
63
- # 4: [3, 1, 2],
64
- # 6: [3, 4, 2],
65
- # }
66
- #
67
- # # combines the above two to map from face to index in [minx, miny, minz, maxx, maxy, maxz]. Used to index a numpy array
68
- # # The above two have been kept separate because the merged result is unintuitive and difficult to edit.
69
- # cube_lut = {
70
- # face_dir_: [
71
- # vert_coord_ for vert_ in vert_index_ for vert_coord_ in cube_vert_lut[vert_]
72
- # ]
73
- # for face_dir_, vert_index_ in CUBE_FACE_LUT.items()
74
- # }
75
-
76
- UV_ROTATION_LUT = [0, 3, 2, 3, 2, 1, 0, 1] # remap
77
-
78
-
79
- # tvert_lut = { # TODO: implement this for the cases where the UV is not defined
80
- # 'down': [],
81
- # 'up': [],
82
- # 'north': [],
83
- # 'east': [],
84
- # 'south': [],
85
- # 'west': []
86
- # }
87
-
88
-
89
- def get_cube(
90
- down: str,
91
- up: str,
92
- north: str,
93
- east: str,
94
- south: str,
95
- west: str,
96
- transparency: BlockMeshTransparency = BlockMeshTransparency.FullOpaque,
97
- tint: tuple[int, int, int] = (1, 1, 1),
98
- bounds: BoundsType = ((0, 1), (0, 1), (0, 1)),
99
- texture_uv: TextureUVType = ((0, 0, 1, 1),) * 6,
100
- do_not_cull: tuple[bool, bool, bool, bool, bool, bool] = (
101
- False,
102
- False,
103
- False,
104
- False,
105
- False,
106
- False,
107
- ),
108
- ) -> BlockMesh:
109
- texture_paths: dict[str, int] = {}
110
- mesh_parts: list[tuple[list[Vertex], list[Triangle]] | None] = [
111
- None,
112
- None,
113
- None,
114
- None,
115
- None,
116
- None,
117
- None,
118
- ]
119
- box_coordinates = list(itertools.product(*bounds))
120
- tint_vec = FloatVec3(*tint)
121
-
122
- for (
123
- cull_direction,
124
- vertex_index,
125
- do_not_cull_face,
126
- texture_path,
127
- texture_coords,
128
- ) in zip(
129
- (
130
- BlockMeshCullDirection.CullDown,
131
- BlockMeshCullDirection.CullUp,
132
- BlockMeshCullDirection.CullNorth,
133
- BlockMeshCullDirection.CullEast,
134
- BlockMeshCullDirection.CullSouth,
135
- BlockMeshCullDirection.CullWest,
136
- ),
137
- VERTEX_INDEXES,
138
- do_not_cull,
139
- (down, up, north, east, south, west),
140
- texture_uv,
141
- ):
142
- # Get the index of the texture path. Add if it is not contained.
143
- texture_index = texture_paths.setdefault(texture_path, len(texture_paths))
144
- if do_not_cull_face:
145
- cull_direction = BlockMeshCullDirection.CullNone
146
- part = mesh_parts[cull_direction]
147
- if part is None:
148
- mesh_parts[cull_direction] = part = ([], [])
149
- verts, tris = part
150
- vert_count = len(verts)
151
-
152
- for i in range(4):
153
- x, y, z = box_coordinates[vertex_index[i]]
154
- uvx = texture_coords[UV_ROTATION_LUT[i * 2]]
155
- uvy = texture_coords[UV_ROTATION_LUT[i * 2 + 1]]
156
- verts.append(
157
- Vertex(
158
- FloatVec3(x, y, z),
159
- FloatVec2(uvx, uvy),
160
- tint_vec,
161
- )
162
- )
163
- for a, b, c in TRI_FACE.reshape((2, 3)):
164
- tris.append(
165
- Triangle(a + vert_count, b + vert_count, c + vert_count, texture_index)
166
- )
167
-
168
- def create_part(
169
- part: tuple[list[Vertex], list[Triangle]] | None
170
- ) -> BlockMeshPart | None:
171
- return None if part is None else BlockMeshPart(*part)
172
-
173
- return BlockMesh(
174
- transparency,
175
- list(texture_paths),
176
- (
177
- create_part(mesh_parts[0]),
178
- create_part(mesh_parts[1]),
179
- create_part(mesh_parts[2]),
180
- create_part(mesh_parts[3]),
181
- create_part(mesh_parts[4]),
182
- create_part(mesh_parts[5]),
183
- create_part(mesh_parts[6]),
184
- ),
185
- )
186
-
187
-
188
- def get_unit_cube(
189
- down: str,
190
- up: str,
191
- north: str,
192
- east: str,
193
- south: str,
194
- west: str,
195
- transparency: BlockMeshTransparency = BlockMeshTransparency.FullOpaque,
196
- tint: tuple[int, int, int] = (1, 1, 1),
197
- ) -> BlockMesh:
198
- return get_cube(down, up, north, east, south, west, transparency, tint)
@@ -1,20 +0,0 @@
1
- from __future__ import annotations
2
- from typing import TYPE_CHECKING
3
-
4
- from amulet.mesh.block import BlockMesh
5
- from ._cube import get_unit_cube
6
-
7
- if TYPE_CHECKING:
8
- from amulet.resource_pack.abc import BaseResourcePackManager
9
-
10
-
11
- def get_missing_block(resource_pack: BaseResourcePackManager) -> BlockMesh:
12
- texture_path = resource_pack.get_texture_path("minecraft", "missing_no")
13
- return get_unit_cube(
14
- texture_path,
15
- texture_path,
16
- texture_path,
17
- texture_path,
18
- texture_path,
19
- texture_path,
20
- )
@@ -1,107 +0,0 @@
1
- #include <string>
2
- #include <array>
3
- #include <functional>
4
- #include "block_mesh.hpp"
5
-
6
- namespace Amulet {
7
-
8
- const std::array<BlockMeshCullDirection, 4> roty_map = { BlockMeshCullNorth, BlockMeshCullEast, BlockMeshCullSouth, BlockMeshCullWest };
9
-
10
- const RotationCullMapType RotationCullMap = []() {
11
- RotationCullMapType cull_map;
12
- for (std::int8_t roty = -3; roty < 4; roty++) {
13
- // Create the rotated Y array
14
- std::array<BlockMeshCullDirection, 4> roty_map_rotated;
15
- auto split_y_point = 0 <= roty ? roty : roty + roty_map.size();
16
- std::copy(roty_map.begin() + split_y_point, roty_map.end(), roty_map_rotated.begin());
17
- std::copy(roty_map.begin(), roty_map.begin() + split_y_point, roty_map_rotated.end() - split_y_point);
18
- // Create the X array
19
- const std::array<BlockMeshCullDirection, 4> rotx_map = { roty_map_rotated[0], BlockMeshCullDown, roty_map_rotated[2], BlockMeshCullUp };
20
-
21
- for (std::int8_t rotx = -3; rotx < 4; rotx++) {
22
- // Create the rotated X array
23
- std::array<BlockMeshCullDirection, 4> rotx_map_rotated;
24
- auto split_x_point = 0 <= rotx ? rotx : rotx + rotx_map.size();
25
- std::copy(rotx_map.begin() + split_x_point, rotx_map.end(), rotx_map_rotated.begin());
26
- std::copy(rotx_map.begin(), rotx_map.begin() + split_x_point, rotx_map_rotated.end() - split_x_point);
27
-
28
- cull_map[std::make_pair(roty, rotx)] = {
29
- BlockMeshCullNone,
30
- rotx_map_rotated[3],
31
- rotx_map_rotated[1],
32
- rotx_map_rotated[0],
33
- roty_map_rotated[1],
34
- rotx_map_rotated[2],
35
- roty_map_rotated[3]
36
- };
37
- }
38
- }
39
- return cull_map;
40
- }();
41
-
42
- BlockMesh merge_block_meshes(std::vector<std::reference_wrapper<const BlockMesh>> meshes) {
43
- BlockMesh new_mesh;
44
- new_mesh.transparency = BlockMeshTransparency::Partial;
45
- std::map<std::string, size_t> texture_index_map;
46
- for (const auto& wrapper : meshes) {
47
- const auto& temp_mesh = wrapper.get();
48
- // Get the minimum transparency of the two meshes.
49
- new_mesh.transparency = std::min(new_mesh.transparency, temp_mesh.transparency);
50
-
51
- // Copy over mesh parts
52
- for (std::uint8_t cull_direction = 0; cull_direction < 7; cull_direction++) {
53
- const auto& temp_mesh_part = temp_mesh.parts[cull_direction];
54
- if (temp_mesh_part) {
55
- auto& new_mesh_part = new_mesh.parts[cull_direction];
56
- if (!new_mesh_part) {
57
- // Initialise the mesh part if it is null.
58
- new_mesh_part = BlockMeshPart();
59
- }
60
- // Get the number of triangles before copying
61
- size_t vert_count = new_mesh_part->verts.size();
62
- size_t triangle_count = new_mesh_part->triangles.size();
63
-
64
- auto& new_verts = new_mesh_part->verts;
65
- auto& temp_verts = temp_mesh_part->verts;
66
- auto& new_triangles = new_mesh_part->triangles;
67
- auto& temp_triangles = temp_mesh_part->triangles;
68
-
69
- // Copy over vertices
70
- new_verts.insert(
71
- new_verts.end(),
72
- temp_verts.begin(),
73
- temp_verts.end());
74
- // Copy over triangles
75
- new_triangles.insert(
76
- new_triangles.end(),
77
- temp_triangles.begin(),
78
- temp_triangles.end());
79
-
80
- for (size_t i = triangle_count; i < new_mesh_part->triangles.size(); i++) {
81
- // Update the triangle indexes
82
- auto& triangle = new_mesh_part->triangles[i];
83
- triangle.vert_index_a += vert_count;
84
- triangle.vert_index_b += vert_count;
85
- triangle.vert_index_c += vert_count;
86
- if (temp_mesh.textures.size() <= triangle.texture_index) {
87
- throw std::invalid_argument("Texture index is higher than the number of textures.");
88
- }
89
- const auto& texture_path = temp_mesh.textures[triangle.texture_index];
90
- auto it = texture_index_map.find(texture_path);
91
- if (it == texture_index_map.end()) {
92
- // Texture has not been added yet.
93
- size_t texture_index = new_mesh.textures.size();
94
- new_mesh.textures.push_back(texture_path);
95
- triangle.texture_index = texture_index;
96
- texture_index_map[texture_path] = texture_index;
97
- } else {
98
- triangle.texture_index = it->second;
99
- }
100
- }
101
- }
102
- }
103
- }
104
- return new_mesh;
105
- }
106
-
107
- }