amulet-core 2.0a5__cp312-cp312-win_amd64.whl → 2.0a7__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 (232) hide show
  1. amulet/__init__.cp312-win_amd64.pyd +0 -0
  2. amulet/__init__.py.cpp +43 -0
  3. amulet/__init__.pyi +0 -2
  4. amulet/_init.py +0 -2
  5. amulet/_version.py +3 -3
  6. amulet/biome.py.cpp +122 -0
  7. amulet/biome.pyi +0 -2
  8. amulet/block.py.cpp +377 -0
  9. amulet/block.pyi +0 -2
  10. amulet/block_entity.py.cpp +115 -0
  11. amulet/block_entity.pyi +0 -2
  12. amulet/chunk.py.cpp +80 -0
  13. amulet/chunk.pyi +0 -2
  14. amulet/chunk_components/biome_3d_component.cpp +5 -0
  15. amulet/chunk_components/biome_3d_component.hpp +79 -0
  16. amulet/chunk_components/block_component.cpp +41 -0
  17. amulet/chunk_components/block_component.hpp +88 -0
  18. amulet/chunk_components/block_entity_component.cpp +5 -0
  19. amulet/chunk_components/block_entity_component.hpp +147 -0
  20. amulet/chunk_components/section_array_map.cpp +129 -0
  21. amulet/chunk_components/section_array_map.hpp +147 -0
  22. amulet/chunk_components.pyi +20 -18
  23. amulet/collections/eq.py.hpp +37 -0
  24. amulet/collections/hash.py.hpp +27 -0
  25. amulet/collections/holder.py.hpp +37 -0
  26. amulet/collections/iterator.py.hpp +80 -0
  27. amulet/collections/mapping.py.hpp +199 -0
  28. amulet/collections/mutable_mapping.py.hpp +226 -0
  29. amulet/collections/sequence.py.hpp +163 -0
  30. amulet/collections.pyi +8 -5
  31. amulet/entity.py +22 -20
  32. amulet/game/translate/_functions/_code_functions/_text.py +2 -2
  33. amulet/game/translate/_functions/abc.py +10 -3
  34. amulet/img/__init__.py +10 -0
  35. amulet/img/missing_no.png +0 -0
  36. amulet/img/missing_pack.png +0 -0
  37. amulet/img/missing_world.png +0 -0
  38. amulet/io/binary_reader.hpp +45 -0
  39. amulet/io/binary_writer.hpp +30 -0
  40. amulet/level/__init__.pyi +2 -6
  41. amulet/level/abc/_level/_creatable_level.py +1 -2
  42. amulet/level/abc/_level/_level.py +1 -5
  43. amulet/level/java/__init__.pyi +0 -5
  44. amulet/level/java/_raw/__init__.pyi +0 -4
  45. amulet/level/java/_raw/java_chunk_decode.cpp +531 -0
  46. amulet/level/java/_raw/java_chunk_decode.hpp +23 -0
  47. amulet/level/java/_raw/java_chunk_encode.cpp +25 -0
  48. amulet/level/java/_raw/java_chunk_encode.hpp +23 -0
  49. amulet/level/java/chunk_components/data_version_component.cpp +32 -0
  50. amulet/level/java/chunk_components/data_version_component.hpp +31 -0
  51. amulet/level/java/chunk_components/java_raw_chunk_component.cpp +56 -0
  52. amulet/level/java/chunk_components/java_raw_chunk_component.hpp +45 -0
  53. amulet/level/java/java_chunk.cpp +170 -0
  54. amulet/level/java/java_chunk.hpp +141 -0
  55. amulet/level/java/long_array.hpp +175 -0
  56. amulet/level/java/long_array.pyi +2 -1
  57. amulet/mesh/block/__init__.py +1 -0
  58. amulet/mesh/block/block_mesh.py +369 -0
  59. amulet/mesh/block/cube.py +149 -0
  60. amulet/mesh/block/missing_block.py +20 -0
  61. amulet/mesh/util.py +17 -0
  62. amulet/palette/biome_palette.hpp +85 -0
  63. amulet/palette/block_palette.cpp +32 -0
  64. amulet/palette/block_palette.hpp +93 -0
  65. amulet/player.py +4 -6
  66. amulet/pybind11/collections.hpp +118 -0
  67. amulet/pybind11/numpy.hpp +26 -0
  68. amulet/pybind11/py_module.hpp +34 -0
  69. amulet/pybind11/type_hints.hpp +51 -0
  70. amulet/pybind11/types.hpp +25 -0
  71. amulet/pybind11/typing.hpp +7 -0
  72. amulet/resource_pack/__init__.py +62 -0
  73. amulet/resource_pack/abc/__init__.py +2 -0
  74. amulet/resource_pack/abc/resource_pack.py +38 -0
  75. amulet/resource_pack/abc/resource_pack_manager.py +87 -0
  76. amulet/resource_pack/bedrock/__init__.py +2 -0
  77. amulet/resource_pack/bedrock/bedrock_vanilla_fix/pack_icon.png +0 -0
  78. amulet/resource_pack/bedrock/bedrock_vanilla_fix/textures/blocks/grass_carried.png +0 -0
  79. amulet/resource_pack/bedrock/bedrock_vanilla_fix/textures/blocks/grass_side_carried.png +0 -0
  80. amulet/resource_pack/bedrock/bedrock_vanilla_fix/textures/blocks/water.png +0 -0
  81. amulet/resource_pack/bedrock/blockshapes/__init__.py +31 -0
  82. amulet/resource_pack/bedrock/blockshapes/air.py +35 -0
  83. amulet/resource_pack/bedrock/blockshapes/base_blockshape.py +29 -0
  84. amulet/resource_pack/bedrock/blockshapes/bubble_column.py +29 -0
  85. amulet/resource_pack/bedrock/blockshapes/cake.py +46 -0
  86. amulet/resource_pack/bedrock/blockshapes/chest.py +54 -0
  87. amulet/resource_pack/bedrock/blockshapes/comparator.py +51 -0
  88. amulet/resource_pack/bedrock/blockshapes/cross_texture.py +186 -0
  89. amulet/resource_pack/bedrock/blockshapes/cross_texture0.py +17 -0
  90. amulet/resource_pack/bedrock/blockshapes/cross_texture_green.py +16 -0
  91. amulet/resource_pack/bedrock/blockshapes/cube.py +38 -0
  92. amulet/resource_pack/bedrock/blockshapes/default.py +14 -0
  93. amulet/resource_pack/bedrock/blockshapes/door.py +38 -0
  94. amulet/resource_pack/bedrock/blockshapes/door1.py +14 -0
  95. amulet/resource_pack/bedrock/blockshapes/door2.py +14 -0
  96. amulet/resource_pack/bedrock/blockshapes/door3.py +14 -0
  97. amulet/resource_pack/bedrock/blockshapes/door4.py +14 -0
  98. amulet/resource_pack/bedrock/blockshapes/door5.py +14 -0
  99. amulet/resource_pack/bedrock/blockshapes/door6.py +14 -0
  100. amulet/resource_pack/bedrock/blockshapes/double_plant.py +40 -0
  101. amulet/resource_pack/bedrock/blockshapes/enchanting_table.py +22 -0
  102. amulet/resource_pack/bedrock/blockshapes/farmland.py +22 -0
  103. amulet/resource_pack/bedrock/blockshapes/fence.py +22 -0
  104. amulet/resource_pack/bedrock/blockshapes/flat.py +55 -0
  105. amulet/resource_pack/bedrock/blockshapes/flat_wall.py +55 -0
  106. amulet/resource_pack/bedrock/blockshapes/furnace.py +44 -0
  107. amulet/resource_pack/bedrock/blockshapes/furnace_lit.py +14 -0
  108. amulet/resource_pack/bedrock/blockshapes/green_cube.py +39 -0
  109. amulet/resource_pack/bedrock/blockshapes/ladder.py +36 -0
  110. amulet/resource_pack/bedrock/blockshapes/lilypad.py +14 -0
  111. amulet/resource_pack/bedrock/blockshapes/partial_block.py +57 -0
  112. amulet/resource_pack/bedrock/blockshapes/piston.py +44 -0
  113. amulet/resource_pack/bedrock/blockshapes/piston_arm.py +72 -0
  114. amulet/resource_pack/bedrock/blockshapes/portal_frame.py +22 -0
  115. amulet/resource_pack/bedrock/blockshapes/pressure_plate.py +29 -0
  116. amulet/resource_pack/bedrock/blockshapes/pumpkin.py +36 -0
  117. amulet/resource_pack/bedrock/blockshapes/pumpkin_carved.py +14 -0
  118. amulet/resource_pack/bedrock/blockshapes/pumpkin_lit.py +14 -0
  119. amulet/resource_pack/bedrock/blockshapes/red_dust.py +14 -0
  120. amulet/resource_pack/bedrock/blockshapes/repeater.py +53 -0
  121. amulet/resource_pack/bedrock/blockshapes/slab.py +33 -0
  122. amulet/resource_pack/bedrock/blockshapes/slab_double.py +15 -0
  123. amulet/resource_pack/bedrock/blockshapes/tree.py +41 -0
  124. amulet/resource_pack/bedrock/blockshapes/turtle_egg.py +15 -0
  125. amulet/resource_pack/bedrock/blockshapes/vine.py +52 -0
  126. amulet/resource_pack/bedrock/blockshapes/wall.py +22 -0
  127. amulet/resource_pack/bedrock/blockshapes/water.py +38 -0
  128. amulet/resource_pack/bedrock/download_resources.py +147 -0
  129. amulet/resource_pack/bedrock/resource_pack.py +40 -0
  130. amulet/resource_pack/bedrock/resource_pack_manager.py +361 -0
  131. amulet/resource_pack/bedrock/sort_blockshapes.py +15 -0
  132. amulet/resource_pack/java/__init__.py +2 -0
  133. amulet/resource_pack/java/download_resources.py +212 -0
  134. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_black.png +0 -0
  135. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_blue.png +0 -0
  136. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_brown.png +0 -0
  137. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_cyan.png +0 -0
  138. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_gray.png +0 -0
  139. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_green.png +0 -0
  140. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_light_blue.png +0 -0
  141. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_light_gray.png +0 -0
  142. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_lime.png +0 -0
  143. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_magenta.png +0 -0
  144. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_orange.png +0 -0
  145. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_pink.png +0 -0
  146. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_purple.png +0 -0
  147. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_red.png +0 -0
  148. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_white.png +0 -0
  149. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_yellow.png +0 -0
  150. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/barrier.png +0 -0
  151. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/end_portal.png +0 -0
  152. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/grass.png +0 -0
  153. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/lava.png +0 -0
  154. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/structure_void.png +0 -0
  155. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/water.png +0 -0
  156. amulet/resource_pack/java/java_vanilla_fix/pack.png +0 -0
  157. amulet/resource_pack/java/resource_pack.py +44 -0
  158. amulet/resource_pack/java/resource_pack_manager.py +551 -0
  159. amulet/resource_pack/unknown_resource_pack.py +10 -0
  160. amulet/utils/__init__.pyi +0 -5
  161. amulet/utils/call_spec/_call_spec.py +2 -7
  162. amulet/utils/comment_json.py +188 -0
  163. amulet/utils/matrix.py +3 -3
  164. amulet/utils/numpy.hpp +36 -0
  165. amulet/utils/numpy_helpers.py +2 -2
  166. amulet/utils/world_utils.py +2 -2
  167. amulet/version.py.cpp +281 -0
  168. amulet/version.pyi +0 -8
  169. {amulet_core-2.0a5.dist-info → amulet_core-2.0a7.dist-info}/METADATA +3 -3
  170. amulet_core-2.0a7.dist-info/RECORD +295 -0
  171. amulet/chunk_/components/biome.py +0 -155
  172. amulet/chunk_/components/block_entity.py +0 -117
  173. amulet/chunk_/components/entity.py +0 -64
  174. amulet/chunk_/components/height_2d.py +0 -16
  175. amulet/level/bedrock/__init__.py +0 -2
  176. amulet/level/bedrock/_chunk_handle.py +0 -19
  177. amulet/level/bedrock/_dimension.py +0 -22
  178. amulet/level/bedrock/_level.py +0 -187
  179. amulet/level/bedrock/_raw/__init__.py +0 -5
  180. amulet/level/bedrock/_raw/_actor_counter.py +0 -53
  181. amulet/level/bedrock/_raw/_chunk.py +0 -54
  182. amulet/level/bedrock/_raw/_chunk_decode.py +0 -668
  183. amulet/level/bedrock/_raw/_chunk_encode.py +0 -602
  184. amulet/level/bedrock/_raw/_constant.py +0 -9
  185. amulet/level/bedrock/_raw/_dimension.py +0 -343
  186. amulet/level/bedrock/_raw/_level.py +0 -463
  187. amulet/level/bedrock/_raw/_level_dat.py +0 -90
  188. amulet/level/bedrock/_raw/_typing.py +0 -6
  189. amulet/level/bedrock/_raw/leveldb_chunk_versions.py +0 -83
  190. amulet/level/bedrock/chunk/__init__.py +0 -1
  191. amulet/level/bedrock/chunk/_chunk.py +0 -126
  192. amulet/level/bedrock/chunk/components/chunk_version.py +0 -12
  193. amulet/level/bedrock/chunk/components/finalised_state.py +0 -13
  194. amulet/level/bedrock/chunk/components/raw_chunk.py +0 -15
  195. amulet/level/construction/__init__.py +0 -0
  196. amulet/level/java/_chunk_handle.pyi +0 -15
  197. amulet/level/java/_dimension.pyi +0 -13
  198. amulet/level/java/_level.pyi +0 -120
  199. amulet/level/java/_raw/_chunk_decode.py +0 -561
  200. amulet/level/java/_raw/_chunk_encode.py +0 -463
  201. amulet/level/java/_raw/_constant.pyi +0 -20
  202. amulet/level/java/_raw/_data_pack/__init__.pyi +0 -8
  203. amulet/level/java/_raw/_data_pack/data_pack.pyi +0 -197
  204. amulet/level/java/_raw/_data_pack/data_pack_manager.pyi +0 -75
  205. amulet/level/java/_raw/_dimension.pyi +0 -72
  206. amulet/level/java/_raw/_level.pyi +0 -238
  207. amulet/level/java/_raw/_typing.pyi +0 -5
  208. amulet/level/java/anvil/__init__.pyi +0 -11
  209. amulet/level/java/anvil/_dimension.pyi +0 -109
  210. amulet/level/java/anvil/_region.pyi +0 -197
  211. amulet/level/java/anvil/_sector_manager.pyi +0 -142
  212. amulet/level/java_forge/__init__.py +0 -0
  213. amulet/level/mcstructure/__init__.py +0 -0
  214. amulet/level/nbt/__init__.py +0 -0
  215. amulet/level/schematic/__init__.py +0 -0
  216. amulet/level/sponge_schematic/__init__.py +0 -0
  217. amulet/utils/call_spec/__init__.pyi +0 -53
  218. amulet/utils/call_spec/_call_spec.pyi +0 -272
  219. amulet/utils/matrix.pyi +0 -177
  220. amulet/utils/shareable_lock.pyi +0 -190
  221. amulet/utils/signal/__init__.pyi +0 -25
  222. amulet/utils/signal/_signal.pyi +0 -84
  223. amulet/utils/task_manager.pyi +0 -168
  224. amulet/utils/typing.py +0 -4
  225. amulet/utils/typing.pyi +0 -6
  226. amulet/utils/weakref.pyi +0 -50
  227. amulet/utils/world_utils.pyi +0 -109
  228. amulet_core-2.0a5.dist-info/RECORD +0 -210
  229. /amulet/{level/bedrock/chunk/components → mesh}/__init__.py +0 -0
  230. {amulet_core-2.0a5.dist-info → amulet_core-2.0a7.dist-info}/WHEEL +0 -0
  231. {amulet_core-2.0a5.dist-info → amulet_core-2.0a7.dist-info}/entry_points.txt +0 -0
  232. {amulet_core-2.0a5.dist-info → amulet_core-2.0a7.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,29 @@
1
+ from amulet.block import Block
2
+ from amulet.mesh.block import BlockMesh
3
+
4
+
5
+ class BaseBlockShape:
6
+ @property
7
+ def blockshape(self) -> str:
8
+ raise NotImplementedError
9
+
10
+ def is_valid(self, block: Block) -> bool:
11
+ """Does the given block have the correct properties to use this blockshape"""
12
+ raise NotImplementedError
13
+
14
+ def texture_index(self, block: Block, aux_value: int) -> int:
15
+ """The texture index to use within the list for the given Block"""
16
+ raise NotImplementedError
17
+
18
+ def get_block_model(
19
+ self,
20
+ block: Block,
21
+ down: str,
22
+ up: str,
23
+ north: str,
24
+ east: str,
25
+ south: str,
26
+ west: str,
27
+ transparency: tuple[bool, bool, bool, bool, bool, bool],
28
+ ) -> BlockMesh:
29
+ raise NotImplementedError
@@ -0,0 +1,29 @@
1
+ from amulet.block import Block
2
+ from amulet.resource_pack.bedrock.blockshapes.cross_texture import (
3
+ Cross,
4
+ )
5
+ from amulet.mesh.block import BlockMesh
6
+
7
+
8
+ class BubbleColumn(Cross):
9
+ @property
10
+ def blockshape(self) -> str:
11
+ return "bubble_column"
12
+
13
+ def get_block_model(
14
+ self,
15
+ block: Block,
16
+ down: str,
17
+ up: str,
18
+ north: str,
19
+ east: str,
20
+ south: str,
21
+ west: str,
22
+ transparency: tuple[bool, bool, bool, bool, bool, bool],
23
+ ) -> BlockMesh:
24
+ return super().get_block_model(
25
+ block, north, north, north, north, north, north, transparency
26
+ )
27
+
28
+
29
+ BlockShape = BubbleColumn()
@@ -0,0 +1,46 @@
1
+ from amulet.block import Block
2
+ from amulet.resource_pack.bedrock.blockshapes.partial_block import (
3
+ PartialBlock,
4
+ )
5
+ from amulet_nbt import AbstractBaseIntTag, IntTag
6
+
7
+
8
+ class Cake(PartialBlock):
9
+ def is_valid(self, block: Block) -> bool:
10
+ return isinstance(block.properties.get("bite_counter"), IntTag)
11
+
12
+ @property
13
+ def blockshape(self) -> str:
14
+ return "cake"
15
+
16
+ def bounds(
17
+ self, block: Block
18
+ ) -> tuple[tuple[float, float], tuple[float, float], tuple[float, float]]:
19
+ bite_count = block.properties["bite_counter"]
20
+ return (
21
+ (
22
+ 1 / 16
23
+ + (
24
+ bite_count.py_int
25
+ if isinstance(bite_count, AbstractBaseIntTag)
26
+ else 0
27
+ )
28
+ * 2
29
+ / 16,
30
+ 15 / 16,
31
+ ),
32
+ (0, 0.5),
33
+ (1 / 16, 15 / 16),
34
+ )
35
+
36
+ def texture_index(self, block: Block, aux_value: int) -> int:
37
+ bite_counter = block.properties["bite_counter"]
38
+ assert isinstance(bite_counter, AbstractBaseIntTag)
39
+ return min(1, bite_counter.py_int)
40
+
41
+ @property
42
+ def do_not_cull(self) -> tuple[bool, bool, bool, bool, bool, bool]:
43
+ return False, True, True, True, True, True
44
+
45
+
46
+ BlockShape = Cake()
@@ -0,0 +1,54 @@
1
+ from typing import Any
2
+
3
+ from amulet.block import Block
4
+ from amulet.resource_pack.bedrock.blockshapes.partial_block import (
5
+ PartialBlock,
6
+ )
7
+ from amulet.mesh.block import BlockMesh
8
+
9
+
10
+ class Chest(PartialBlock):
11
+ @property
12
+ def blockshape(self) -> str:
13
+ return "chest"
14
+
15
+ def bounds(
16
+ self, block: Block
17
+ ) -> tuple[tuple[float, float], tuple[float, float], tuple[float, float]]:
18
+ return (1 / 16, 15 / 16), (0, 14 / 16), (1 / 16, 15 / 16)
19
+
20
+ def texture_index(self, block: Block, aux_value: int) -> int:
21
+ return 0
22
+
23
+ @property
24
+ def do_not_cull(self) -> tuple[bool, bool, bool, bool, bool, bool]:
25
+ return False, True, True, True, True, True
26
+
27
+ def get_block_model(
28
+ self,
29
+ block: Block,
30
+ down: str,
31
+ up: str,
32
+ north: str,
33
+ east: str,
34
+ south: str,
35
+ west: str,
36
+ transparency: tuple[bool, bool, bool, bool, bool, bool],
37
+ modify_uv: bool = True,
38
+ *args: Any,
39
+ **kwargs: Any
40
+ ) -> BlockMesh:
41
+ rotation = {2: 2, 3: 0, 4: 1, 5: 3}.get(
42
+ block.properties["facing_direction"].py_data, 0
43
+ )
44
+
45
+ return (
46
+ super()
47
+ .get_block_model(
48
+ block, down, up, north, east, south, west, transparency, modify_uv=False
49
+ )
50
+ .rotate(0, rotation)
51
+ )
52
+
53
+
54
+ BlockShape = Chest()
@@ -0,0 +1,51 @@
1
+ from typing import Any
2
+
3
+ from amulet.block import Block
4
+ from amulet.resource_pack.bedrock.blockshapes.partial_block import (
5
+ PartialBlock,
6
+ )
7
+ from amulet.mesh.block import BlockMesh
8
+ import amulet_nbt
9
+
10
+
11
+ class Comparator(PartialBlock):
12
+ def is_valid(self, block: Block) -> bool:
13
+ return isinstance(block.properties.get("direction"), amulet_nbt.TAG_Int)
14
+
15
+ @property
16
+ def blockshape(self) -> str:
17
+ return "comparator"
18
+
19
+ def texture_index(self, block: Block, aux_value: int) -> int:
20
+ return (aux_value >> 3) & 1
21
+
22
+ def bounds(
23
+ self, block: Block
24
+ ) -> tuple[tuple[float, float], tuple[float, float], tuple[float, float]]:
25
+ return (0, 1), (0, 2 / 16), (0, 1)
26
+
27
+ @property
28
+ def do_not_cull(self) -> tuple[bool, bool, bool, bool, bool, bool]:
29
+ return False, True, False, False, False, False
30
+
31
+ def get_block_model(
32
+ self,
33
+ block: Block,
34
+ down: str,
35
+ up: str,
36
+ north: str,
37
+ east: str,
38
+ south: str,
39
+ west: str,
40
+ transparency: tuple[bool, bool, bool, bool, bool, bool],
41
+ *args: Any,
42
+ **kwargs: Any
43
+ ) -> BlockMesh:
44
+ return (
45
+ super()
46
+ .get_block_model(block, down, up, north, east, south, west, transparency)
47
+ .rotate(0, block.properties["direction"].py_data)
48
+ )
49
+
50
+
51
+ BlockShape = Comparator()
@@ -0,0 +1,186 @@
1
+ import numpy
2
+
3
+ from amulet.block import Block
4
+ from amulet.mesh.block.block_mesh import BlockMesh, Transparency
5
+ from amulet.resource_pack.bedrock.blockshapes.base_blockshape import (
6
+ BaseBlockShape,
7
+ )
8
+
9
+
10
+ class Cross(BaseBlockShape):
11
+ @property
12
+ def blockshape(self) -> str:
13
+ return "cross_texture"
14
+
15
+ def is_valid(self, block: Block) -> bool:
16
+ """Does the given block have the correct properties to use this blockshape"""
17
+ return True
18
+
19
+ def texture_index(self, block: Block, aux_value: int) -> int:
20
+ """The texture index to use within the list for the given Block"""
21
+ return aux_value % 16
22
+
23
+ @property
24
+ def tint(self) -> tuple[float, float, float]:
25
+ return 1, 1, 1
26
+
27
+ def get_block_model(
28
+ self,
29
+ block: Block,
30
+ down: str,
31
+ up: str,
32
+ north: str,
33
+ east: str,
34
+ south: str,
35
+ west: str,
36
+ transparency: tuple[bool, bool, bool, bool, bool, bool],
37
+ ) -> BlockMesh:
38
+ return BlockMesh(
39
+ 3,
40
+ {
41
+ None: numpy.array(
42
+ [
43
+ 0.0625,
44
+ 0.0,
45
+ 0.0625,
46
+ 0.9375,
47
+ 0.0,
48
+ 0.9375,
49
+ 0.9375,
50
+ 1.0,
51
+ 0.9375,
52
+ 0.0625,
53
+ 1.0,
54
+ 0.0625,
55
+ 0.0625,
56
+ 0.0,
57
+ 0.9375,
58
+ 0.9375,
59
+ 0.0,
60
+ 0.0625,
61
+ 0.9375,
62
+ 1.0,
63
+ 0.0625,
64
+ 0.0625,
65
+ 1.0,
66
+ 0.9375,
67
+ 0.9375,
68
+ 0.0,
69
+ 0.0625,
70
+ 0.0625,
71
+ 0.0,
72
+ 0.9375,
73
+ 0.0625,
74
+ 1.0,
75
+ 0.9375,
76
+ 0.9375,
77
+ 1.0,
78
+ 0.0625,
79
+ 0.9375,
80
+ 0.0,
81
+ 0.9375,
82
+ 0.0625,
83
+ 0.0,
84
+ 0.0625,
85
+ 0.0625,
86
+ 1.0,
87
+ 0.0625,
88
+ 0.9375,
89
+ 1.0,
90
+ 0.9375,
91
+ ],
92
+ dtype=numpy.float32,
93
+ )
94
+ },
95
+ {
96
+ None: numpy.array(
97
+ [
98
+ 0.0,
99
+ 1.0,
100
+ 1.0,
101
+ 1.0,
102
+ 1.0,
103
+ 0.0,
104
+ 0.0,
105
+ 0.0,
106
+ 0.0,
107
+ 1.0,
108
+ 1.0,
109
+ 1.0,
110
+ 1.0,
111
+ 0.0,
112
+ 0.0,
113
+ 0.0,
114
+ 0.0,
115
+ 1.0,
116
+ 1.0,
117
+ 1.0,
118
+ 1.0,
119
+ 0.0,
120
+ 0.0,
121
+ 0.0,
122
+ 0.0,
123
+ 1.0,
124
+ 1.0,
125
+ 1.0,
126
+ 1.0,
127
+ 0.0,
128
+ 0.0,
129
+ 0.0,
130
+ ],
131
+ numpy.float32,
132
+ )
133
+ },
134
+ {None: numpy.array(self.tint * 16, numpy.float32)},
135
+ {
136
+ None: numpy.array(
137
+ [
138
+ 0,
139
+ 1,
140
+ 2,
141
+ 0,
142
+ 2,
143
+ 3,
144
+ 4,
145
+ 5,
146
+ 6,
147
+ 4,
148
+ 6,
149
+ 7,
150
+ 8,
151
+ 9,
152
+ 10,
153
+ 8,
154
+ 10,
155
+ 11,
156
+ 12,
157
+ 13,
158
+ 14,
159
+ 12,
160
+ 14,
161
+ 15,
162
+ ],
163
+ numpy.uint32,
164
+ )
165
+ },
166
+ {
167
+ None: numpy.array(
168
+ [
169
+ 0,
170
+ 0,
171
+ 0,
172
+ 0,
173
+ 0,
174
+ 0,
175
+ 0,
176
+ 0,
177
+ ],
178
+ numpy.uint32,
179
+ )
180
+ },
181
+ (up,),
182
+ Transparency.Partial,
183
+ )
184
+
185
+
186
+ BlockShape = Cross()
@@ -0,0 +1,17 @@
1
+ from amulet.block import Block
2
+ from amulet.resource_pack.bedrock.blockshapes.cross_texture import (
3
+ Cross,
4
+ )
5
+
6
+
7
+ class Cross0(Cross):
8
+ @property
9
+ def blockshape(self) -> str:
10
+ return "cross_texture0"
11
+
12
+ def texture_index(self, block: Block, aux_value: int) -> int:
13
+ """The texture index to use within the list for the given Block"""
14
+ return 0
15
+
16
+
17
+ BlockShape = Cross0()
@@ -0,0 +1,16 @@
1
+ from amulet.resource_pack.bedrock.blockshapes.cross_texture import (
2
+ Cross,
3
+ )
4
+
5
+
6
+ class CrossGreen(Cross):
7
+ @property
8
+ def blockshape(self) -> str:
9
+ return "cross_texture_green"
10
+
11
+ @property
12
+ def tint(self) -> tuple[float, float, float]:
13
+ return 0, 1, 0
14
+
15
+
16
+ BlockShape = CrossGreen()
@@ -0,0 +1,38 @@
1
+ from amulet.block import Block
2
+ from amulet.mesh.block.block_mesh import BlockMesh, Transparency
3
+ from amulet.mesh.block.cube import get_unit_cube
4
+ from amulet.resource_pack.bedrock.blockshapes.default import Default
5
+
6
+
7
+ class Cube(Default):
8
+ @property
9
+ def blockshape(self) -> str:
10
+ return "cube"
11
+
12
+ def get_block_model(
13
+ self,
14
+ block: Block,
15
+ down: str,
16
+ up: str,
17
+ north: str,
18
+ east: str,
19
+ south: str,
20
+ west: str,
21
+ transparency: tuple[bool, bool, bool, bool, bool, bool],
22
+ ) -> BlockMesh:
23
+ return get_unit_cube(
24
+ down,
25
+ up,
26
+ north,
27
+ east,
28
+ south,
29
+ west,
30
+ (
31
+ Transparency.FullTranslucent
32
+ if any(transparency)
33
+ else Transparency.FullOpaque
34
+ ),
35
+ )
36
+
37
+
38
+ BlockShape = Cube()
@@ -0,0 +1,14 @@
1
+ from amulet.block import Block
2
+ from amulet.resource_pack.bedrock.blockshapes.base_blockshape import (
3
+ BaseBlockShape,
4
+ )
5
+
6
+
7
+ class Default(BaseBlockShape):
8
+ def is_valid(self, block: Block) -> bool:
9
+ """Does the given block have the correct properties to use this blockshape"""
10
+ return True
11
+
12
+ def texture_index(self, block: Block, aux_value: int) -> int:
13
+ """The texture index to use within the list for the given Block"""
14
+ return aux_value % 16
@@ -0,0 +1,38 @@
1
+ from amulet.block import Block
2
+ from amulet.mesh.block import BlockMesh
3
+ from amulet.resource_pack.bedrock.blockshapes.cube import Cube
4
+ import amulet_nbt
5
+
6
+
7
+ class Door(Cube):
8
+ def is_valid(self, block: Block) -> bool:
9
+ return isinstance(block.properties.get("upper_block_bit"), amulet_nbt.TAG_Byte)
10
+
11
+ @property
12
+ def blockshape(self) -> str:
13
+ return "door"
14
+
15
+ def texture_index(self, block: Block, aux_value: int) -> int:
16
+ return 0
17
+
18
+ def get_block_model(
19
+ self,
20
+ block: Block,
21
+ down: str,
22
+ up: str,
23
+ north: str,
24
+ east: str,
25
+ south: str,
26
+ west: str,
27
+ transparency: tuple[bool, bool, bool, bool, bool, bool],
28
+ ) -> BlockMesh:
29
+ if block.properties["upper_block_bit"].py_data:
30
+ return super().get_block_model(
31
+ block, north, north, north, north, north, north, transparency
32
+ )
33
+ return super().get_block_model(
34
+ block, down, down, down, down, down, down, transparency
35
+ )
36
+
37
+
38
+ BlockShape = Door()
@@ -0,0 +1,14 @@
1
+ from amulet.block import Block
2
+ from amulet.resource_pack.bedrock.blockshapes.door import Door
3
+
4
+
5
+ class Door1(Door):
6
+ @property
7
+ def blockshape(self) -> str:
8
+ return "door1"
9
+
10
+ def texture_index(self, block: Block, aux_value: int) -> int:
11
+ return 1
12
+
13
+
14
+ BlockShape = Door1()
@@ -0,0 +1,14 @@
1
+ from amulet.block import Block
2
+ from amulet.resource_pack.bedrock.blockshapes.door import Door
3
+
4
+
5
+ class Door2(Door):
6
+ @property
7
+ def blockshape(self) -> str:
8
+ return "door2"
9
+
10
+ def texture_index(self, block: Block, aux_value: int) -> int:
11
+ return 2
12
+
13
+
14
+ BlockShape = Door2()
@@ -0,0 +1,14 @@
1
+ from amulet.block import Block
2
+ from amulet.resource_pack.bedrock.blockshapes.door import Door
3
+
4
+
5
+ class Door3(Door):
6
+ @property
7
+ def blockshape(self) -> str:
8
+ return "door3"
9
+
10
+ def texture_index(self, block: Block, aux_value: int) -> int:
11
+ return 3
12
+
13
+
14
+ BlockShape = Door3()
@@ -0,0 +1,14 @@
1
+ from amulet.block import Block
2
+ from amulet.resource_pack.bedrock.blockshapes.door import Door
3
+
4
+
5
+ class Door4(Door):
6
+ @property
7
+ def blockshape(self) -> str:
8
+ return "door4"
9
+
10
+ def texture_index(self, block: Block, aux_value: int) -> int:
11
+ return 4
12
+
13
+
14
+ BlockShape = Door4()
@@ -0,0 +1,14 @@
1
+ from amulet.block import Block
2
+ from amulet.resource_pack.bedrock.blockshapes.door import Door
3
+
4
+
5
+ class Door5(Door):
6
+ @property
7
+ def blockshape(self) -> str:
8
+ return "door5"
9
+
10
+ def texture_index(self, block: Block, aux_value: int) -> int:
11
+ return 5
12
+
13
+
14
+ BlockShape = Door5()
@@ -0,0 +1,14 @@
1
+ from amulet.block import Block
2
+ from amulet.resource_pack.bedrock.blockshapes.door import Door
3
+
4
+
5
+ class Door6(Door):
6
+ @property
7
+ def blockshape(self) -> str:
8
+ return "door6"
9
+
10
+ def texture_index(self, block: Block, aux_value: int) -> int:
11
+ return 6
12
+
13
+
14
+ BlockShape = Door6()
@@ -0,0 +1,40 @@
1
+ from amulet.block import Block
2
+ from amulet.resource_pack.bedrock.blockshapes.cross_texture import (
3
+ Cross,
4
+ )
5
+ from amulet.mesh.block import BlockMesh
6
+ import amulet_nbt
7
+
8
+
9
+ class DoublePlant(Cross):
10
+ def is_valid(self, block: Block) -> bool:
11
+ return isinstance(block.properties.get("upper_block_bit"), amulet_nbt.TAG_Byte)
12
+
13
+ @property
14
+ def blockshape(self) -> str:
15
+ return "double_plant"
16
+
17
+ def texture_index(self, block: Block, aux_value: int) -> int:
18
+ return aux_value % 8
19
+
20
+ def get_block_model(
21
+ self,
22
+ block: Block,
23
+ down: str,
24
+ up: str,
25
+ north: str,
26
+ east: str,
27
+ south: str,
28
+ west: str,
29
+ transparency: tuple[bool, bool, bool, bool, bool, bool],
30
+ ) -> BlockMesh:
31
+ if block.properties["upper_block_bit"].py_data:
32
+ return super().get_block_model(block, up, up, up, up, up, up, transparency)
33
+ else:
34
+ return super().get_block_model(
35
+ block, down, down, down, down, down, down, transparency
36
+ )
37
+ # TODO: add the sunflower face and tint the required blocks
38
+
39
+
40
+ BlockShape = DoublePlant()
@@ -0,0 +1,22 @@
1
+ from amulet.block import Block
2
+ from amulet.resource_pack.bedrock.blockshapes.partial_block import (
3
+ PartialBlock,
4
+ )
5
+
6
+
7
+ class EnchantingTable(PartialBlock):
8
+ @property
9
+ def blockshape(self) -> str:
10
+ return "enchanting_table"
11
+
12
+ def bounds(
13
+ self, block: Block
14
+ ) -> tuple[tuple[float, float], tuple[float, float], tuple[float, float]]:
15
+ return (0, 1), (0, 12 / 16), (0, 1)
16
+
17
+ @property
18
+ def do_not_cull(self) -> tuple[bool, bool, bool, bool, bool, bool]:
19
+ return False, True, False, False, False, False
20
+
21
+
22
+ BlockShape = EnchantingTable()