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,96 +1,121 @@
1
- import { Chestplate } from "../item/armor.js";
2
- import { Attachable } from "../item/Attachable.js";
3
- import { Food } from "../item/Food.js";
4
- import { Item } from "../item/item.js";
5
- import { GRegistry } from "../registry.js";
6
-
7
- const registerItem = (itemData, attachableData) => {
8
- // 如果 itemData 存在且不为空,则注册
9
- if (itemData && Object.keys(itemData).length > 0) {
10
- GRegistry.register(itemData.identifier.replace(":", "_"), "behavior", "items/", itemData);
11
- }
12
-
13
- // 如果 attachableData 存在且不为空,则注册
14
- if (attachableData && Object.keys(attachableData).length > 0) {
15
- GRegistry.register(attachableData.identifier.replace(":", "_"), "resource", "attachables/", attachableData);
16
- }
17
- };
18
-
19
- // 物品创建的工厂函数
20
- export const ItemAPI = {
21
- /**
22
- * 创建一个普通物品。
23
- * @param {string} identifier - 物品的唯一标识符。
24
- * @param {string} category - 物品在创造菜单中的分类(如 "construction", "nature")。
25
- * @param {string} texture - 物品的纹理。
26
- * @param {Object} options - 额外选项。
27
- * @param {string} options.group - 物品的分组。
28
- * @param {boolean} options.hide_in_command - 是否在命令中隐藏物品。
29
- * @returns {Item} 创建的物品。
30
- */
31
- createItem: function (identifier, category, texture, options = {}) {
32
- if (!identifier || !category || !texture) {
33
- throw new Error("必须提供 identifier、category texture。");
34
- }
35
-
36
- const item = new Item(identifier, category, texture, options);
37
- registerItem(item, {});
38
- return item;
39
- },
40
-
41
- /**
42
- * 创建一个食物物品。
43
- * @param {string} identifier - 食物的唯一标识符。
44
- * @param {string} category - 食物在创造菜单中的分类。
45
- * @param {string} texture - 食物的纹理。
46
- * @param {Object} options - 额外选项。
47
- * @param {string} options.group - 食物的分组。
48
- * @param {boolean} options.hide_in_command - 是否在命令中隐藏食物。
49
- * @param {string} options.animation - 食用时的动画(默认:"eat")。
50
- * @param {boolean} options.canAlwaysEat - 是否总是可以食用。
51
- * @param {number} options.nutrition - 食物的营养价值。
52
- * @param {number} options.saturationModifier - 饱和度修正值。
53
- * @returns {Food} 创建的食物物品。
54
- */
55
- createFood: function (identifier, category, texture, options = {}) {
56
- if (!identifier || !category || !texture) {
57
- throw new Error("必须提供 identifier、category texture。");
58
- }
59
-
60
- const food = new Food(identifier, category, texture, {
61
- animation: "eat",
62
- canAlwaysEat: false,
63
- nutrition: 0,
64
- saturationModifier: 1,
65
- ...options, // 用传入的选项覆盖默认值
66
- });
67
-
68
- registerItem(food, {});
69
- return food;
70
- },
71
-
72
- /**
73
- * 创建一个可附着物品。
74
- * @param {string} identifier - 可附着物品的唯一标识符。
75
- * @param {string} texture - 可附着物品的纹理。
76
- * @param {string} material - 可附着物品的材质。
77
- * @param {Object} options - 额外选项。
78
- * @returns {Attachable} 创建的可附着物品。
79
- */
80
- createAttachable: function (identifier, texture, material, options = {}) {
81
- if (!identifier || !texture || !material) {
82
- throw new Error("必须提供 identifier、texture 和 material。");
83
- }
84
-
85
- const attachable = new Attachable(identifier);
86
- attachable.addTexture("default", texture);
87
- attachable.addMaterial("default", material);
88
- registerItem({}, attachable);
89
- return attachable;
90
- },
91
- createChestplateArmor: function (identifier, item_texture, texture_path, options = {}) {
92
- const item = new Chestplate(identifier, item_texture, texture_path, options);
93
- registerItem(item.item, item.attachable);
94
- return item;
95
- },
1
+ import { Boot, Chestplate, Helmet, Leggings } from "../item/armor.js";
2
+ import { Attachable } from "../item/Attachable.js";
3
+ import { Food } from "../item/Food.js";
4
+ import { Item } from "../item/Item.js";
5
+ import { GRegistry } from "../registry.js";
6
+
7
+ const registerItem = (itemData, attachableData) => {
8
+ // 如果 itemData 存在且不为空,则注册
9
+ if (itemData && Object.keys(itemData).length > 0) {
10
+ GRegistry.register(itemData.identifier.replace(":", "_"), "behavior", "items/", itemData);
11
+ }
12
+
13
+ // 如果 attachableData 存在且不为空,则注册
14
+ if (attachableData && Object.keys(attachableData).length > 0) {
15
+ GRegistry.register(attachableData.identifier.replace(":", "_"), "resource", "attachables/", attachableData);
16
+ }
17
+ };
18
+
19
+ // 物品创建的工厂函数
20
+ export const ItemAPI = {
21
+ /**
22
+ * 创建一个普通物品。
23
+ * @param {string} identifier - 物品的唯一标识符。
24
+ * @param {string} category - 物品在创造菜单中的分类(如 "construction", "nature")。
25
+ * @param {string} texture - 物品的纹理。
26
+ * @param {Object} options - 额外选项。
27
+ * @param {string} options.group - 物品的分组。
28
+ * @param {boolean} options.hight_resolution -是否是高分辨率
29
+ * @param {boolean} options.hide_in_command - 是否在命令中隐藏物品。
30
+ * @returns {Item} 创建的物品。
31
+ */
32
+ createItem: function (identifier, category, texture, options = {}) {
33
+ if (!identifier || !category || !texture) {
34
+ throw new Error("必须提供 identifier、category 和 texture。");
35
+ }
36
+
37
+ const item = new Item(identifier, category, texture, options);
38
+ let attachable = {};
39
+ if (options.hide_in_command === true){
40
+ attachable = new Attachable(identifier)
41
+ .addMaterial("default", "entity_alphatest")
42
+ .addMaterial("enchanted", "entity_alphatest_glint")
43
+ .addTexture("default", `textures/items/${texture}`)
44
+ .addTexture("enchanted","textures/misc/enchanted_item_glint")
45
+ .addGeometry("default","geometry.large_item")
46
+ }
47
+ registerItem(item, attachable);
48
+ return item;
49
+ },
50
+
51
+ /**
52
+ * 创建一个食物物品。
53
+ * @param {string} identifier - 食物的唯一标识符。
54
+ * @param {string} category - 食物在创造菜单中的分类。
55
+ * @param {string} texture - 食物的纹理。
56
+ * @param {Object} options - 额外选项。
57
+ * @param {string} options.group - 食物的分组。
58
+ * @param {boolean} options.hide_in_command - 是否在命令中隐藏食物。
59
+ * @param {string} options.animation - 食用时的动画(默认:"eat")。
60
+ * @param {boolean} options.canAlwaysEat - 是否总是可以食用。
61
+ * @param {number} options.nutrition - 食物的营养价值。
62
+ * @param {number} options.saturationModifier - 饱和度修正值。
63
+ * @returns {Food} 创建的食物物品。
64
+ */
65
+ createFood: function (identifier, category, texture, options = {}) {
66
+ if (!identifier || !category || !texture) {
67
+ throw new Error("必须提供 identifier、category 和 texture。");
68
+ }
69
+
70
+ const food = new Food(identifier, category, texture, {
71
+ animation: "eat",
72
+ canAlwaysEat: false,
73
+ nutrition: 0,
74
+ saturationModifier: 1,
75
+ ...options, // 用传入的选项覆盖默认值
76
+ });
77
+
78
+ registerItem(food, {});
79
+ return food;
80
+ },
81
+
82
+ /**
83
+ * 创建一个可附着物品。
84
+ * @param {string} identifier - 可附着物品的唯一标识符。
85
+ * @param {string} texture - 可附着物品的纹理。
86
+ * @param {string} material - 可附着物品的材质。
87
+ * @param {Object} options - 额外选项。
88
+ * @returns {Attachable} 创建的可附着物品。
89
+ */
90
+ createAttachable: function (identifier, texture, material, options = {}) {
91
+ if (!identifier || !texture || !material) {
92
+ throw new Error("必须提供 identifier、texture material。");
93
+ }
94
+
95
+ const attachable = new Attachable(identifier);
96
+ attachable.addTexture("default", texture);
97
+ attachable.addMaterial("default", material);
98
+ registerItem({}, attachable);
99
+ return attachable;
100
+ },
101
+ createChestplateArmor: function (identifier, item_texture, texture_path, options = {}) {
102
+ const item = new Chestplate(identifier, item_texture, texture_path, options);
103
+ registerItem(item.item, item.attachable);
104
+ return item;
105
+ },
106
+ createHelmetArmor: function (identifier, item_texture, texture_path, options = {}) {
107
+ const item = new Helmet(identifier, item_texture, texture_path, options);
108
+ registerItem(item.item, item.attachable);
109
+ return item;
110
+ },
111
+ createBootArmor: function (identifier, item_texture, texture_path, options = {}) {
112
+ const item = new Boot(identifier, item_texture, texture_path, options);
113
+ registerItem(item.item, item.attachable);
114
+ return item;
115
+ },
116
+ createLeggingsArmor: function (identifier, item_texture, texture_path, options = {}) {
117
+ const item = new Leggings(identifier, item_texture, texture_path, options);
118
+ registerItem(item.item, item.attachable);
119
+ return item;
120
+ },
96
121
  };
@@ -1,47 +1,47 @@
1
-
2
- import { RecipeTags } from "../addon/recipe/data.js";
3
- import { AddonRecipeFurnace_1_17 } from "../addon/recipe/recipeFurnace.js";
4
- import { AddonRecipeShaped_1_20 } from "../addon/recipe/recipeShaped.js";
5
- import { AddonRecipeShapeless_1_17 } from "../addon/recipe/recipeShapeless.js";
6
- import { GRegistry } from "../registry.js";
7
-
8
- class RecipeRegistry {
9
- /**
10
- *
11
- * @param {AddonRecipeFurnace_1_17} recipe
12
- */
13
- registerRecipe(recipe) {
14
- GRegistry.register(recipe.getId().replace(":", "_"), "behavior", "recipes/", recipe);
15
- }
16
- registerSimpleFurnace(identifier, output, input) {
17
- return this.registerFurnace(identifier).tags([RecipeTags.Furnace]).input(input).output(output);
18
- }
19
-
20
- registerFurnace(identifier) {
21
- const recipe = new AddonRecipeFurnace_1_17().identifier(identifier);
22
- this.registerRecipe(recipe);
23
- return recipe;
24
- }
25
-
26
- registerSimpleShaped(identifier, output, pattern, key) {
27
- return this.registerShaped(identifier).tags([RecipeTags.CraftingTable]).pattern(pattern).key(key).output(output);
28
- }
29
-
30
- registerShaped(identifier) {
31
- const recipe = new AddonRecipeShaped_1_20().identifier(identifier);
32
- this.registerRecipe(recipe);
33
- return recipe;
34
- }
35
-
36
- registerSimpleShapeless(identifier, output, ingredients) {
37
- return this.registerShapeless(identifier).tags([RecipeTags.CraftingTable]).ingredients(ingredients).output(output);
38
- }
39
-
40
- registerShapeless(identifier) {
41
- const recipe = new AddonRecipeShapeless_1_17().identifier(identifier);
42
- this.registerRecipe(recipe);
43
- return recipe;
44
- }
45
- }
46
-
1
+
2
+ import { RecipeTags } from "../addon/recipe/data.js";
3
+ import { AddonRecipeFurnace_1_17 } from "../addon/recipe/recipeFurnace.js";
4
+ import { AddonRecipeShaped_1_20 } from "../addon/recipe/recipeShaped.js";
5
+ import { AddonRecipeShapeless_1_17 } from "../addon/recipe/recipeShapeless.js";
6
+ import { GRegistry } from "../registry.js";
7
+
8
+ class RecipeRegistry {
9
+ /**
10
+ *
11
+ * @param {AddonRecipeFurnace_1_17} recipe
12
+ */
13
+ registerRecipe(recipe) {
14
+ GRegistry.register(recipe.getId().replace(":", "_"), "behavior", "recipes/", recipe);
15
+ }
16
+ registerSimpleFurnace(identifier, output, input) {
17
+ return this.registerFurnace(identifier).tags([RecipeTags.Furnace]).input(input).output(output);
18
+ }
19
+
20
+ registerFurnace(identifier) {
21
+ const recipe = new AddonRecipeFurnace_1_17().identifier(identifier);
22
+ this.registerRecipe(recipe);
23
+ return recipe;
24
+ }
25
+
26
+ registerSimpleShaped(identifier, output, pattern, key) {
27
+ return this.registerShaped(identifier).tags([RecipeTags.CraftingTable]).pattern(pattern).key(key).output(output);
28
+ }
29
+
30
+ registerShaped(identifier) {
31
+ const recipe = new AddonRecipeShaped_1_20().identifier(identifier);
32
+ this.registerRecipe(recipe);
33
+ return recipe;
34
+ }
35
+
36
+ registerSimpleShapeless(identifier, output, ingredients) {
37
+ return this.registerShapeless(identifier).tags([RecipeTags.CraftingTable]).ingredients(ingredients).output(output);
38
+ }
39
+
40
+ registerShapeless(identifier) {
41
+ const recipe = new AddonRecipeShapeless_1_17().identifier(identifier);
42
+ this.registerRecipe(recipe);
43
+ return recipe;
44
+ }
45
+ }
46
+
47
47
  export const RecipeAPI = new RecipeRegistry();
package/src/core/index.js CHANGED
@@ -11,7 +11,7 @@ import { Image } from "./ui/elements/Image.js";
11
11
  import { Label } from "./ui/elements/Label.js";
12
12
  import { Panel } from "./ui/elements/Panel.js";
13
13
  import { UIElement } from "./ui/elements/UIElement.js";
14
- import { ServerUISystem } from "./ui/registry/ServerUISystem.js";
14
+ import { ServerFormSystem, ServerUISystem } from "./ui/systems/server_form.js";
15
15
  import { UISystem } from "./ui/systems/UISystem.js";
16
16
 
17
17
  export {
@@ -29,6 +29,7 @@ export {
29
29
  UISystem,
30
30
  DataBindingObject,
31
31
  ServerUISystem,
32
+ ServerFormSystem,
32
33
  ItemTextureManager,
33
34
  terrainTextureManager,
34
35
  FlipbookTextures,
@@ -1,97 +1,97 @@
1
- import { ItemComponent } from "./ItemComponents.js";
2
- import { AddonItem, AddonItemDefinition, AddonItemDescription } from "../addon/item/item.js";
3
- import { AddonMenuCategory } from "../addon/menu_category.js";
4
-
5
- export class Item {
6
- /**
7
- * 物品类
8
- * @param {string} identifier 物品唯一标识符
9
- * @param {string} category 菜单栏分类 可选:"construction", "nature", "equipment", "items", and "none"
10
- * @param {string} texture 物品纹理
11
- * @param {Object} options 可选参数
12
- * @param {string} options.group 分组
13
- * @param {boolean} options.hide_in_command 是否在命令中隐藏,默认为 false
14
- */
15
- constructor(identifier, category, texture, options = {}) {
16
- // 参数校验
17
- if (!identifier || typeof identifier !== "string") {
18
- throw new Error("identifier is required and must be a string");
19
- }
20
- if (!category || typeof category !== "string") {
21
- throw new Error("category is required and must be a string");
22
- }
23
- if (!texture || typeof texture !== "string") {
24
- throw new Error("texture is required and must be a string");
25
- }
26
-
27
- const {
28
- group,
29
- hide_in_command = false,
30
- max_stack_size = 64,
31
- } = options;
32
-
33
- this.identifier = identifier;
34
- this.category = category;
35
- this.texture = texture;
36
- this.group = group;
37
- this.hide_in_command = hide_in_command;
38
- this.components = new Map();
39
-
40
- // 初始化默认组件
41
- this.addComponent(
42
- ItemComponent.combineComponents(
43
- ItemComponent.setIcon(this.texture),
44
- ItemComponent.setMaxStackSize(max_stack_size)
45
- )
46
- );
47
- }
48
-
49
-
50
- /**
51
- * 添加组件
52
- * @param {Map} componentMap 组件 Map
53
- */
54
- addComponent(componentMap) {
55
- if (!componentMap || !(componentMap instanceof Map)) {
56
- throw new Error("componentMap is required and must be a Map");
57
- }
58
- for (const [key, value] of componentMap.entries()) {
59
- this.components.set(key, value);
60
- }
61
- return this;
62
- }
63
-
64
- /**
65
- * 移除组件
66
- * @param {string} key 组件名称
67
- */
68
- removeComponent(key) {
69
- if (!key || typeof key !== "string") {
70
- throw new Error("key is required and must be a string");
71
- }
72
- this.components.delete(key);
73
- return this;
74
- }
75
-
76
- /**
77
- * 将物品转换为 JSON 格式
78
- * @returns {Object} JSON 格式的物品对象
79
- */
80
- toJson() {
81
- const item = new AddonItem(
82
- "1.21.40", // 格式版本
83
- new AddonItemDefinition(
84
- new AddonItemDescription(
85
- this.identifier,
86
- new AddonMenuCategory(
87
- this.category,
88
- this.group,
89
- this.hide_in_command
90
- )
91
- ),
92
- Object.fromEntries(this.components) // 将 Map 转换为普通对象
93
- )
94
- );
95
- return item.toJson();
96
- }
1
+ import { ItemComponent } from "./ItemComponents.js";
2
+ import { AddonItem, AddonItemDefinition, AddonItemDescription } from "../addon/item/item.js";
3
+ import { AddonMenuCategory } from "../addon/menu_category.js";
4
+
5
+ export class Item {
6
+ /**
7
+ * 物品类
8
+ * @param {string} identifier 物品唯一标识符
9
+ * @param {string} category 菜单栏分类 可选:"construction", "nature", "equipment", "items", and "none"
10
+ * @param {string} texture 物品纹理
11
+ * @param {Object} options 可选参数
12
+ * @param {string} options.group 分组
13
+ * @param {boolean} options.hide_in_command 是否在命令中隐藏,默认为 false
14
+ */
15
+ constructor(identifier, category, texture, options = {}) {
16
+ // 参数校验
17
+ if (!identifier || typeof identifier !== "string") {
18
+ throw new Error("identifier is required and must be a string");
19
+ }
20
+ if (!category || typeof category !== "string") {
21
+ throw new Error("category is required and must be a string");
22
+ }
23
+ if (!texture || typeof texture !== "string") {
24
+ throw new Error("texture is required and must be a string");
25
+ }
26
+
27
+ const {
28
+ group,
29
+ hide_in_command = false,
30
+ max_stack_size = 64,
31
+ } = options;
32
+
33
+ this.identifier = identifier;
34
+ this.category = category;
35
+ this.texture = texture;
36
+ this.group = group;
37
+ this.hide_in_command = hide_in_command;
38
+ this.components = new Map();
39
+
40
+ // 初始化默认组件
41
+ this.addComponent(
42
+ ItemComponent.combineComponents(
43
+ ItemComponent.setIcon(this.texture),
44
+ ItemComponent.setMaxStackSize(max_stack_size)
45
+ )
46
+ );
47
+ }
48
+
49
+
50
+ /**
51
+ * 添加组件
52
+ * @param {Map} componentMap 组件 Map
53
+ */
54
+ addComponent(componentMap) {
55
+ if (!componentMap || !(componentMap instanceof Map)) {
56
+ throw new Error("componentMap is required and must be a Map");
57
+ }
58
+ for (const [key, value] of componentMap.entries()) {
59
+ this.components.set(key, value);
60
+ }
61
+ return this;
62
+ }
63
+
64
+ /**
65
+ * 移除组件
66
+ * @param {string} key 组件名称
67
+ */
68
+ removeComponent(key) {
69
+ if (!key || typeof key !== "string") {
70
+ throw new Error("key is required and must be a string");
71
+ }
72
+ this.components.delete(key);
73
+ return this;
74
+ }
75
+
76
+ /**
77
+ * 将物品转换为 JSON 格式
78
+ * @returns {Object} JSON 格式的物品对象
79
+ */
80
+ toJson() {
81
+ const item = new AddonItem(
82
+ "1.21.40", // 格式版本
83
+ new AddonItemDefinition(
84
+ new AddonItemDescription(
85
+ this.identifier,
86
+ new AddonMenuCategory(
87
+ this.category,
88
+ this.group,
89
+ this.hide_in_command
90
+ )
91
+ ),
92
+ Object.fromEntries(this.components) // 将 Map 转换为普通对象
93
+ )
94
+ );
95
+ return item.toJson();
96
+ }
97
97
  }