sapdon 2.0.2 → 2.1.0

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.
Files changed (283) hide show
  1. package/LICENSE +1 -1
  2. package/doc/BlockAPI.md +145 -0
  3. package/doc/api.md +1 -1
  4. package/doc/hello_sapdon/a9aad643f5609da73404d1f7f35fd5d0.png +0 -0
  5. package/doc/hello_sapdon/sapdon/344/275/277/347/224/250/346/225/231/347/250/213.md +159 -0
  6. package/examples/guidebook/build.config +33 -0
  7. package/examples/guidebook/dev/guidebook_BP/items/sapdon_test_guidebook.json +19 -0
  8. package/examples/{masterball/dev/masterball_BP/masterball_BP_1_20_20 → guidebook/dev/guidebook_BP}/manifest.json +63 -59
  9. package/examples/guidebook/dev/guidebook_BP/scripts/custom_components/cropComponent.js +50 -0
  10. package/examples/guidebook/dev/guidebook_BP/scripts/custom_components/items/gui_book.js +37 -0
  11. package/examples/guidebook/dev/guidebook_BP/scripts/custom_components/registry.js +20 -0
  12. package/examples/guidebook/dev/guidebook_BP/scripts/index.js +3 -0
  13. package/examples/guidebook/dev/guidebook_RP/blocks.json +3 -0
  14. package/examples/guidebook/dev/guidebook_RP/manifest.json +44 -0
  15. package/examples/guidebook/dev/guidebook_RP/models/blocks/crop.geo.json +48 -0
  16. package/examples/{masterball/dev/masterball_RP/masterball_RP_1_20_20.zip → guidebook/dev/guidebook_RP/pack_icon.png} +0 -0
  17. package/examples/guidebook/dev/guidebook_RP/textures/blocks/test_log_oak.png +0 -0
  18. package/examples/guidebook/dev/guidebook_RP/textures/blocks/test_log_top.png +0 -0
  19. package/examples/guidebook/dev/guidebook_RP/textures/flipbook_textures.json +1 -0
  20. package/examples/guidebook/dev/guidebook_RP/textures/item_texture.json +9 -0
  21. package/examples/guidebook/dev/guidebook_RP/textures/items/masterball.png +0 -0
  22. package/examples/guidebook/dev/guidebook_RP/textures/terrain_texture.json +14 -0
  23. package/examples/guidebook/dev/guidebook_RP/ui/_ui_defs.json +6 -0
  24. package/examples/guidebook/dev/guidebook_RP/ui/guidebook.json +581 -0
  25. package/examples/guidebook/dev/guidebook_RP/ui/server_form.json +91 -0
  26. package/examples/guidebook/main.mjs +66 -0
  27. package/examples/guidebook/mod.info +7 -0
  28. package/examples/{masterball/dev/masterball_BP/masterball_BP_1_20_20.zip → guidebook/pack_icon.png} +0 -0
  29. package/examples/guidebook/res/models/blocks/crop.geo.json +48 -0
  30. package/examples/guidebook/res/textures/blocks/test_log_oak.png +0 -0
  31. package/examples/guidebook/res/textures/blocks/test_log_top.png +0 -0
  32. package/examples/guidebook/res/textures/items/masterball.png +0 -0
  33. package/examples/guidebook/scripts/custom_components/cropComponent.js +50 -0
  34. package/examples/guidebook/scripts/custom_components/items/gui_book.js +37 -0
  35. package/examples/guidebook/scripts/custom_components/registry.js +20 -0
  36. package/examples/guidebook/scripts/index.js +3 -0
  37. package/examples/hello_sapdon/build.config +29 -0
  38. package/examples/hello_sapdon/main.mjs +3 -0
  39. package/examples/hello_sapdon/mod.info +7 -0
  40. package/examples/hello_sapdon/pack_icon.png +0 -0
  41. package/examples/hello_sapdon/res/models/blocks/crop.geo.json +48 -0
  42. package/examples/hello_sapdon/res/textures/blocks/test_log_oak.png +0 -0
  43. package/examples/hello_sapdon/res/textures/blocks/test_log_top.png +0 -0
  44. package/examples/hello_sapdon/res/textures/items/masterball.png +0 -0
  45. package/examples/hello_sapdon/scripts/custom_components/cropComponent.js +50 -0
  46. package/examples/hello_sapdon/scripts/custom_components/items/gui_book.js +37 -0
  47. package/examples/hello_sapdon/scripts/custom_components/registry.js +25 -0
  48. package/examples/hello_sapdon/scripts/index.js +0 -0
  49. package/examples/masterball/build.config +1 -0
  50. package/examples/masterball/dev/masterball_1_20_30.mcaddon +0 -0
  51. package/examples/masterball/dev/masterball_BP/entities/sapdon_projectile_masterball.json +56 -55
  52. package/examples/masterball/dev/masterball_BP/manifest.json +59 -59
  53. package/examples/masterball/dev/masterball_BP/pack_icon.png +0 -0
  54. package/examples/masterball/dev/masterball_BP/recipes/masterball.json +25 -0
  55. package/examples/masterball/dev/masterball_BP_1_20_30.mcpack +0 -0
  56. package/examples/masterball/dev/masterball_RP/attachables/sapdon_caught_masterball.json +19 -0
  57. package/examples/masterball/dev/masterball_RP/manifest.json +43 -43
  58. package/examples/masterball/dev/masterball_RP/pack_icon.png +0 -0
  59. package/examples/masterball/dev/masterball_RP/textures/flipbook_textures.json +1 -0
  60. package/examples/masterball/dev/masterball_RP/ui/_ui_defs.json +3 -0
  61. package/examples/masterball/dev/masterball_RP_1_20_30.mcpack +0 -0
  62. package/examples/masterball/main.mjs +18 -1
  63. package/examples/masterball/pack_icon.png +0 -0
  64. package/examples/mob_chest/build.config +29 -0
  65. package/examples/mob_chest/dev/mob_chest_BP/blocks/mob_chest_chest.json +56 -0
  66. package/examples/mob_chest/dev/mob_chest_BP/entities/mob_chest_chest_entity.json +79 -0
  67. package/examples/mob_chest/dev/mob_chest_BP/manifest.json +64 -0
  68. package/examples/mob_chest/dev/mob_chest_BP/pack_icon.png +0 -0
  69. package/examples/mob_chest/dev/mob_chest_BP/scripts/custom_components/block/block_with_entity.js +46 -0
  70. package/examples/mob_chest/dev/mob_chest_BP/scripts/custom_components/block/cropComponent.js +50 -0
  71. package/examples/mob_chest/dev/mob_chest_BP/scripts/custom_components/items/gui_book.js +37 -0
  72. package/examples/mob_chest/dev/mob_chest_BP/scripts/custom_components/registry.js +25 -0
  73. package/examples/mob_chest/dev/mob_chest_BP/scripts/index.js +4 -0
  74. package/examples/mob_chest/dev/mob_chest_RP/animation_controllers/mob_chest.animation_controllers.json +30 -0
  75. package/examples/mob_chest/dev/mob_chest_RP/animations/animation_item.animation.json +34 -0
  76. package/examples/mob_chest/dev/mob_chest_RP/animations/large_item.animation.json +27 -0
  77. package/examples/mob_chest/dev/mob_chest_RP/animations/mob_chest.animation.json +64 -0
  78. package/examples/mob_chest/dev/mob_chest_RP/blocks.json +13 -0
  79. package/examples/mob_chest/dev/mob_chest_RP/entity/mob_chest_chest_entity.json +32 -0
  80. package/examples/mob_chest/dev/mob_chest_RP/manifest.json +44 -0
  81. package/examples/mob_chest/dev/mob_chest_RP/models/blocks/crop.geo.json +48 -0
  82. package/examples/mob_chest/dev/mob_chest_RP/models/blocks/cube.geo.json +35 -0
  83. package/examples/mob_chest/dev/mob_chest_RP/models/blocks/empty.geo.json +35 -0
  84. package/examples/mob_chest/dev/mob_chest_RP/models/entity/mob_chest.geo.json +98 -0
  85. package/examples/mob_chest/dev/mob_chest_RP/pack_icon.png +0 -0
  86. package/examples/mob_chest/dev/mob_chest_RP/textures/blocks/entity/double_normal.png +0 -0
  87. package/examples/mob_chest/dev/mob_chest_RP/textures/blocks/entity/none.png +0 -0
  88. package/examples/mob_chest/dev/mob_chest_RP/textures/blocks/entity/normal.png +0 -0
  89. package/examples/mob_chest/dev/mob_chest_RP/textures/blocks/test_log_oak.png +0 -0
  90. package/examples/mob_chest/dev/mob_chest_RP/textures/blocks/test_log_top.png +0 -0
  91. package/examples/mob_chest/dev/mob_chest_RP/textures/flipbook_textures.json +1 -0
  92. package/examples/mob_chest/dev/mob_chest_RP/textures/item_texture.json +9 -0
  93. package/examples/mob_chest/dev/mob_chest_RP/textures/items/masterball.png +0 -0
  94. package/examples/mob_chest/dev/mob_chest_RP/textures/terrain_texture.json +23 -0
  95. package/examples/mob_chest/dev/mob_chest_RP/ui/_ui_defs.json +3 -0
  96. package/examples/mob_chest/main.mjs +31 -0
  97. package/examples/mob_chest/mod.info +7 -0
  98. package/examples/mob_chest/pack_icon.png +0 -0
  99. package/examples/mob_chest/res/animation_controllers/mob_chest.animation_controllers.json +30 -0
  100. package/examples/mob_chest/res/animations/animation_item.animation.json +34 -0
  101. package/examples/mob_chest/res/animations/large_item.animation.json +27 -0
  102. package/examples/mob_chest/res/animations/mob_chest.animation.json +64 -0
  103. package/examples/mob_chest/res/models/blocks/crop.geo.json +48 -0
  104. package/examples/mob_chest/res/models/blocks/cube.geo.json +35 -0
  105. package/examples/mob_chest/res/models/blocks/empty.geo.json +35 -0
  106. package/examples/mob_chest/res/models/entity/mob_chest.geo.json +98 -0
  107. package/examples/mob_chest/res/textures/blocks/entity/double_normal.png +0 -0
  108. package/examples/mob_chest/res/textures/blocks/entity/none.png +0 -0
  109. package/examples/mob_chest/res/textures/blocks/entity/normal.png +0 -0
  110. package/examples/mob_chest/res/textures/blocks/test_log_oak.png +0 -0
  111. package/examples/mob_chest/res/textures/blocks/test_log_top.png +0 -0
  112. package/examples/mob_chest/res/textures/items/masterball.png +0 -0
  113. package/examples/mob_chest/resource/cube.bbmodel +1 -0
  114. package/examples/mob_chest/resource/flipbook_item.bbmodel +1 -0
  115. package/examples/mob_chest/resource/flipbook_item.geo.bbmodel +1 -0
  116. package/examples/mob_chest/resource/flipbook_item.geo.json +3124 -0
  117. package/examples/mob_chest/resource/mob_chest.bbmodel +1 -0
  118. package/examples/mob_chest/scripts/custom_components/block/block_with_entity.js +46 -0
  119. package/examples/mob_chest/scripts/custom_components/block/cropComponent.js +50 -0
  120. package/examples/mob_chest/scripts/custom_components/items/gui_book.js +37 -0
  121. package/examples/mob_chest/scripts/custom_components/registry.js +25 -0
  122. package/examples/mob_chest/scripts/index.js +4 -0
  123. package/examples/test/build.config +29 -0
  124. package/examples/test/dev/test_BP/blocks/sapdon_ore_cinnabar.json +15 -15
  125. package/examples/test/dev/test_BP/blocks/sapdon_test_block.json +15 -15
  126. package/examples/test/dev/test_BP/blocks/sapdon_test_crop.json +191 -191
  127. package/examples/test/dev/test_BP/blocks/sapdon_wire.json +102 -102
  128. package/examples/test/dev/test_BP/entities/sapdon_test_projectile.json +56 -55
  129. package/examples/test/dev/test_BP/feature_rules/ore_cinnabar_orefeatre_rule.json +52 -52
  130. package/examples/test/dev/test_BP/feature_rules/overworld_underground_titanite_ore_feature.json +52 -52
  131. package/examples/test/dev/test_BP/features/ore_cinnabar_ore_feature.json +16 -16
  132. package/examples/test/dev/test_BP/features/titanite_ore_feature.json +22 -22
  133. package/examples/test/dev/test_BP/items/sapdon_chest.json +22 -22
  134. package/examples/test/dev/test_BP/items/sapdon_test_book.json +19 -0
  135. package/examples/test/dev/test_BP/items/sapdon_test_food.json +25 -25
  136. package/examples/test/dev/test_BP/items/sapdon_test_item.json +30 -30
  137. package/examples/test/dev/test_BP/manifest.json +63 -59
  138. package/examples/test/dev/test_BP/recipes/sapdon_test_furnace.json +12 -12
  139. package/examples/test/dev/test_BP/scripts/custom_components/cropComponent.js +1 -10
  140. package/examples/test/dev/test_BP/scripts/custom_components/items/gui_book.js +37 -0
  141. package/examples/test/dev/test_BP/scripts/custom_components/registry.js +20 -0
  142. package/examples/test/dev/test_BP/scripts/index.js +4 -3
  143. package/examples/test/dev/test_RP/attachables/sapdon_chest.json +24 -24
  144. package/examples/test/dev/test_RP/blocks.json +42 -42
  145. package/examples/test/dev/test_RP/entity/sapdon_test_projectile.json +27 -27
  146. package/examples/test/dev/test_RP/manifest.json +43 -43
  147. package/examples/test/dev/test_RP/models/blocks/arcane_workbench.geo.json +105 -105
  148. package/examples/test/dev/test_RP/models/blocks/jar_normal.geo.json +46 -46
  149. package/examples/test/dev/test_RP/models/blocks/jar_normal_0.geo.json +58 -58
  150. package/examples/test/dev/test_RP/models/blocks/jar_normal_1.geo.json +58 -58
  151. package/examples/test/dev/test_RP/models/blocks/jar_normal_2.geo.json +58 -58
  152. package/examples/test/dev/test_RP/models/blocks/jar_normal_3.geo.json +58 -58
  153. package/examples/test/dev/test_RP/models/blocks/wire.geo.json +153 -153
  154. package/examples/test/dev/test_RP/textures/item_texture.json +788 -788
  155. package/examples/test/dev/test_RP/textures/items/seals/seal_breaker.png.mcmeta +5 -5
  156. package/examples/test/dev/test_RP/textures/items/seals/seal_butcher.png.mcmeta +5 -5
  157. package/examples/test/dev/test_RP/textures/items/seals/seal_empty.png.mcmeta +5 -5
  158. package/examples/test/dev/test_RP/textures/items/seals/seal_empty_advanced.png.mcmeta +5 -5
  159. package/examples/test/dev/test_RP/textures/items/seals/seal_fill.png.mcmeta +5 -5
  160. package/examples/test/dev/test_RP/textures/items/seals/seal_fill_advanced.png.mcmeta +5 -5
  161. package/examples/test/dev/test_RP/textures/items/seals/seal_guard.png.mcmeta +5 -5
  162. package/examples/test/dev/test_RP/textures/items/seals/seal_guard_advanced.png.mcmeta +5 -5
  163. package/examples/test/dev/test_RP/textures/items/seals/seal_harvest.png.mcmeta +5 -5
  164. package/examples/test/dev/test_RP/textures/items/seals/seal_lumber.png.mcmeta +5 -5
  165. package/examples/test/dev/test_RP/textures/items/seals/seal_pickup.png.mcmeta +5 -5
  166. package/examples/test/dev/test_RP/textures/items/seals/seal_pickup_advanced.png.mcmeta +5 -5
  167. package/examples/test/dev/test_RP/textures/items/seals/seal_provider.png.mcmeta +5 -5
  168. package/examples/test/dev/test_RP/textures/items/seals/seal_use.png.mcmeta +5 -5
  169. package/examples/test/dev/test_RP/textures/items/wand/cap_thaumium.png.mcmeta +11 -11
  170. package/examples/test/dev/test_RP/textures/items/wand/cap_void.png.mcmeta +11 -11
  171. package/examples/test/dev/test_RP/textures/items/wand/focus_pech.png.mcmeta +2 -2
  172. package/examples/test/dev/test_RP/textures/items/wand/focus_portablehole.png.mcmeta +2 -2
  173. package/examples/test/dev/test_RP/textures/items/wand/focus_primal.png.mcmeta +2 -2
  174. package/examples/test/dev/test_RP/textures/items/wand/focus_shard.png.mcmeta +2 -2
  175. package/examples/test/dev/test_RP/textures/items/wand/focus_warding.png.mcmeta +2 -2
  176. package/examples/test/dev/test_RP/textures/items/wand/rod_primal_mat.png.mcmeta +44 -44
  177. package/examples/test/dev/test_RP/textures/terrain_texture.json +136 -136
  178. package/examples/test/dev/test_RP/ui/_ui_defs.json +6 -0
  179. package/examples/test/dev/test_RP/ui/guidebook.json +446 -0
  180. package/examples/test/dev/test_RP/ui/server_form.json +91 -0
  181. package/examples/test/main.mjs +46 -1
  182. package/examples/test/res/models/blocks/arcane_workbench.geo.json +105 -105
  183. package/examples/test/res/models/blocks/jar_normal.geo.json +46 -46
  184. package/examples/test/res/models/blocks/jar_normal_0.geo.json +58 -58
  185. package/examples/test/res/models/blocks/jar_normal_1.geo.json +58 -58
  186. package/examples/test/res/models/blocks/jar_normal_2.geo.json +58 -58
  187. package/examples/test/res/models/blocks/jar_normal_3.geo.json +58 -58
  188. package/examples/test/res/models/blocks/wire.geo.json +153 -153
  189. package/examples/test/res/textures/items/seals/seal_breaker.png.mcmeta +5 -5
  190. package/examples/test/res/textures/items/seals/seal_butcher.png.mcmeta +5 -5
  191. package/examples/test/res/textures/items/seals/seal_empty.png.mcmeta +5 -5
  192. package/examples/test/res/textures/items/seals/seal_empty_advanced.png.mcmeta +5 -5
  193. package/examples/test/res/textures/items/seals/seal_fill.png.mcmeta +5 -5
  194. package/examples/test/res/textures/items/seals/seal_fill_advanced.png.mcmeta +5 -5
  195. package/examples/test/res/textures/items/seals/seal_guard.png.mcmeta +5 -5
  196. package/examples/test/res/textures/items/seals/seal_guard_advanced.png.mcmeta +5 -5
  197. package/examples/test/res/textures/items/seals/seal_harvest.png.mcmeta +5 -5
  198. package/examples/test/res/textures/items/seals/seal_lumber.png.mcmeta +5 -5
  199. package/examples/test/res/textures/items/seals/seal_pickup.png.mcmeta +5 -5
  200. package/examples/test/res/textures/items/seals/seal_pickup_advanced.png.mcmeta +5 -5
  201. package/examples/test/res/textures/items/seals/seal_provider.png.mcmeta +5 -5
  202. package/examples/test/res/textures/items/seals/seal_use.png.mcmeta +5 -5
  203. package/examples/test/res/textures/items/wand/cap_thaumium.png.mcmeta +11 -11
  204. package/examples/test/res/textures/items/wand/cap_void.png.mcmeta +11 -11
  205. package/examples/test/res/textures/items/wand/focus_pech.png.mcmeta +2 -2
  206. package/examples/test/res/textures/items/wand/focus_portablehole.png.mcmeta +2 -2
  207. package/examples/test/res/textures/items/wand/focus_primal.png.mcmeta +2 -2
  208. package/examples/test/res/textures/items/wand/focus_shard.png.mcmeta +2 -2
  209. package/examples/test/res/textures/items/wand/focus_warding.png.mcmeta +2 -2
  210. package/examples/test/res/textures/items/wand/rod_primal_mat.png.mcmeta +44 -44
  211. package/examples/test/scripts/custom_components/cropComponent.js +1 -10
  212. package/examples/test/scripts/custom_components/items/gui_book.js +37 -0
  213. package/examples/test/scripts/custom_components/registry.js +20 -0
  214. package/examples/test/scripts/index.js +4 -3
  215. package/log.md +8 -0
  216. package/package.json +4 -1
  217. package/src/cli/build.js +210 -210
  218. package/src/cli/load.js +116 -112
  219. package/src/cli/tools/textureSet.js +114 -114
  220. package/src/cli/utils.js +82 -82
  221. package/src/core/addon/controllers/animation_controller.js +80 -0
  222. package/src/core/addon/entity/entity.js +52 -51
  223. package/src/core/block/GeometryBlock.js +8 -0
  224. package/src/core/block/OreBlock.js +1 -0
  225. package/src/core/block/TileBlock.js +117 -0
  226. package/src/core/block/block.js +106 -106
  227. package/src/core/block/blockComponent.js +557 -557
  228. package/src/core/block/cropBlock.js +1 -1
  229. package/src/core/entity/BasicEntity.js +195 -166
  230. package/src/core/entity/bundles/BasicBundle.js +51 -0
  231. package/src/core/factory/BlockFactory.js +166 -158
  232. package/src/core/factory/EntityFactory.js +82 -82
  233. package/src/core/factory/ItemFactory.js +120 -95
  234. package/src/core/factory/RecipeFactory.js +46 -46
  235. package/src/core/index.js +2 -1
  236. package/src/core/item/Item.js +96 -96
  237. package/src/core/item/ItemComponents.js +251 -235
  238. package/src/core/item/armor.js +117 -89
  239. package/src/core/item/attachable.js +33 -33
  240. package/src/core/item/food.js +61 -61
  241. package/src/core/registry.js +16 -16
  242. package/src/core/ui/Properties/{Grid.js → GridProp.js} +2 -2
  243. package/src/core/ui/Properties/Sound.js +72 -0
  244. package/src/core/ui/elements/Button.js +111 -0
  245. package/src/core/ui/elements/CollectionPanel.js +61 -0
  246. package/src/core/ui/elements/Grid.js +24 -0
  247. package/src/core/ui/elements/Image.js +4 -0
  248. package/src/core/ui/elements/Label.js +10 -2
  249. package/src/core/ui/elements/Panel.js +7 -0
  250. package/src/core/ui/elements/ScrollingPanel.js +68 -0
  251. package/src/core/ui/elements/StackPanel.js +40 -0
  252. package/src/core/ui/elements/UIElement.js +43 -2
  253. package/src/core/ui/registry/UISystemRegistry.js +35 -0
  254. package/src/core/ui/systems/UISystem.js +9 -5
  255. package/src/core/ui/systems/guidebook.js +299 -0
  256. package/src/core/ui/systems/server_form.js +94 -83
  257. package/src/templates/test_sapdon/build.config +28 -28
  258. package/src/templates/test_sapdon/res/animations/animation_item.animation.json +34 -0
  259. package/src/templates/test_sapdon/res/animations/large_item.animation.json +27 -0
  260. package/src/templates/test_sapdon/res/models/entity/animation/animation_item.geo.json +26 -0
  261. package/src/templates/test_sapdon/res/models/entity/animation/large_item.geo.json +28 -0
  262. package/src/templates/test_sapdon/res/textures/blocks/none.png +0 -0
  263. package/src/templates/test_sapdon/scripts/custom_components/cropComponent.js +50 -0
  264. package/src/templates/test_sapdon/scripts/custom_components/items/gui_book.js +37 -0
  265. package/src/templates/test_sapdon/scripts/custom_components/registry.js +25 -0
  266. package/examples/masterball/dev/masterball[1.20.20+].mcaddon.zip +0 -0
  267. package/examples/masterball/dev/masterball_BP/masterball_BP_1_20_20/entities/sapdon_projectile_masterball.json +0 -56
  268. package/examples/masterball/dev/masterball_BP/masterball_BP_1_20_20/items/sapdon_caught_masterball.json +0 -32
  269. package/examples/masterball/dev/masterball_BP/masterball_BP_1_20_20/items/sapdon_uncaught_masterball.json +0 -31
  270. package/examples/masterball/dev/masterball_BP/masterball_BP_1_20_20/scripts/index.js +0 -159
  271. package/examples/test/dev/test_BP/biomes/test_biome.json +0 -48
  272. package/examples/test/dev/test_BP/blocks/sapdon_block.json +0 -111
  273. package/examples/test/dev/test_BP/entities/sapdon_body.json +0 -118
  274. package/examples/test/dev/test_BP/entities/sapdon_test_entity_ctrl1.json +0 -55
  275. package/examples/test/dev/test_BP/entities/sapdon_test_entity_ctrl2.json +0 -61
  276. package/examples/test/dev/test_BP/entities/sapdon_test_entity_header.json +0 -408
  277. package/examples/test/dev/test_RP/entity/sapdon_body.json +0 -44
  278. package/examples/test/dev/test_RP/entity/sapdon_test_entity_ctrl1.json +0 -38
  279. package/examples/test/dev/test_RP/entity/sapdon_test_entity_ctrl2.json +0 -38
  280. package/examples/test/dev/test_RP/entity/sapdon_test_entity_header.json +0 -44
  281. package/src/cli/build.config +0 -4
  282. package/src/core/ui/registry/ServerUISystem.js +0 -19
  283. /package/examples/{masterball/dev/masterball_BP/masterball_BP_1_20_20 → guidebook/dev/guidebook_BP}/pack_icon.png +0 -0
@@ -1,159 +1,167 @@
1
- import { BasicBlock } from "../block/BasicBlock.js";
2
- import { Block } from "../block/block.js";
3
- import { CropBlock } from "../block/cropBlock.js";
4
- import { GeometryBlock } from "../block/GeometryBlock.js";
5
- import { OreBlock } from "../block/OreBlock.js";
6
- import { RotatableBlock } from "../block/RotatableBlock.js";
7
- import { GRegistry } from "../registry.js";
8
-
9
-
10
- /**
11
- * 注册方块到注册表中。
12
- * @param {Block} block - 要注册的方块对象。
13
- */
14
- const registerBlock = (block) => {
15
- if (!block || !block.identifier) {
16
- throw new Error("无效的方块对象或缺少 identifier。");
17
- }
18
-
19
- const block_name = block.identifier.replace(":", "_");
20
- GRegistry.register(block_name, "behavior", "blocks/", block);
21
- };
22
-
23
- const registerFeature = (feature)=>{
24
- const feature_name = feature.identifier.split(":")[feature.identifier.split(":").length - 1];
25
- GRegistry.register(feature_name,"behavior","features/",feature);
26
- };
27
-
28
- const registerFeatureRule = (feature_rule)=>{
29
- const feature_rule_name = feature_rule.identifier.split(":")[feature_rule.identifier.split(":").length - 1];
30
- GRegistry.register(feature_rule_name,"behavior","feature_rules/",feature_rule);
31
- };
32
-
33
- export const BlockAPI = {
34
- /**
35
- * 创建一个基础方块。
36
- * @param {string} identifier - 方块的唯一标识符。
37
- * @param {string} category - 方块的分类(如 "construction")。
38
- * @param {Array} textures_arr - 纹理数组,顺序为 [上, 下, 东, 西, 南, 北]。
39
- * @param {Object} options - 可选参数。
40
- * @param {string} options.group - 分组,默认为 "construction"
41
- * @param {boolean} options.hide_in_command - 是否在命令中隐藏,默认为 false。
42
- * @returns {BasicBlock} 创建的基础方块对象。
43
- */
44
- createBasicBlock: function (identifier, category, textures_arr, options = {}) {
45
- if (!identifier || !category || !textures_arr ) {
46
- throw new Error("必须提供 identifier、category 和长度为 6 textures_arr。");
47
- }
48
-
49
- const block = new BasicBlock(identifier, category, textures_arr, {
50
- hide_in_command: false,
51
- ...options, // 用传入的选项覆盖默认值
52
- });
53
-
54
- registerBlock(block); // 调用注册方法
55
- return block;
56
- },
57
-
58
- /**
59
- * 创建一个普通方块。
60
- * @param {string} identifier - 方块的唯一标识符。
61
- * @param {string} category - 方块的分类(如 "construction")。
62
- * @param {Array} variantDatas - 方块的变体数据,包含每个变体的状态标签和纹理。
63
- * @param {Object} options - 可选参数。
64
- * @param {string} options.group - 分组,默认为 "construction"。
65
- * @param {boolean} options.hide_in_command - 是否在命令中隐藏,默认为 false。
66
- * @param {boolean} options.ambient_occlusion - 是否应用环境光遮蔽,默认为 false
67
- * @param {boolean} options.face_dimming - 是否根据面的方向进行亮度调整,默认为 false。
68
- * @param {string} options.render_method - 渲染方法,默认为 "alpha_test"
69
- * @returns {Block} 创建的方块对象。
70
- */
71
- createBlock: function (identifier, category, variantDatas, options = {}) {
72
- if (!identifier || !category || !variantDatas || variantDatas.length === 0) {
73
- throw new Error("必须提供 identifier、category variantDatas。");
74
- }
75
-
76
- const block = new Block(identifier, category, variantDatas, {
77
- hide_in_command: false,
78
- ambient_occlusion: false,
79
- face_dimming: false,
80
- render_method: "alpha_test",
81
- ...options, // 用传入的选项覆盖默认值
82
- });
83
-
84
- registerBlock(block); // 调用注册方法
85
- return block;
86
- },
87
-
88
- /**
89
- * 创建一个可旋转方块。
90
- * @param {string} identifier - 方块的唯一标识符。
91
- * @param {string} category - 方块的分类(如 "construction")。
92
- * @param {Array} textures_arr - 纹理数组,顺序为 [上, 下, 东, 西, 南, 北]。
93
- * @param {Object} options - 可选参数。
94
- * @param {string} options.group - 分组,默认为 "construction"
95
- * @param {boolean} options.hide_in_command - 是否在命令中隐藏,默认为 false。
96
- * @param {string} options.rotationType - 旋转类型,默认为 "cardinal"。
97
- * @param {number} options.yRotationOffset - 初始旋转偏移量,默认为 180
98
- * @returns {RotatableBlock} 创建的可旋转方块对象。
99
- */
100
- createRotatableBlock: function (identifier, category, textures_arr, options = {}) {
101
- if (!identifier || !category || !textures_arr ) {
102
- throw new Error("必须提供 identifier、category textures_arr。");
103
- }
104
-
105
- const block = new RotatableBlock(identifier, category, textures_arr, {
106
- hide_in_command: false,
107
- rotationType: "cardinal",
108
- yRotationOffset: 180,
109
- ...options, // 用传入的选项覆盖默认值
110
- });
111
-
112
- registerBlock(block); // 调用注册方法
113
- return block;
114
- },
115
- createGeometryBlock: function (identifier, category, geometry, material_instances, options = {}) {
116
- if (!identifier || !category || !geometry || !material_instances ) {
117
- throw new Error("必须提供 identifier、categorygeometry material_instances。");
118
- }
119
- const block = new GeometryBlock(identifier, category, geometry, material_instances, options);
120
- registerBlock(block); // 调用注册方法
121
- return block;
122
- },
123
- createOreBlock(identifier, category, textures_arr, options = {}){
124
- const ore_block = new OreBlock(identifier, category, textures_arr, options)
125
- registerBlock(ore_block.block); // 调用注册方法
126
- registerFeature(ore_block.feature); // 调用注册方法
127
- registerFeatureRule(ore_block.feature_rules); // 调用注册方法
128
- return ore_block;
129
- },
130
- /**
131
- * 创建一个作物方块。
132
- * @param {string} identifier - 方块的唯一标识符。
133
- * @param {string} category - 方块的分类(如 "construction")。
134
- * @param {Array} variantDatas - 方块的变体数据,包含每个变体的状态标签和纹理。
135
- * @param {Object} options - 可选参数。
136
- * @param {string} options.group - 分组,默认为 "construction"。
137
- * @param {boolean} options.hide_in_command - 是否在命令中隐藏,默认为 false。
138
- * @param {boolean} options.ambient_occlusion - 是否应用环境光遮蔽,默认为 false
139
- * @param {boolean} options.face_dimming - 是否根据面的方向进行亮度调整,默认为 false。
140
- * @param {string} options.render_method - 渲染方法,默认为 "alpha_test"
141
- * @returns {CropBlock} 创建的方块对象。
142
- */
143
- createCropBlock: function (identifier, category, variantDatas, options = {}) {
144
- if (!identifier || !category || !variantDatas || variantDatas.length === 0) {
145
- throw new Error("必须提供 identifier、category variantDatas。");
146
- }
147
-
148
- const block = new CropBlock(identifier, category, variantDatas, {
149
- hide_in_command: false,
150
- ambient_occlusion: true,
151
- face_dimming: true,
152
- render_method: "alpha_test",
153
- ...options, // 用传入的选项覆盖默认值
154
- });
155
-
156
- registerBlock(block); // 调用注册方法
157
- return block;
158
- },
1
+ import { BasicBlock } from "../block/BasicBlock.js";
2
+ import { Block } from "../block/block.js";
3
+ import { CropBlock } from "../block/cropBlock.js";
4
+ import { GeometryBlock } from "../block/GeometryBlock.js";
5
+ import { OreBlock } from "../block/OreBlock.js";
6
+ import { RotatableBlock } from "../block/RotatableBlock.js";
7
+ import { TileBlock } from "../block/TileBlock.js";
8
+ import { GRegistry } from "../registry.js";
9
+ import { registerEntity } from "./EntityFactory.js";
10
+
11
+
12
+ /**
13
+ * 注册方块到注册表中。
14
+ * @param {Block} block - 要注册的方块对象。
15
+ */
16
+ const registerBlock = (block) => {
17
+ if (!block || !block.identifier) {
18
+ throw new Error("无效的方块对象或缺少 identifier。");
19
+ }
20
+
21
+ const block_name = block.identifier.replace(":", "_");
22
+ GRegistry.register(block_name, "behavior", "blocks/", block);
23
+ };
24
+
25
+ const registerFeature = (feature)=>{
26
+ const feature_name = feature.identifier.split(":")[feature.identifier.split(":").length - 1];
27
+ GRegistry.register(feature_name,"behavior","features/",feature);
28
+ };
29
+
30
+ const registerFeatureRule = (feature_rule)=>{
31
+ const feature_rule_name = feature_rule.identifier.split(":")[feature_rule.identifier.split(":").length - 1];
32
+ GRegistry.register(feature_rule_name,"behavior","feature_rules/",feature_rule);
33
+ };
34
+
35
+ export const BlockAPI = {
36
+ /**
37
+ * 创建一个基础方块。
38
+ * @param {string} identifier - 方块的唯一标识符。
39
+ * @param {string} category - 方块的分类(如 "construction")。
40
+ * @param {Array} textures_arr - 纹理数组,顺序为 [上, 下, 东, 西, 南, 北]
41
+ * @param {Object} options - 可选参数。
42
+ * @param {string} options.group - 分组,默认为 "construction"。
43
+ * @param {boolean} options.hide_in_command - 是否在命令中隐藏,默认为 false。
44
+ * @returns {BasicBlock} 创建的基础方块对象。
45
+ */
46
+ createBasicBlock: function (identifier, category, textures_arr, options = {}) {
47
+ if (!identifier || !category || !textures_arr ) {
48
+ throw new Error("必须提供 identifier、category 和长度为 6 的 textures_arr。");
49
+ }
50
+
51
+ const block = new BasicBlock(identifier, category, textures_arr, {
52
+ hide_in_command: false,
53
+ ...options, // 用传入的选项覆盖默认值
54
+ });
55
+
56
+ registerBlock(block); // 调用注册方法
57
+ return block;
58
+ },
59
+
60
+ /**
61
+ * 创建一个普通方块。
62
+ * @param {string} identifier - 方块的唯一标识符。
63
+ * @param {string} category - 方块的分类(如 "construction")。
64
+ * @param {Array} variantDatas - 方块的变体数据,包含每个变体的状态标签和纹理。
65
+ * @param {Object} options - 可选参数。
66
+ * @param {string} options.group - 分组,默认为 "construction"
67
+ * @param {boolean} options.hide_in_command - 是否在命令中隐藏,默认为 false。
68
+ * @param {boolean} options.ambient_occlusion - 是否应用环境光遮蔽,默认为 false
69
+ * @param {boolean} options.face_dimming - 是否根据面的方向进行亮度调整,默认为 false。
70
+ * @param {string} options.render_method - 渲染方法,默认为 "alpha_test"。
71
+ * @returns {Block} 创建的方块对象。
72
+ */
73
+ createBlock: function (identifier, category, variantDatas, options = {}) {
74
+ if (!identifier || !category || !variantDatas || variantDatas.length === 0) {
75
+ throw new Error("必须提供 identifier、category 和 variantDatas。");
76
+ }
77
+
78
+ const block = new Block(identifier, category, variantDatas, {
79
+ hide_in_command: false,
80
+ ambient_occlusion: false,
81
+ face_dimming: false,
82
+ render_method: "alpha_test",
83
+ ...options, // 用传入的选项覆盖默认值
84
+ });
85
+
86
+ registerBlock(block); // 调用注册方法
87
+ return block;
88
+ },
89
+
90
+ /**
91
+ * 创建一个可旋转方块。
92
+ * @param {string} identifier - 方块的唯一标识符。
93
+ * @param {string} category - 方块的分类(如 "construction")。
94
+ * @param {Array} textures_arr - 纹理数组,顺序为 [上, 下, 东, 西, 南, 北]
95
+ * @param {Object} options - 可选参数。
96
+ * @param {string} options.group - 分组,默认为 "construction"。
97
+ * @param {boolean} options.hide_in_command - 是否在命令中隐藏,默认为 false
98
+ * @param {string} options.rotationType - 旋转类型,默认为 "cardinal"。
99
+ * @param {number} options.yRotationOffset - 初始旋转偏移量,默认为 180。
100
+ * @returns {RotatableBlock} 创建的可旋转方块对象。
101
+ */
102
+ createRotatableBlock: function (identifier, category, textures_arr, options = {}) {
103
+ if (!identifier || !category || !textures_arr ) {
104
+ throw new Error("必须提供 identifier、category 和 textures_arr。");
105
+ }
106
+
107
+ const block = new RotatableBlock(identifier, category, textures_arr, {
108
+ hide_in_command: false,
109
+ rotationType: "cardinal",
110
+ yRotationOffset: 180,
111
+ ...options, // 用传入的选项覆盖默认值
112
+ });
113
+
114
+ registerBlock(block); // 调用注册方法
115
+ return block;
116
+ },
117
+ createGeometryBlock: function (identifier, category, geometry, material_instances, options = {}) {
118
+ if (!identifier || !category || !geometry || !material_instances ) {
119
+ throw new Error("必须提供 identifiercategorygeometry material_instances。");
120
+ }
121
+ const block = new GeometryBlock(identifier, category, geometry, material_instances, options);
122
+ registerBlock(block); // 调用注册方法
123
+ return block;
124
+ },
125
+ createOreBlock(identifier, category, textures_arr, options = {}){
126
+ const ore_block = new OreBlock(identifier, category, textures_arr, options)
127
+ registerBlock(ore_block.block); // 调用注册方法
128
+ registerFeature(ore_block.feature); // 调用注册方法
129
+ registerFeatureRule(ore_block.feature_rules); // 调用注册方法
130
+ return ore_block;
131
+ },
132
+ /**
133
+ * 创建一个作物方块。
134
+ * @param {string} identifier - 方块的唯一标识符。
135
+ * @param {string} category - 方块的分类(如 "construction")。
136
+ * @param {Array} variantDatas - 方块的变体数据,包含每个变体的状态标签和纹理。
137
+ * @param {Object} options - 可选参数。
138
+ * @param {string} options.group - 分组,默认为 "construction"
139
+ * @param {boolean} options.hide_in_command - 是否在命令中隐藏,默认为 false。
140
+ * @param {boolean} options.ambient_occlusion - 是否应用环境光遮蔽,默认为 false
141
+ * @param {boolean} options.face_dimming - 是否根据面的方向进行亮度调整,默认为 false。
142
+ * @param {string} options.render_method - 渲染方法,默认为 "alpha_test"。
143
+ * @returns {CropBlock} 创建的方块对象。
144
+ */
145
+ createCropBlock: function (identifier, category, variantDatas, options = {}) {
146
+ if (!identifier || !category || !variantDatas || variantDatas.length === 0) {
147
+ throw new Error("必须提供 identifier、category 和 variantDatas。");
148
+ }
149
+
150
+ const block = new CropBlock(identifier, category, variantDatas, {
151
+ hide_in_command: false,
152
+ ambient_occlusion: true,
153
+ face_dimming: true,
154
+ render_method: "alpha_test",
155
+ ...options, // 用传入的选项覆盖默认值
156
+ });
157
+
158
+ registerBlock(block); // 调用注册方法
159
+ return block;
160
+ },
161
+ createTileBlock: function (identifier, category, textures_arr, options = {}) {
162
+ const block = new TileBlock(identifier, category, textures_arr, options);
163
+ registerBlock(block.block); // 调用注册方法
164
+ registerEntity(block.entity.entity,block.entity.client_entity)
165
+ return block;
166
+ }
159
167
  };
@@ -1,83 +1,83 @@
1
- import { BasicEntity } from "../entity/BasicEntity.js";
2
- import { ClientEntity } from "../entity/ClientEntity.js";
3
- import { Entity } from "../entity/Entity.js";
4
- import { NativeEntity } from "../entity/NativeEntity.js";
5
- import { Projectile } from "../entity/Projectile.js";
6
- import { GRegistry } from "../registry.js";
7
-
8
- const registerEntity = (behData, resData) => {
9
- // 如果 behData 存在且不为空,则注册行为数据
10
- if (behData && Object.keys(behData).length > 0) {
11
- GRegistry.register(behData.identifier.replace(":", "_"), "behavior", "entities/", behData);
12
- }
13
-
14
- // 如果 resData 存在且不为空,则注册资源数据
15
- if (resData && Object.keys(resData).length > 0) {
16
- GRegistry.register(resData.identifier.replace(":", "_"), "resource", "entity/", resData);
17
- }
18
- };
19
-
20
- export const EntityAPI = {
21
- /**
22
- * 创建一个原生实体。
23
- * @param {string} identifier - 实体的唯一标识符。
24
- * @param {string} proto_id - 实体的原型 ID。
25
- * @param {string} texture - 实体的纹理。
26
- * @param {Object} options - 额外选项。
27
- * @returns {{ behavior: BasicEntity, resource: ClientEntity }} 包含行为数据和资源数据的对象。
28
- */
29
- createNativeEntity: function (identifier, proto_id, options = {}) {
30
- if (!identifier || !proto_id ) {
31
- throw new Error("必须提供 identifier、proto_id 和 texture。");
32
- }
33
-
34
- const nativeEntity = new NativeEntity(identifier, proto_id, options);
35
- registerEntity(nativeEntity.entity, nativeEntity.client_entity);
36
- return {
37
- behavior: nativeEntity.entity,
38
- resource: nativeEntity.client_entity,
39
- };
40
- },
41
-
42
- /**
43
- * 创建一个普通实体。
44
- * @param {string} identifier - 实体的唯一标识符。
45
- * @param {string} texture - 实体的纹理。
46
- * @param {Object} behData - 实体的行为数据。
47
- * @param {Object} resData - 实体的资源数据。
48
- * @param {Object} options - 额外选项。
49
- * @returns {{ behavior: BasicEntity, resource: ClientEntity }} 包含行为数据和资源数据的对象。
50
- */
51
- createEntity: function (identifier, texture, behData, resData, options = {}) {
52
- if (!identifier || !texture) {
53
- throw new Error("必须提供 identifier 和 texture。");
54
- }
55
-
56
- const entity = new Entity(identifier, texture, behData, resData, options);
57
- registerEntity(entity.entity, entity.client_entity);
58
- return {
59
- behavior: entity.entity,
60
- resource: entity.client_entity,
61
- };
62
- },
63
-
64
- /**
65
- * 创建一个投射物实体。
66
- * @param {string} identifier - 投射物的唯一标识符。
67
- * @param {string} texture - 投射物的纹理。
68
- * @param {Object} options - 额外选项。
69
- * @returns {{ behavior: BasicEntity, resource: ClientEntity }} 包含行为数据和资源数据的对象。
70
- */
71
- createProjectile: function (identifier, texture, options = {}) {
72
- if (!identifier || !texture) {
73
- throw new Error("必须提供 identifier 和 texture。");
74
- }
75
-
76
- const entity = new Projectile(identifier, texture, options);
77
- registerEntity(entity.entity, entity.client_entity);
78
- return {
79
- behavior: entity.entity,
80
- resource: entity.client_entity,
81
- };
82
- },
1
+ import { BasicEntity } from "../entity/BasicEntity.js";
2
+ import { ClientEntity } from "../entity/ClientEntity.js";
3
+ import { Entity } from "../entity/Entity.js";
4
+ import { NativeEntity } from "../entity/NativeEntity.js";
5
+ import { Projectile } from "../entity/Projectile.js";
6
+ import { GRegistry } from "../registry.js";
7
+
8
+ export const registerEntity = (behData, resData) => {
9
+ // 如果 behData 存在且不为空,则注册行为数据
10
+ if (behData && Object.keys(behData).length > 0) {
11
+ GRegistry.register(behData.identifier.replace(":", "_"), "behavior", "entities/", behData);
12
+ }
13
+
14
+ // 如果 resData 存在且不为空,则注册资源数据
15
+ if (resData && Object.keys(resData).length > 0) {
16
+ GRegistry.register(resData.identifier.replace(":", "_"), "resource", "entity/", resData);
17
+ }
18
+ };
19
+
20
+ export const EntityAPI = {
21
+ /**
22
+ * 创建一个原生实体。
23
+ * @param {string} identifier - 实体的唯一标识符。
24
+ * @param {string} proto_id - 实体的原型 ID。
25
+ * @param {string} texture - 实体的纹理。
26
+ * @param {Object} options - 额外选项。
27
+ * @returns {{ behavior: BasicEntity, resource: ClientEntity }} 包含行为数据和资源数据的对象。
28
+ */
29
+ createNativeEntity: function (identifier, proto_id, options = {}) {
30
+ if (!identifier || !proto_id ) {
31
+ throw new Error("必须提供 identifier、proto_id 和 texture。");
32
+ }
33
+
34
+ const nativeEntity = new NativeEntity(identifier, proto_id, options);
35
+ registerEntity(nativeEntity.entity, nativeEntity.client_entity);
36
+ return {
37
+ behavior: nativeEntity.entity,
38
+ resource: nativeEntity.client_entity,
39
+ };
40
+ },
41
+
42
+ /**
43
+ * 创建一个普通实体。
44
+ * @param {string} identifier - 实体的唯一标识符。
45
+ * @param {string} texture - 实体的纹理。
46
+ * @param {Object} behData - 实体的行为数据。
47
+ * @param {Object} resData - 实体的资源数据。
48
+ * @param {Object} options - 额外选项。
49
+ * @returns {{ behavior: BasicEntity, resource: ClientEntity }} 包含行为数据和资源数据的对象。
50
+ */
51
+ createEntity: function (identifier, texture, behData, resData, options = {}) {
52
+ if (!identifier || !texture) {
53
+ throw new Error("必须提供 identifier 和 texture。");
54
+ }
55
+
56
+ const entity = new Entity(identifier, texture, behData, resData, options);
57
+ registerEntity(entity.entity, entity.client_entity);
58
+ return {
59
+ behavior: entity.entity,
60
+ resource: entity.client_entity,
61
+ };
62
+ },
63
+
64
+ /**
65
+ * 创建一个投射物实体。
66
+ * @param {string} identifier - 投射物的唯一标识符。
67
+ * @param {string} texture - 投射物的纹理。
68
+ * @param {Object} options - 额外选项。
69
+ * @returns {{ behavior: BasicEntity, resource: ClientEntity }} 包含行为数据和资源数据的对象。
70
+ */
71
+ createProjectile: function (identifier, texture, options = {}) {
72
+ if (!identifier || !texture) {
73
+ throw new Error("必须提供 identifier 和 texture。");
74
+ }
75
+
76
+ const entity = new Projectile(identifier, texture, options);
77
+ registerEntity(entity.entity, entity.client_entity);
78
+ return {
79
+ behavior: entity.entity,
80
+ resource: entity.client_entity,
81
+ };
82
+ },
83
83
  };