amulet-core 2.0a5__cp311-cp311-win_amd64.whl → 2.0a7__cp311-cp311-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__.cp311-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,22 @@
1
+ from amulet.block import Block
2
+ from amulet.resource_pack.bedrock.blockshapes.partial_block import (
3
+ PartialBlock,
4
+ )
5
+
6
+
7
+ class FarmLand(PartialBlock):
8
+ @property
9
+ def blockshape(self) -> str:
10
+ return "farmland"
11
+
12
+ def bounds(
13
+ self, block: Block
14
+ ) -> tuple[tuple[float, float], tuple[float, float], tuple[float, float]]:
15
+ return (0, 1), (0, 15 / 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 = FarmLand()
@@ -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 Fence(PartialBlock):
8
+ @property
9
+ def blockshape(self) -> str:
10
+ return "fence"
11
+
12
+ def bounds(
13
+ self, block: Block
14
+ ) -> tuple[tuple[float, float], tuple[float, float], tuple[float, float]]:
15
+ return (6 / 16, 1 - 6 / 16), (0, 1), (6 / 16, 1 - 6 / 16)
16
+
17
+ @property
18
+ def do_not_cull(self) -> tuple[bool, bool, bool, bool, bool, bool]:
19
+ return False, False, True, True, True, True
20
+
21
+
22
+ BlockShape = Fence()
@@ -0,0 +1,55 @@
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.default import Default
6
+
7
+
8
+ class Flat(Default):
9
+ @property
10
+ def tint(self) -> tuple[float, float, float]:
11
+ return 1, 1, 1
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 BlockMesh(
25
+ 3,
26
+ {
27
+ None: numpy.array(
28
+ [
29
+ 0.0,
30
+ 0.0625,
31
+ 1.0,
32
+ 1.0,
33
+ 0.0625,
34
+ 1.0,
35
+ 1.0,
36
+ 0.0625,
37
+ 0.0,
38
+ 0.0,
39
+ 0.0625,
40
+ 0.0,
41
+ ],
42
+ dtype=numpy.float32,
43
+ )
44
+ },
45
+ {
46
+ None: numpy.array(
47
+ [0.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0], numpy.float32
48
+ )
49
+ },
50
+ {None: numpy.array(self.tint * 4, numpy.float32)},
51
+ {None: numpy.array([0, 1, 2, 0, 2, 3], numpy.uint32)},
52
+ {None: numpy.array([0, 0], numpy.uint32)},
53
+ (up,),
54
+ Transparency.Partial,
55
+ )
@@ -0,0 +1,55 @@
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.default import Default
6
+
7
+
8
+ class FlatWall(Default):
9
+ @property
10
+ def tint(self) -> tuple[float, float, float]:
11
+ return 1, 1, 1
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 BlockMesh(
25
+ 3,
26
+ {
27
+ None: numpy.array(
28
+ [
29
+ 0.0,
30
+ 0.0,
31
+ 1 / 16,
32
+ 1.0,
33
+ 0.0,
34
+ 1 / 16,
35
+ 1.0,
36
+ 1.0,
37
+ 1 / 16,
38
+ 0.0,
39
+ 1.0,
40
+ 1 / 16,
41
+ ],
42
+ dtype=numpy.float32,
43
+ )
44
+ },
45
+ {
46
+ None: numpy.array(
47
+ [0.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0], numpy.float32
48
+ )
49
+ },
50
+ {None: numpy.array(self.tint * 4, numpy.float32)},
51
+ {None: numpy.array([0, 1, 2, 0, 2, 3], numpy.uint32)},
52
+ {None: numpy.array([0, 0], numpy.uint32)},
53
+ (up,),
54
+ Transparency.Partial,
55
+ )
@@ -0,0 +1,44 @@
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 Furnace(Cube):
8
+ def is_valid(self, block: Block) -> bool:
9
+ return isinstance(block.properties.get("facing_direction"), amulet_nbt.TAG_Int)
10
+
11
+ @property
12
+ def blockshape(self) -> str:
13
+ return "furnace"
14
+
15
+ def texture_index(self, block: Block, aux_value: int) -> int:
16
+ return 0
17
+
18
+ @property
19
+ def rotation_map(self) -> dict[int, int]:
20
+ return {2: 2, 3: 0, 4: 1, 5: 3}
21
+
22
+ def get_block_model(
23
+ self,
24
+ block: Block,
25
+ down: str,
26
+ up: str,
27
+ north: str,
28
+ east: str,
29
+ south: str,
30
+ west: str,
31
+ transparency: tuple[bool, bool, bool, bool, bool, bool],
32
+ ) -> BlockMesh:
33
+ rotation = self.rotation_map.get(
34
+ block.properties["facing_direction"].py_data, 0
35
+ )
36
+
37
+ return (
38
+ super()
39
+ .get_block_model(block, down, up, north, east, south, west, transparency)
40
+ .rotate(0, rotation)
41
+ )
42
+
43
+
44
+ BlockShape = Furnace()
@@ -0,0 +1,14 @@
1
+ from amulet.resource_pack.bedrock.blockshapes.furnace import Furnace
2
+
3
+
4
+ class FurnaceLit(Furnace):
5
+ @property
6
+ def blockshape(self) -> str:
7
+ return "furnace_lit"
8
+
9
+ @property
10
+ def rotation_map(self) -> dict[int, int]:
11
+ return {2: 3, 3: 1, 4: 2, 5: 0}
12
+
13
+
14
+ BlockShape = FurnaceLit()
@@ -0,0 +1,39 @@
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.cube import Cube
5
+
6
+
7
+ class GreenCube(Cube):
8
+ @property
9
+ def blockshape(self) -> str:
10
+ return "greencube"
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
+ (0, 1, 0),
36
+ )
37
+
38
+
39
+ BlockShape = GreenCube()
@@ -0,0 +1,36 @@
1
+ from amulet.block import Block
2
+ from amulet.resource_pack.bedrock.blockshapes.flat_wall import (
3
+ FlatWall,
4
+ )
5
+ from amulet.mesh.block import BlockMesh
6
+
7
+
8
+ class Ladder(FlatWall):
9
+ @property
10
+ def blockshape(self) -> str:
11
+ return "ladder"
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
+ modify_uv: bool = True,
24
+ ) -> BlockMesh:
25
+ rotation = {2: 2, 3: 0, 4: 1, 5: 3}.get(
26
+ block.properties["facing_direction"].py_data, 0
27
+ )
28
+
29
+ return (
30
+ super()
31
+ .get_block_model(block, down, up, north, east, south, west, transparency)
32
+ .rotate(0, rotation)
33
+ )
34
+
35
+
36
+ BlockShape = Ladder()
@@ -0,0 +1,14 @@
1
+ from amulet.resource_pack.bedrock.blockshapes.flat import Flat
2
+
3
+
4
+ class LilyPad(Flat):
5
+ @property
6
+ def blockshape(self) -> str:
7
+ return "lilypad"
8
+
9
+ @property
10
+ def tint(self) -> tuple[float, float, float]:
11
+ return 0, 1, 0
12
+
13
+
14
+ BlockShape = LilyPad()
@@ -0,0 +1,57 @@
1
+ from typing import Optional
2
+
3
+ from amulet.block import Block
4
+ from amulet.mesh.block.block_mesh import BlockMesh, Transparency
5
+ from amulet.mesh.block.cube import get_cube
6
+ from amulet.resource_pack.bedrock.blockshapes.default import Default
7
+
8
+ BoundsType = tuple[tuple[float, float], tuple[float, float], tuple[float, float]]
9
+ DoNotCullType = tuple[bool, bool, bool, bool, bool, bool]
10
+
11
+
12
+ class PartialBlock(Default):
13
+ def bounds(self, block: Block) -> BoundsType:
14
+ return (0, 1), (0, 1), (0, 1)
15
+
16
+ @property
17
+ def do_not_cull(self) -> DoNotCullType:
18
+ return False, False, False, False, False, False
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
+ modify_uv: bool = True,
31
+ bounds: Optional[BoundsType] = None,
32
+ do_not_cull: Optional[DoNotCullType] = None,
33
+ ) -> BlockMesh:
34
+ bounds = bounds or self.bounds(block)
35
+ if modify_uv:
36
+ uv = (
37
+ (bounds[0][0], bounds[2][0], bounds[0][1], bounds[2][1]),
38
+ (bounds[0][0], bounds[2][0], bounds[0][1], bounds[2][1]),
39
+ (bounds[0][0], 1 - bounds[1][1], bounds[0][1], 1 - bounds[1][0]),
40
+ (bounds[2][0], 1 - bounds[1][1], bounds[2][1], 1 - bounds[1][0]),
41
+ (bounds[0][0], 1 - bounds[1][1], bounds[0][1], 1 - bounds[1][0]),
42
+ (bounds[2][0], 1 - bounds[1][1], bounds[2][1], 1 - bounds[1][0]),
43
+ )
44
+ else:
45
+ uv = ((0, 0, 1, 1),) * 6
46
+ return get_cube(
47
+ down,
48
+ up,
49
+ north,
50
+ east,
51
+ south,
52
+ west,
53
+ Transparency.Partial,
54
+ bounds=bounds,
55
+ texture_uv=uv,
56
+ do_not_cull=do_not_cull or self.do_not_cull,
57
+ )
@@ -0,0 +1,44 @@
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 Piston(Cube):
8
+ def is_valid(self, block: Block) -> bool:
9
+ return isinstance(block.properties.get("facing_direction"), amulet_nbt.TAG_Int)
10
+
11
+ @property
12
+ def blockshape(self) -> str:
13
+ return "piston"
14
+
15
+ def texture_index(self, block: Block, aux_value: int) -> int:
16
+ return 0
17
+
18
+ @property
19
+ def rotation_map(self) -> dict[int, tuple[int, int]]:
20
+ return {0: (2, 0), 1: (0, 0), 2: (1, 2), 3: (1, 0), 4: (1, 1), 5: (1, 3)}
21
+
22
+ def get_block_model(
23
+ self,
24
+ block: Block,
25
+ down: str,
26
+ up: str,
27
+ north: str,
28
+ east: str,
29
+ south: str,
30
+ west: str,
31
+ transparency: tuple[bool, bool, bool, bool, bool, bool],
32
+ ) -> BlockMesh:
33
+ rotation = self.rotation_map.get(
34
+ block.properties["facing_direction"].py_data, (0, 0)
35
+ )
36
+
37
+ return (
38
+ super()
39
+ .get_block_model(block, down, up, north, east, south, west, transparency)
40
+ .rotate(*rotation)
41
+ )
42
+
43
+
44
+ BlockShape = Piston()
@@ -0,0 +1,72 @@
1
+ from typing import Any
2
+ from amulet.block import Block
3
+ from amulet.mesh.block import BlockMesh
4
+ from amulet.resource_pack.bedrock.blockshapes.partial_block import (
5
+ PartialBlock,
6
+ )
7
+ import amulet_nbt
8
+
9
+
10
+ class PistonArm(PartialBlock):
11
+ def is_valid(self, block: Block) -> bool:
12
+ return isinstance(block.properties.get("facing_direction"), amulet_nbt.TAG_Int)
13
+
14
+ @property
15
+ def blockshape(self) -> str:
16
+ return "piston_arm"
17
+
18
+ def texture_index(self, block: Block, aux_value: int) -> int:
19
+ return 0
20
+
21
+ @property
22
+ def rotation_map(self) -> dict[int, tuple[int, int]]:
23
+ return {0: (2, 0), 1: (0, 0), 2: (1, 2), 3: (1, 0), 4: (1, 1), 5: (1, 3)}
24
+
25
+ def get_block_model(
26
+ self,
27
+ block: Block,
28
+ down: str,
29
+ up: str,
30
+ north: str,
31
+ east: str,
32
+ south: str,
33
+ west: str,
34
+ transparency: tuple[bool, bool, bool, bool, bool, bool],
35
+ *args: Any,
36
+ **kwargs: Any
37
+ ) -> BlockMesh:
38
+ rotation = self.rotation_map.get(
39
+ block.properties["facing_direction"].py_data, (0, 0)
40
+ )
41
+
42
+ return BlockMesh.merge(
43
+ [
44
+ super().get_block_model(
45
+ block,
46
+ down,
47
+ up,
48
+ north,
49
+ north,
50
+ north,
51
+ north,
52
+ transparency,
53
+ bounds=((0, 1), (12 / 16, 1), (0, 1)),
54
+ do_not_cull=(True, False, True, True, True, True),
55
+ ),
56
+ super().get_block_model(
57
+ block,
58
+ west,
59
+ west,
60
+ west,
61
+ west,
62
+ west,
63
+ west,
64
+ (transparency[5],) * 6,
65
+ bounds=((6 / 16, 10 / 16), (0, 12 / 16), (6 / 16, 10 / 16)),
66
+ do_not_cull=(False, False, True, True, True, True),
67
+ ),
68
+ ]
69
+ ).rotate(*rotation)
70
+
71
+
72
+ BlockShape = PistonArm()
@@ -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 PortalFrame(PartialBlock):
8
+ @property
9
+ def blockshape(self) -> str:
10
+ return "portal_frame"
11
+
12
+ def bounds(
13
+ self, block: Block
14
+ ) -> tuple[tuple[float, float], tuple[float, float], tuple[float, float]]:
15
+ return (0, 1), (0, 13 / 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 = PortalFrame()
@@ -0,0 +1,29 @@
1
+ from amulet.block import Block
2
+ from amulet.resource_pack.bedrock.blockshapes.partial_block import (
3
+ PartialBlock,
4
+ )
5
+ import amulet_nbt
6
+
7
+
8
+ class PressurePlate(PartialBlock):
9
+ def is_valid(self, block: Block) -> bool:
10
+ return isinstance(block.properties.get("redstone_signal"), amulet_nbt.TAG_Int)
11
+
12
+ @property
13
+ def blockshape(self) -> str:
14
+ return "pressure_plate"
15
+
16
+ def bounds(
17
+ self, block: Block
18
+ ) -> tuple[tuple[float, float], tuple[float, float], tuple[float, float]]:
19
+ if block.properties["redstone_signal"].py_data >= 1:
20
+ return (1 / 16, 15 / 16), (0, 1 / 32), (1 / 16, 15 / 16)
21
+ else:
22
+ return (1 / 16, 15 / 16), (0, 1 / 16), (1 / 16, 15 / 16)
23
+
24
+ @property
25
+ def do_not_cull(self) -> tuple[bool, bool, bool, bool, bool, bool]:
26
+ return False, True, True, True, True, True
27
+
28
+
29
+ BlockShape = PressurePlate()
@@ -0,0 +1,36 @@
1
+ from amulet.block import Block
2
+ from amulet.resource_pack.bedrock.blockshapes.cube import Cube
3
+ from amulet.mesh.block import BlockMesh
4
+ import amulet_nbt
5
+
6
+
7
+ class Pumpkin(Cube):
8
+ def is_valid(self, block: Block) -> bool:
9
+ return isinstance(block.properties.get("direction"), amulet_nbt.TAG_Int)
10
+
11
+ @property
12
+ def blockshape(self) -> str:
13
+ return "pumpkin"
14
+
15
+ def texture_index(self, block: Block, aux_value: int) -> int:
16
+ return 2
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
+ return (
30
+ super()
31
+ .get_block_model(block, down, up, north, east, south, west, transparency)
32
+ .rotate(0, block.properties["direction"].py_data)
33
+ )
34
+
35
+
36
+ BlockShape = Pumpkin()
@@ -0,0 +1,14 @@
1
+ from amulet.block import Block
2
+ from amulet.resource_pack.bedrock.blockshapes.pumpkin import Pumpkin
3
+
4
+
5
+ class PumpkinCarved(Pumpkin):
6
+ @property
7
+ def blockshape(self) -> str:
8
+ return "pumpkin_carved"
9
+
10
+ def texture_index(self, block: Block, aux_value: int) -> int:
11
+ return 0
12
+
13
+
14
+ BlockShape = PumpkinCarved()
@@ -0,0 +1,14 @@
1
+ from amulet.block import Block
2
+ from amulet.resource_pack.bedrock.blockshapes.pumpkin import Pumpkin
3
+
4
+
5
+ class PumpkinLit(Pumpkin):
6
+ @property
7
+ def blockshape(self) -> str:
8
+ return "pumpkin_lit"
9
+
10
+ def texture_index(self, block: Block, aux_value: int) -> int:
11
+ return 1
12
+
13
+
14
+ BlockShape = PumpkinLit()
@@ -0,0 +1,14 @@
1
+ from amulet.resource_pack.bedrock.blockshapes.flat import Flat
2
+
3
+
4
+ class RedDust(Flat):
5
+ @property
6
+ def blockshape(self) -> str:
7
+ return "red_dust"
8
+
9
+ @property
10
+ def tint(self) -> tuple[float, float, float]:
11
+ return 1, 0, 0
12
+
13
+
14
+ BlockShape = RedDust()
@@ -0,0 +1,53 @@
1
+ from typing import Any
2
+ from amulet.block import Block
3
+ from amulet.resource_pack.bedrock.blockshapes.partial_block import (
4
+ PartialBlock,
5
+ )
6
+ from amulet.mesh.block import BlockMesh
7
+ import amulet_nbt
8
+
9
+
10
+ class Repeater(PartialBlock):
11
+ def is_valid(self, block: Block) -> bool:
12
+ return isinstance(block.properties.get("direction"), amulet_nbt.TAG_Int)
13
+
14
+ @property
15
+ def blockshape(self) -> str:
16
+ return "repeater"
17
+
18
+ def texture_index(self, block: Block, aux_value: int) -> int:
19
+ if block.base_name == "powered_repeater":
20
+ return 1
21
+ else:
22
+ return 0
23
+
24
+ def bounds(
25
+ self, block: Block
26
+ ) -> tuple[tuple[float, float], tuple[float, float], tuple[float, float]]:
27
+ return (0, 1), (0, 2 / 16), (0, 1)
28
+
29
+ @property
30
+ def do_not_cull(self) -> tuple[bool, bool, bool, bool, bool, bool]:
31
+ return False, True, False, False, False, False
32
+
33
+ def get_block_model(
34
+ self,
35
+ block: Block,
36
+ down: str,
37
+ up: str,
38
+ north: str,
39
+ east: str,
40
+ south: str,
41
+ west: str,
42
+ transparency: tuple[bool, bool, bool, bool, bool, bool],
43
+ *args: Any,
44
+ **kwargs: Any
45
+ ) -> BlockMesh:
46
+ return (
47
+ super()
48
+ .get_block_model(block, down, up, north, east, south, west, transparency)
49
+ .rotate(0, block.properties["direction"].py_data)
50
+ )
51
+
52
+
53
+ BlockShape = Repeater()