amulet-core 2.0a7__cp312-cp312-win_amd64.whl → 2.0.1a2.post250529084747__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 (325) 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.0a7.dist-info → amulet_core-2.0.1a2.post250529084747.dist-info}/METADATA +25 -20
  40. amulet_core-2.0.1a2.post250529084747.dist-info/RECORD +45 -0
  41. {amulet_core-2.0a7.dist-info → amulet_core-2.0.1a2.post250529084747.dist-info}/WHEEL +1 -1
  42. amulet_core-2.0.1a2.post250529084747.dist-info/entry_points.txt +2 -0
  43. amulet/__init__.cp312-win_amd64.pyd +0 -0
  44. amulet/__init__.py.cpp +0 -43
  45. amulet/__init__.pyi +0 -28
  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 -99
  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 -335
  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__.py +0 -1
  195. amulet/mesh/block/block_mesh.py +0 -369
  196. amulet/mesh/block/cube.py +0 -149
  197. amulet/mesh/block/missing_block.py +0 -20
  198. amulet/mesh/util.py +0 -17
  199. amulet/palette/biome_palette.hpp +0 -85
  200. amulet/palette/block_palette.cpp +0 -32
  201. amulet/palette/block_palette.hpp +0 -93
  202. amulet/player.py +0 -62
  203. amulet/pybind11/collections.hpp +0 -118
  204. amulet/pybind11/numpy.hpp +0 -26
  205. amulet/pybind11/py_module.hpp +0 -34
  206. amulet/pybind11/type_hints.hpp +0 -51
  207. amulet/pybind11/types.hpp +0 -25
  208. amulet/pybind11/typing.hpp +0 -7
  209. amulet/resource_pack/__init__.py +0 -62
  210. amulet/resource_pack/abc/__init__.py +0 -2
  211. amulet/resource_pack/abc/resource_pack.py +0 -38
  212. amulet/resource_pack/abc/resource_pack_manager.py +0 -87
  213. amulet/resource_pack/bedrock/__init__.py +0 -2
  214. amulet/resource_pack/bedrock/bedrock_vanilla_fix/pack_icon.png +0 -0
  215. amulet/resource_pack/bedrock/bedrock_vanilla_fix/textures/blocks/grass_carried.png +0 -0
  216. amulet/resource_pack/bedrock/bedrock_vanilla_fix/textures/blocks/grass_side_carried.png +0 -0
  217. amulet/resource_pack/bedrock/bedrock_vanilla_fix/textures/blocks/water.png +0 -0
  218. amulet/resource_pack/bedrock/blockshapes/__init__.py +0 -31
  219. amulet/resource_pack/bedrock/blockshapes/air.py +0 -35
  220. amulet/resource_pack/bedrock/blockshapes/base_blockshape.py +0 -29
  221. amulet/resource_pack/bedrock/blockshapes/bubble_column.py +0 -29
  222. amulet/resource_pack/bedrock/blockshapes/cake.py +0 -46
  223. amulet/resource_pack/bedrock/blockshapes/chest.py +0 -54
  224. amulet/resource_pack/bedrock/blockshapes/comparator.py +0 -51
  225. amulet/resource_pack/bedrock/blockshapes/cross_texture.py +0 -186
  226. amulet/resource_pack/bedrock/blockshapes/cross_texture0.py +0 -17
  227. amulet/resource_pack/bedrock/blockshapes/cross_texture_green.py +0 -16
  228. amulet/resource_pack/bedrock/blockshapes/cube.py +0 -38
  229. amulet/resource_pack/bedrock/blockshapes/default.py +0 -14
  230. amulet/resource_pack/bedrock/blockshapes/door.py +0 -38
  231. amulet/resource_pack/bedrock/blockshapes/door1.py +0 -14
  232. amulet/resource_pack/bedrock/blockshapes/door2.py +0 -14
  233. amulet/resource_pack/bedrock/blockshapes/door3.py +0 -14
  234. amulet/resource_pack/bedrock/blockshapes/door4.py +0 -14
  235. amulet/resource_pack/bedrock/blockshapes/door5.py +0 -14
  236. amulet/resource_pack/bedrock/blockshapes/door6.py +0 -14
  237. amulet/resource_pack/bedrock/blockshapes/double_plant.py +0 -40
  238. amulet/resource_pack/bedrock/blockshapes/enchanting_table.py +0 -22
  239. amulet/resource_pack/bedrock/blockshapes/farmland.py +0 -22
  240. amulet/resource_pack/bedrock/blockshapes/fence.py +0 -22
  241. amulet/resource_pack/bedrock/blockshapes/flat.py +0 -55
  242. amulet/resource_pack/bedrock/blockshapes/flat_wall.py +0 -55
  243. amulet/resource_pack/bedrock/blockshapes/furnace.py +0 -44
  244. amulet/resource_pack/bedrock/blockshapes/furnace_lit.py +0 -14
  245. amulet/resource_pack/bedrock/blockshapes/green_cube.py +0 -39
  246. amulet/resource_pack/bedrock/blockshapes/ladder.py +0 -36
  247. amulet/resource_pack/bedrock/blockshapes/lilypad.py +0 -14
  248. amulet/resource_pack/bedrock/blockshapes/partial_block.py +0 -57
  249. amulet/resource_pack/bedrock/blockshapes/piston.py +0 -44
  250. amulet/resource_pack/bedrock/blockshapes/piston_arm.py +0 -72
  251. amulet/resource_pack/bedrock/blockshapes/portal_frame.py +0 -22
  252. amulet/resource_pack/bedrock/blockshapes/pressure_plate.py +0 -29
  253. amulet/resource_pack/bedrock/blockshapes/pumpkin.py +0 -36
  254. amulet/resource_pack/bedrock/blockshapes/pumpkin_carved.py +0 -14
  255. amulet/resource_pack/bedrock/blockshapes/pumpkin_lit.py +0 -14
  256. amulet/resource_pack/bedrock/blockshapes/red_dust.py +0 -14
  257. amulet/resource_pack/bedrock/blockshapes/repeater.py +0 -53
  258. amulet/resource_pack/bedrock/blockshapes/slab.py +0 -33
  259. amulet/resource_pack/bedrock/blockshapes/slab_double.py +0 -15
  260. amulet/resource_pack/bedrock/blockshapes/tree.py +0 -41
  261. amulet/resource_pack/bedrock/blockshapes/turtle_egg.py +0 -15
  262. amulet/resource_pack/bedrock/blockshapes/vine.py +0 -52
  263. amulet/resource_pack/bedrock/blockshapes/wall.py +0 -22
  264. amulet/resource_pack/bedrock/blockshapes/water.py +0 -38
  265. amulet/resource_pack/bedrock/download_resources.py +0 -147
  266. amulet/resource_pack/bedrock/resource_pack.py +0 -40
  267. amulet/resource_pack/bedrock/resource_pack_manager.py +0 -361
  268. amulet/resource_pack/bedrock/sort_blockshapes.py +0 -15
  269. amulet/resource_pack/java/__init__.py +0 -2
  270. amulet/resource_pack/java/download_resources.py +0 -212
  271. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_black.png +0 -0
  272. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_blue.png +0 -0
  273. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_brown.png +0 -0
  274. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_cyan.png +0 -0
  275. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_gray.png +0 -0
  276. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_green.png +0 -0
  277. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_light_blue.png +0 -0
  278. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_light_gray.png +0 -0
  279. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_lime.png +0 -0
  280. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_magenta.png +0 -0
  281. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_orange.png +0 -0
  282. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_pink.png +0 -0
  283. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_purple.png +0 -0
  284. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_red.png +0 -0
  285. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_white.png +0 -0
  286. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_yellow.png +0 -0
  287. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/barrier.png +0 -0
  288. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/end_portal.png +0 -0
  289. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/grass.png +0 -0
  290. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/lava.png +0 -0
  291. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/structure_void.png +0 -0
  292. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/water.png +0 -0
  293. amulet/resource_pack/java/java_vanilla_fix/pack.png +0 -0
  294. amulet/resource_pack/java/resource_pack.py +0 -44
  295. amulet/resource_pack/java/resource_pack_manager.py +0 -551
  296. amulet/resource_pack/unknown_resource_pack.py +0 -10
  297. amulet/selection/__init__.py +0 -2
  298. amulet/selection/abstract_selection.py +0 -342
  299. amulet/selection/box.py +0 -852
  300. amulet/selection/group.py +0 -481
  301. amulet/utils/__init__.pyi +0 -23
  302. amulet/utils/call_spec/__init__.py +0 -24
  303. amulet/utils/call_spec/_call_spec.py +0 -257
  304. amulet/utils/comment_json.py +0 -188
  305. amulet/utils/format_utils.py +0 -41
  306. amulet/utils/generator.py +0 -18
  307. amulet/utils/matrix.py +0 -243
  308. amulet/utils/numpy.hpp +0 -36
  309. amulet/utils/numpy.pyi +0 -11
  310. amulet/utils/numpy_helpers.py +0 -19
  311. amulet/utils/shareable_lock.py +0 -335
  312. amulet/utils/signal/__init__.py +0 -10
  313. amulet/utils/signal/_signal.py +0 -228
  314. amulet/utils/task_manager.py +0 -235
  315. amulet/utils/typed_property.py +0 -111
  316. amulet/utils/weakref.py +0 -70
  317. amulet/utils/world_utils.py +0 -102
  318. amulet/version.cpp +0 -136
  319. amulet/version.hpp +0 -142
  320. amulet/version.py.cpp +0 -281
  321. amulet_core-2.0a7.dist-info/RECORD +0 -295
  322. amulet_core-2.0a7.dist-info/entry_points.txt +0 -2
  323. /amulet/{__pyinstaller → core/__pyinstaller}/__init__.py +0 -0
  324. /amulet/{py.typed → core/py.typed} +0 -0
  325. {amulet_core-2.0a7.dist-info → amulet_core-2.0.1a2.post250529084747.dist-info}/top_level.txt +0 -0
@@ -1,87 +0,0 @@
1
- from typing import Optional, Iterator, TypeVar, Generic
2
- import json
3
- import copy
4
-
5
- from amulet.block import Block, BlockStack
6
- from amulet.mesh.block import BlockMesh
7
- from amulet.resource_pack.abc.resource_pack import BaseResourcePack
8
- from amulet.img import missing_no_icon_path
9
- from amulet.mesh.block.missing_block import get_missing_block
10
-
11
- PackT = TypeVar("PackT", bound=BaseResourcePack)
12
-
13
-
14
- class BaseResourcePackManager(Generic[PackT]):
15
- """The base class that all resource pack managers must inherit from. Defines the base api."""
16
-
17
- def __init__(self) -> None:
18
- self._packs: list[PackT] = []
19
- self._missing_block: Optional[BlockMesh] = None
20
- self._texture_is_transparent: dict[str, tuple[float, bool]] = {}
21
- self._cached_models: dict[BlockStack, BlockMesh] = {}
22
-
23
- @property
24
- def pack_paths(self) -> list[str]:
25
- return [pack.root_dir for pack in self._packs]
26
-
27
- def _unload(self) -> None:
28
- """Clear all loaded resources."""
29
- self._texture_is_transparent.clear()
30
- self._cached_models.clear()
31
-
32
- def _load_transparency_cache(self, path: str) -> None:
33
- try:
34
- with open(path) as f:
35
- self._texture_is_transparent = json.load(f)
36
- except:
37
- pass
38
-
39
- def _load_iter(self) -> Iterator[float]:
40
- """Load resources."""
41
- raise NotImplementedError
42
-
43
- def reload(self) -> Iterator[float]:
44
- """Unload and reload resources"""
45
- self._unload()
46
- yield from self._load_iter()
47
-
48
- @property
49
- def missing_no(self) -> str:
50
- """The path to the missing_no image"""
51
- return missing_no_icon_path
52
-
53
- @property
54
- def missing_block(self) -> BlockMesh:
55
- if self._missing_block is None:
56
- self._missing_block = get_missing_block(self)
57
- return self._missing_block
58
-
59
- @property
60
- def textures(self) -> tuple[str, ...]:
61
- """Returns a tuple of all the texture paths in the resource pack."""
62
- raise NotImplementedError
63
-
64
- def get_texture_path(self, namespace: Optional[str], relative_path: str) -> str:
65
- """Get the absolute texture path from the namespace and relative path pair"""
66
- raise NotImplementedError
67
-
68
- def get_block_model(self, block_stack: BlockStack) -> BlockMesh:
69
- """Get a model for a block state.
70
- The block should already be in the resource pack format"""
71
- if block_stack not in self._cached_models:
72
- if len(block_stack) == 1:
73
- self._cached_models[block_stack] = self._get_model(
74
- block_stack.base_block
75
- )
76
- else:
77
- self._cached_models[block_stack] = BlockMesh.merge(
78
- (self._get_model(block_stack.base_block),)
79
- + tuple(
80
- self._get_model(block_) for block_ in block_stack.extra_blocks
81
- )
82
- )
83
-
84
- return copy.deepcopy(self._cached_models[block_stack])
85
-
86
- def _get_model(self, block: Block) -> BlockMesh:
87
- raise NotImplementedError
@@ -1,2 +0,0 @@
1
- from .resource_pack import BedrockResourcePack
2
- from .resource_pack_manager import BedrockResourcePackManager
@@ -1,31 +0,0 @@
1
- import importlib
2
- import pkgutil
3
-
4
- from .base_blockshape import BaseBlockShape
5
-
6
- BlockShapeClasses: dict[str, BaseBlockShape] = {}
7
- _class_names = set()
8
-
9
-
10
- def _load_blockshape(module_name: str) -> None:
11
- blockshape_module = importlib.import_module(module_name)
12
- if hasattr(blockshape_module, "BlockShape"):
13
- blockshape = getattr(blockshape_module, "BlockShape")
14
- if isinstance(blockshape, BaseBlockShape):
15
- if blockshape.blockshape in BlockShapeClasses:
16
- print(f"Name conflict with blockshape {blockshape.blockshape}")
17
- if blockshape.__class__.__name__ in _class_names:
18
- print(f"Duplicate class name {blockshape.__class__.__name__}")
19
- else:
20
- _class_names.add(blockshape.__class__.__name__)
21
- BlockShapeClasses[blockshape.blockshape] = blockshape
22
-
23
-
24
- def _load_blockshapes() -> None:
25
- package_prefix = __name__ + "."
26
-
27
- for _, name, _ in pkgutil.walk_packages(__path__, package_prefix):
28
- _load_blockshape(name)
29
-
30
-
31
- _load_blockshapes()
@@ -1,35 +0,0 @@
1
- from amulet.block import Block
2
- from amulet.mesh.block.block_mesh import BlockMesh, Transparency
3
- from amulet.resource_pack.bedrock.blockshapes.base_blockshape import (
4
- BaseBlockShape,
5
- )
6
-
7
-
8
- class Air(BaseBlockShape):
9
- @property
10
- def blockshape(self) -> str:
11
- return "air"
12
-
13
- def is_valid(self, block: Block) -> bool:
14
- """Does the given block have the correct properties to use this blockshape"""
15
- return True
16
-
17
- def texture_index(self, block: Block, aux_value: int) -> int:
18
- """The texture index to use within the list for the given Block"""
19
- return 0
20
-
21
- def get_block_model(
22
- self,
23
- block: Block,
24
- down: str,
25
- up: str,
26
- north: str,
27
- east: str,
28
- south: str,
29
- west: str,
30
- transparency: tuple[bool, bool, bool, bool, bool, bool],
31
- ) -> BlockMesh:
32
- return BlockMesh(3, {}, {}, {}, {}, {}, (), Transparency.Partial)
33
-
34
-
35
- BlockShape = Air()
@@ -1,29 +0,0 @@
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
@@ -1,29 +0,0 @@
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()
@@ -1,46 +0,0 @@
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()
@@ -1,54 +0,0 @@
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()
@@ -1,51 +0,0 @@
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()
@@ -1,186 +0,0 @@
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()
@@ -1,17 +0,0 @@
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()
@@ -1,16 +0,0 @@
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()
@@ -1,38 +0,0 @@
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()
@@ -1,14 +0,0 @@
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