amulet-core 2.0a6__cp312-cp312-win_amd64.whl → 2.0a8__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 (149) hide show
  1. amulet/__init__.cp312-win_amd64.pyd +0 -0
  2. amulet/__init__.py.cpp +6 -0
  3. amulet/__init__.pyi +2 -2
  4. amulet/_init.py +0 -2
  5. amulet/_version.py +3 -3
  6. amulet/biome.pyi +0 -2
  7. amulet/block.pyi +0 -2
  8. amulet/block_entity.pyi +0 -2
  9. amulet/chunk.hpp +2 -1
  10. amulet/chunk.pyi +0 -2
  11. amulet/chunk_components.pyi +20 -18
  12. amulet/collections/eq.py.hpp +1 -1
  13. amulet/collections/mapping.py.hpp +18 -11
  14. amulet/collections/mutable_mapping.py.hpp +17 -6
  15. amulet/collections/sequence.py.hpp +5 -6
  16. amulet/collections.pyi +8 -5
  17. amulet/entity.py +22 -20
  18. amulet/game/translate/_functions/_code_functions/_text.py +2 -2
  19. amulet/game/translate/_functions/abc.py +10 -3
  20. amulet/img/__init__.py +10 -0
  21. amulet/img/missing_no.png +0 -0
  22. amulet/img/missing_pack.png +0 -0
  23. amulet/level/__init__.pyi +2 -6
  24. amulet/level/abc/_chunk_handle.py +45 -22
  25. amulet/level/abc/_level/_creatable_level.py +1 -2
  26. amulet/level/abc/_level/_level.py +1 -5
  27. amulet/level/java/__init__.pyi +0 -5
  28. amulet/level/java/_raw/__init__.pyi +0 -4
  29. amulet/level/java/_raw/java_chunk_decode.cpp +2 -4
  30. amulet/level/java/long_array.pyi +2 -1
  31. amulet/mesh/block/__init__.pyi +301 -0
  32. amulet/mesh/block/_cube.py +198 -0
  33. amulet/mesh/block/_missing_block.py +20 -0
  34. amulet/mesh/block/block_mesh.cpp +107 -0
  35. amulet/mesh/block/block_mesh.hpp +207 -0
  36. amulet/mesh/util.py +17 -0
  37. amulet/player.py +4 -6
  38. amulet/pybind11/collections.hpp +80 -38
  39. amulet/pybind11/numpy.hpp +26 -0
  40. amulet/pybind11/py_module.hpp +16 -51
  41. amulet/pybind11/type_hints.hpp +51 -0
  42. amulet/pybind11/types.hpp +14 -6
  43. amulet/pybind11/typing.hpp +7 -0
  44. amulet/resource_pack/__init__.py +63 -0
  45. amulet/resource_pack/abc/__init__.py +2 -0
  46. amulet/resource_pack/abc/resource_pack.py +38 -0
  47. amulet/resource_pack/abc/resource_pack_manager.py +85 -0
  48. amulet/resource_pack/java/__init__.py +2 -0
  49. amulet/resource_pack/java/download_resources.py +212 -0
  50. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_black.png +0 -0
  51. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_blue.png +0 -0
  52. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_brown.png +0 -0
  53. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_cyan.png +0 -0
  54. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_gray.png +0 -0
  55. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_green.png +0 -0
  56. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_light_blue.png +0 -0
  57. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_light_gray.png +0 -0
  58. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_lime.png +0 -0
  59. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_magenta.png +0 -0
  60. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_orange.png +0 -0
  61. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_pink.png +0 -0
  62. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_purple.png +0 -0
  63. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_red.png +0 -0
  64. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_white.png +0 -0
  65. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_yellow.png +0 -0
  66. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/barrier.png +0 -0
  67. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/end_portal.png +0 -0
  68. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/grass.png +0 -0
  69. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/lava.png +0 -0
  70. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/structure_void.png +0 -0
  71. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/water.png +0 -0
  72. amulet/resource_pack/java/java_vanilla_fix/pack.png +0 -0
  73. amulet/resource_pack/java/resource_pack.py +44 -0
  74. amulet/resource_pack/java/resource_pack_manager.py +563 -0
  75. amulet/resource_pack/unknown_resource_pack.py +10 -0
  76. amulet/utils/__init__.pyi +0 -5
  77. amulet/utils/call_spec/_call_spec.py +2 -7
  78. amulet/utils/cast.py +10 -0
  79. amulet/utils/comment_json.py +188 -0
  80. amulet/utils/matrix.py +3 -3
  81. amulet/utils/numpy_helpers.py +2 -2
  82. amulet/utils/shareable_lock.py +2 -2
  83. amulet/utils/world_utils.py +2 -2
  84. amulet/version.pyi +0 -8
  85. {amulet_core-2.0a6.dist-info → amulet_core-2.0a8.dist-info}/METADATA +2 -2
  86. {amulet_core-2.0a6.dist-info → amulet_core-2.0a8.dist-info}/RECORD +91 -103
  87. {amulet_core-2.0a6.dist-info → amulet_core-2.0a8.dist-info}/WHEEL +1 -1
  88. amulet/chunk_/components/biome.py +0 -155
  89. amulet/chunk_/components/block_entity.py +0 -117
  90. amulet/chunk_/components/entity.py +0 -64
  91. amulet/chunk_/components/height_2d.py +0 -16
  92. amulet/level/bedrock/__init__.py +0 -2
  93. amulet/level/bedrock/_chunk_handle.py +0 -19
  94. amulet/level/bedrock/_dimension.py +0 -22
  95. amulet/level/bedrock/_level.py +0 -187
  96. amulet/level/bedrock/_raw/__init__.py +0 -5
  97. amulet/level/bedrock/_raw/_actor_counter.py +0 -53
  98. amulet/level/bedrock/_raw/_chunk.py +0 -54
  99. amulet/level/bedrock/_raw/_chunk_decode.py +0 -668
  100. amulet/level/bedrock/_raw/_chunk_encode.py +0 -602
  101. amulet/level/bedrock/_raw/_constant.py +0 -9
  102. amulet/level/bedrock/_raw/_dimension.py +0 -343
  103. amulet/level/bedrock/_raw/_level.py +0 -463
  104. amulet/level/bedrock/_raw/_level_dat.py +0 -90
  105. amulet/level/bedrock/_raw/_typing.py +0 -6
  106. amulet/level/bedrock/_raw/leveldb_chunk_versions.py +0 -83
  107. amulet/level/bedrock/chunk/__init__.py +0 -1
  108. amulet/level/bedrock/chunk/_chunk.py +0 -126
  109. amulet/level/bedrock/chunk/components/chunk_version.py +0 -12
  110. amulet/level/bedrock/chunk/components/finalised_state.py +0 -13
  111. amulet/level/bedrock/chunk/components/raw_chunk.py +0 -15
  112. amulet/level/construction/__init__.py +0 -0
  113. amulet/level/java/_chunk_handle.pyi +0 -15
  114. amulet/level/java/_dimension.pyi +0 -13
  115. amulet/level/java/_level.pyi +0 -120
  116. amulet/level/java/_raw/_chunk_decode.py +0 -561
  117. amulet/level/java/_raw/_chunk_encode.py +0 -463
  118. amulet/level/java/_raw/_constant.pyi +0 -20
  119. amulet/level/java/_raw/_data_pack/__init__.pyi +0 -8
  120. amulet/level/java/_raw/_data_pack/data_pack.pyi +0 -197
  121. amulet/level/java/_raw/_data_pack/data_pack_manager.pyi +0 -75
  122. amulet/level/java/_raw/_dimension.pyi +0 -72
  123. amulet/level/java/_raw/_level.pyi +0 -238
  124. amulet/level/java/_raw/_typing.pyi +0 -5
  125. amulet/level/java/anvil/__init__.pyi +0 -11
  126. amulet/level/java/anvil/_dimension.pyi +0 -109
  127. amulet/level/java/anvil/_region.pyi +0 -197
  128. amulet/level/java/anvil/_sector_manager.pyi +0 -142
  129. amulet/level/java_forge/__init__.py +0 -0
  130. amulet/level/mcstructure/__init__.py +0 -0
  131. amulet/level/nbt/__init__.py +0 -0
  132. amulet/level/schematic/__init__.py +0 -0
  133. amulet/level/sponge_schematic/__init__.py +0 -0
  134. amulet/pybind11/python.hpp +0 -14
  135. amulet/utils/call_spec/__init__.pyi +0 -53
  136. amulet/utils/call_spec/_call_spec.pyi +0 -272
  137. amulet/utils/matrix.pyi +0 -177
  138. amulet/utils/shareable_lock.pyi +0 -190
  139. amulet/utils/signal/__init__.pyi +0 -25
  140. amulet/utils/signal/_signal.pyi +0 -84
  141. amulet/utils/task_manager.pyi +0 -168
  142. amulet/utils/typing.py +0 -4
  143. amulet/utils/typing.pyi +0 -6
  144. amulet/utils/weakref.pyi +0 -50
  145. amulet/utils/world_utils.pyi +0 -109
  146. /amulet/img/{missing_world_icon.png → missing_world.png} +0 -0
  147. /amulet/{level/bedrock/chunk/components → mesh}/__init__.py +0 -0
  148. {amulet_core-2.0a6.dist-info → amulet_core-2.0a8.dist-info}/entry_points.txt +0 -0
  149. {amulet_core-2.0a6.dist-info → amulet_core-2.0a8.dist-info}/top_level.txt +0 -0
@@ -12,6 +12,7 @@ from amulet.chunk import Chunk, get_null_chunk
12
12
  from amulet.data_types import DimensionId
13
13
  from amulet.errors import ChunkDoesNotExist, ChunkLoadError
14
14
  from amulet.utils.signal import Signal
15
+ from amulet.utils.shareable_lock import ShareableRLock
15
16
 
16
17
  from ._level import LevelFriend, LevelT
17
18
  from ._history import HistoryManagerLayer
@@ -58,7 +59,7 @@ class ChunkHandle(
58
59
  Some internal synchronisation is done to catch some threading issues.
59
60
  """
60
61
 
61
- _lock: RLock
62
+ _lock: ShareableRLock
62
63
  _dimension: DimensionId
63
64
  _key: ChunkKey
64
65
  _chunk_history: HistoryManagerLayer[ChunkKey]
@@ -84,7 +85,7 @@ class ChunkHandle(
84
85
  cz: int,
85
86
  ) -> None:
86
87
  super().__init__(level_ref)
87
- self._lock = RLock()
88
+ self._lock = ShareableRLock()
88
89
  self._dimension_id = dimension_id
89
90
  self._key = ChunkKey(cx, cz)
90
91
  self._chunk_history = chunk_history
@@ -135,13 +136,7 @@ class ChunkHandle(
135
136
  :raises:
136
137
  LockNotAcquired: If the lock could not be acquired.
137
138
  """
138
- if not self._lock.acquire(blocking, timeout):
139
- # Thread was not acquired
140
- raise LockNotAcquired("Lock was not acquired.")
141
- try:
142
- yield
143
- finally:
144
- self._lock.release()
139
+ return self._lock.unique(blocking, timeout)
145
140
 
146
141
  @contextmanager
147
142
  def edit(
@@ -171,7 +166,7 @@ class ChunkHandle(
171
166
  :raises:
172
167
  LockNotAcquired: If the lock could not be acquired.
173
168
  """
174
- with self.lock(blocking=blocking, timeout=timeout):
169
+ with self._lock.unique(blocking=blocking, timeout=timeout):
175
170
  chunk = self.get(components)
176
171
  yield chunk
177
172
  # If an exception occurs in user code, this line won't be run.
@@ -187,14 +182,18 @@ class ChunkHandle(
187
182
 
188
183
  :return: True if the chunk exists. Calling get on this chunk handle may still throw ChunkLoadError
189
184
  """
190
- if self._chunk_history.has_resource(self._key):
191
- return self._chunk_history.resource_exists(self._key)
192
- else:
193
- # The history system is not aware of the chunk. Look in the level data
194
- return self._get_raw_dimension().has_chunk(self.cx, self.cz)
185
+ with self._lock.shared():
186
+ if self._chunk_history.has_resource(self._key):
187
+ return self._chunk_history.resource_exists(self._key)
188
+ else:
189
+ # The history system is not aware of the chunk. Look in the level data
190
+ return self._get_raw_dimension().has_chunk(self.cx, self.cz)
195
191
 
196
192
  def _preload(self) -> None:
197
- """Load the chunk data if it has not already been loaded."""
193
+ """
194
+ Load the chunk data if it has not already been loaded.
195
+ The lock must be acquired in unique mode before calling this.
196
+ """
198
197
  if not self._chunk_history.has_resource(self._key):
199
198
  # The history system is not aware of the chunk. Load from the level data
200
199
  chunk: Chunk
@@ -260,8 +259,9 @@ class ChunkHandle(
260
259
  :param components: None to load all components or an iterable of component strings to load.
261
260
  :return: A unique copy of the chunk data.
262
261
  """
263
- with self.lock(blocking=False):
264
- self._preload()
262
+
263
+ def get_chunk() -> ChunkT:
264
+ nonlocal components
265
265
  chunk = self._get_null_chunk()
266
266
  if components is None:
267
267
  components = chunk.component_ids
@@ -276,8 +276,25 @@ class ChunkHandle(
276
276
  chunk.reconstruct_chunk(chunk_components)
277
277
  return chunk
278
278
 
279
+ # Block if the chunk is locked in unique mode.
280
+ with self._lock.shared():
281
+ if self._chunk_history.has_resource(self._key):
282
+ # Does not need loading from disk.
283
+ return get_chunk()
284
+
285
+ # Acquire the lock in unique mode.
286
+ with self._lock.unique():
287
+ # If it wasn't already loaded by another thread.
288
+ if not self._chunk_history.has_resource(self._key):
289
+ # Load it from disk.
290
+ self._preload()
291
+
292
+ with self._lock.shared():
293
+ # If it was loaded in another thread just read it from the cache.
294
+ return get_chunk()
295
+
279
296
  def _set(self, chunk: ChunkT | None) -> None:
280
- """Lock must be acquired before calling this"""
297
+ """lock must be acquired in unique mode before calling this."""
281
298
  history = self._chunk_history
282
299
  if not history.has_resource(self._key):
283
300
  if self._l.history_enabled:
@@ -322,14 +339,20 @@ class ChunkHandle(
322
339
  :raises:
323
340
  LockNotAcquired: If the chunk is already locked by another thread.
324
341
  """
325
- with self.lock(blocking=False):
342
+ with self._lock.unique(blocking=False):
326
343
  self._set(chunk)
327
344
  self.changed.emit()
328
345
  self._l.changed.emit()
329
346
 
330
347
  def delete(self) -> None:
331
- """Delete the chunk from the level."""
332
- with self.lock(blocking=False):
348
+ """
349
+ Delete the chunk from the level.
350
+ You must acquire the chunk lock before deleting.
351
+
352
+ :raises:
353
+ LockNotAcquired: If the chunk is already locked by another thread.
354
+ """
355
+ with self._lock.unique(blocking=False):
333
356
  self._set(None)
334
357
  self.changed.emit()
335
358
  self._l.changed.emit()
@@ -2,7 +2,6 @@ from __future__ import annotations
2
2
  from abc import ABC, abstractmethod
3
3
  from typing import TYPE_CHECKING, Any
4
4
 
5
- from amulet.utils.typing import Intersection
6
5
  from amulet.utils.call_spec import method_spec
7
6
 
8
7
 
@@ -18,7 +17,7 @@ class CreatableLevel(ABC):
18
17
  @classmethod
19
18
  @abstractmethod
20
19
  @method_spec()
21
- def create(cls, *args: Any, **kwargs: Any) -> Intersection[Level, CreatableLevel]:
20
+ def create(cls, *args: Any, **kwargs: Any) -> Level:
22
21
  """
23
22
  Create a new instance without any existing data.
24
23
  You must call :meth:`~amulet.level.abc.Level.open` to open the level for editing.
@@ -3,16 +3,15 @@ from __future__ import annotations
3
3
  from abc import ABC, abstractmethod
4
4
  from typing import TYPE_CHECKING, Optional, TypeVar, Type, Generic, Iterator, Callable
5
5
  from contextlib import contextmanager, AbstractContextManager as ContextManager
6
- import os
7
6
  import logging
8
7
  from weakref import finalize
9
8
 
10
9
  from runtime_final import final
11
10
  from PIL import Image
12
11
 
13
- from amulet import IMG_DIRECTORY
14
12
  from amulet.version import PlatformType, VersionNumber
15
13
  from amulet.data_types import DimensionId
14
+ from amulet.img import missing_world_icon_path
16
15
 
17
16
  from amulet.chunk import Chunk
18
17
 
@@ -31,9 +30,6 @@ if TYPE_CHECKING:
31
30
 
32
31
  log = logging.getLogger(__name__)
33
32
 
34
- missing_world_icon_path = os.path.abspath(
35
- os.path.join(IMG_DIRECTORY, "missing_world_icon.png")
36
- )
37
33
  missing_world_icon: Optional[Image.Image] = None
38
34
 
39
35
 
@@ -1,7 +1,5 @@
1
1
  from __future__ import annotations
2
2
 
3
- import typing
4
-
5
3
  from amulet.level.java._level import JavaLevel
6
4
 
7
5
  from . import (
@@ -16,6 +14,3 @@ from . import (
16
14
  )
17
15
 
18
16
  __all__ = ["JavaLevel", "anvil", "chunk", "chunk_components", "long_array"]
19
-
20
- def __dir__() -> typing.Any: ...
21
- def __getattr__(arg0: typing.Any) -> typing.Any: ...
@@ -1,6 +1,5 @@
1
1
  from __future__ import annotations
2
2
 
3
- import typing
4
3
  from builtins import str as InternalDimensionId
5
4
 
6
5
  from amulet.level.java._raw._dimension import JavaRawDimension
@@ -14,6 +13,3 @@ __all__ = [
14
13
  "JavaRawDimension",
15
14
  "JavaRawLevel",
16
15
  ]
17
-
18
- def __dir__() -> typing.Any: ...
19
- def __getattr__(arg0: typing.Any) -> typing.Any: ...
@@ -10,8 +10,6 @@
10
10
 
11
11
  #include <pybind11/pybind11.h>
12
12
 
13
- #include <amulet/pybind11/python.hpp>
14
-
15
13
  #include <amulet_nbt/tag/named_tag.hpp>
16
14
  #include <amulet_nbt/tag/compound.hpp>
17
15
 
@@ -316,7 +314,7 @@ namespace Amulet {
316
314
 
317
315
  // TODO: convert this to C++
318
316
  py::object waterloggable = game_version.attr("block").attr("waterloggable")(block_namespace, block_base_name);
319
- if (py::equals(waterloggable, WaterloggableYes)) {
317
+ if (waterloggable.equal(WaterloggableYes)) {
320
318
  auto waterlogged_it = block_properties.find("waterlogged");
321
319
  if (
322
320
  waterlogged_it != block_properties.end() and
@@ -328,7 +326,7 @@ namespace Amulet {
328
326
  block_properties.erase(waterlogged_it);
329
327
  }
330
328
  }
331
- else if (py::equals(waterloggable, WaterloggableAlways)) {
329
+ else if (waterloggable.equal(WaterloggableAlways)) {
332
330
  blocks.push_back(get_water());
333
331
  }
334
332
  blocks.insert(
@@ -1,6 +1,7 @@
1
1
  from __future__ import annotations
2
2
 
3
3
  import numpy
4
+ import numpy.typing
4
5
  import typing_extensions
5
6
 
6
7
  __all__ = ["decode_long_array", "encode_long_array"]
@@ -26,7 +27,7 @@ def encode_long_array(
26
27
  bits_per_entry: None | int = None,
27
28
  dense: bool = True,
28
29
  min_bits_per_entry: int = 1,
29
- ) -> numpy.ndarray[numpy.uint64]:
30
+ ) -> numpy.typing.NDArray[numpy.uint64]:
30
31
  """
31
32
  Encode a long array (from BlockStates or Heightmaps)
32
33
 
@@ -0,0 +1,301 @@
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]