@minecraft/creator-tools 0.8.0 → 0.9.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 (426) hide show
  1. package/NOTICE.md +22 -0
  2. package/app/Carto.js +20 -8
  3. package/app/IProjectItemData.js +4 -2
  4. package/app/LookupUtilities.js +223 -0
  5. package/app/Project.js +96 -34
  6. package/app/ProjectExporter.js +1 -1
  7. package/app/ProjectIntegrator.js +1 -1
  8. package/app/ProjectItem.js +4 -1
  9. package/app/ProjectItemRelations.js +20 -0
  10. package/app/ProjectItemUtilities.js +203 -1
  11. package/app/ProjectLookupUtilities.js +152 -0
  12. package/app/ProjectUtilities.js +73 -15
  13. package/cli/ClUtils.js +1 -1
  14. package/cli/IProjectStartInfo.js +0 -1
  15. package/cli/ISearchResultSet.js +4 -0
  16. package/cli/ITask.js +0 -1
  17. package/cli/TaskWorker.js +0 -1
  18. package/core/Constants.js +1 -1
  19. package/core/ContentIndex.js +92 -44
  20. package/core/StandardInit.js +14 -14
  21. package/core/Utilities.js +60 -1
  22. package/data/forms/biome/biome_description.form.json +12 -0
  23. package/data/forms/biome/biome_json_file.form.json +688 -0
  24. package/data/forms/biome/index.json +1 -0
  25. package/data/forms/biome/minecraft_capped_surface.form.json +52 -0
  26. package/data/forms/biome/minecraft_climate.form.json +49 -0
  27. package/data/forms/biome/minecraft_creature_spawn_probability.form.json +13 -0
  28. package/data/forms/biome/minecraft_frozen_ocean_surface.form.json +68 -0
  29. package/data/forms/biome/minecraft_mesa_surface.form.json +102 -0
  30. package/data/forms/biome/minecraft_mountain_parameters.form.json +54 -0
  31. package/data/forms/biome/minecraft_multinoise_generation_rules.form.json +37 -0
  32. package/data/forms/biome/minecraft_overworld_generation_rules.form.json +42 -0
  33. package/data/forms/biome/minecraft_overworld_height.form.json +19 -0
  34. package/data/forms/biome/minecraft_surface_material_adjustments.form.json +68 -0
  35. package/data/forms/biome/minecraft_surface_parameters.form.json +68 -0
  36. package/data/forms/biome/minecraft_swamp_surface.form.json +68 -0
  37. package/data/forms/biome/minecraft_tags.form.json +13 -0
  38. package/data/forms/biome/minecraft_the_end_surface.form.json +6 -0
  39. package/data/forms/block/block_resource_nonvisual.form.json +13 -0
  40. package/data/forms/block/block_resource_visual.form.json +26 -0
  41. package/data/forms/block/block_specifier.form.json +3 -3
  42. package/data/forms/block/blockstate_boolean.form.json +2 -2
  43. package/data/forms/block/blockstate_number.form.json +3 -3
  44. package/data/forms/block/blockstate_string.form.json +3 -3
  45. package/data/forms/block/index.json +1 -1
  46. package/data/forms/block/materialinstanceface.form.json +4 -2
  47. package/data/forms/block/minecraft_bone_visibility.form.json +3 -0
  48. package/data/forms/block/minecraft_breathability.form.json +18 -6
  49. package/data/forms/block/minecraft_collision_box.form.json +8 -5
  50. package/data/forms/block/minecraft_destructible_by_explosion.form.json +8 -5
  51. package/data/forms/block/minecraft_destructible_by_mining.form.json +58 -10
  52. package/data/forms/block/minecraft_destruction_particles.form.json +43 -8
  53. package/data/forms/block/minecraft_display_name.form.json +4 -4
  54. package/data/forms/block/minecraft_flammable.form.json +8 -5
  55. package/data/forms/block/minecraft_friction.form.json +5 -5
  56. package/data/forms/block/minecraft_geometry.form.json +3 -0
  57. package/data/forms/block/minecraft_item_visual.form.json +3 -0
  58. package/data/forms/block/minecraft_light_dampening.form.json +4 -4
  59. package/data/forms/block/minecraft_light_emission.form.json +4 -4
  60. package/data/forms/block/minecraft_loot.form.json +5 -5
  61. package/data/forms/block/minecraft_map_color.form.json +3 -0
  62. package/data/forms/block/minecraft_material_instances.form.json +4 -1
  63. package/data/forms/block/minecraft_selection_box.form.json +8 -5
  64. package/data/forms/block/minecraft_transformation.form.json +3 -0
  65. package/data/forms/block/minecraft_unit_cube.form.json +3 -0
  66. package/data/forms/block/struct_sharedtypes_v1_20_60_blockculling.form.json +48 -0
  67. package/data/forms/block/trait_placement_direction.form.json +25 -2
  68. package/data/forms/block/trait_placement_position.form.json +19 -1
  69. package/data/forms/cameras/index.json +1 -0
  70. package/data/forms/cameras/struct_sharedtypes_v1_21_70_camerapresetfile.form.json +18 -0
  71. package/data/forms/clientbiome/client_biome_description.form.json +12 -0
  72. package/data/forms/clientbiome/client_biome_json_file.form.json +198 -0
  73. package/data/forms/clientbiome/index.json +1 -0
  74. package/data/forms/clientbiome/minecraft_ambient_sounds.form.json +25 -0
  75. package/data/forms/clientbiome/minecraft_biome_music.form.json +13 -0
  76. package/data/forms/clientbiome/minecraft_fog_appearance.form.json +13 -0
  77. package/data/forms/clientbiome/minecraft_foliage_appearance.form.json +21 -0
  78. package/data/forms/clientbiome/minecraft_grass_appearance.form.json +13 -0
  79. package/data/forms/clientbiome/minecraft_sky_color.form.json +21 -0
  80. package/data/forms/clientbiome/minecraft_water_appearance.form.json +27 -0
  81. package/data/forms/config/commands.form.json +18 -0
  82. package/data/forms/config/index.json +1 -0
  83. package/data/forms/entity/minecraft_anger_level.form.json +41 -40
  84. package/data/forms/entity/minecraft_attack_cooldown.form.json +0 -1
  85. package/data/forms/entity/minecraft_barter.form.json +0 -1
  86. package/data/forms/entity/minecraft_behavior_avoid_block.form.json +1 -1
  87. package/data/forms/entity/minecraft_behavior_avoid_mob_type.form.json +11 -16
  88. package/data/forms/entity/minecraft_behavior_defend_village_target.form.json +64 -58
  89. package/data/forms/entity/minecraft_behavior_delayed_attack.form.json +6 -19
  90. package/data/forms/entity/minecraft_behavior_dig.form.json +1 -0
  91. package/data/forms/entity/minecraft_behavior_dragonflaming.form.json +1 -1
  92. package/data/forms/entity/minecraft_behavior_emerge.form.json +2 -2
  93. package/data/forms/entity/minecraft_behavior_float_wander.form.json +35 -0
  94. package/data/forms/entity/minecraft_behavior_follow_mob.form.json +19 -0
  95. package/data/forms/entity/minecraft_behavior_go_and_give_items_to_noteblock.form.json +1 -1
  96. package/data/forms/entity/minecraft_behavior_go_and_give_items_to_owner.form.json +1 -1
  97. package/data/forms/entity/minecraft_behavior_go_home.form.json +2 -2
  98. package/data/forms/entity/minecraft_behavior_melee_attack.form.json +6 -19
  99. package/data/forms/entity/minecraft_behavior_melee_box_attack.form.json +17 -35
  100. package/data/forms/entity/minecraft_behavior_move_around_target.form.json +12 -17
  101. package/data/forms/entity/minecraft_behavior_nearest_attackable_target.form.json +1959 -180
  102. package/data/forms/entity/minecraft_behavior_play.form.json +1 -1
  103. package/data/forms/entity/minecraft_behavior_play_dead.form.json +1 -1
  104. package/data/forms/entity/minecraft_behavior_ram_attack.form.json +3 -3
  105. package/data/forms/entity/minecraft_behavior_random_search_and_dig.form.json +3 -3
  106. package/data/forms/entity/minecraft_behavior_sneeze.form.json +19 -18
  107. package/data/forms/entity/minecraft_behavior_stomp_attack.form.json +6 -19
  108. package/data/forms/entity/minecraft_behavior_swim_with_entity.form.json +1 -1
  109. package/data/forms/entity/minecraft_breathable.form.json +5 -4
  110. package/data/forms/entity/minecraft_dweller.form.json +20 -0
  111. package/data/forms/entity/minecraft_environment_sensor.form.json +12 -0
  112. package/data/forms/entity/minecraft_is_baby.form.json +60 -2
  113. package/data/forms/entity/minecraft_leashable.form.json +0 -3
  114. package/data/forms/entity/minecraft_movement.form.json +111 -0
  115. package/data/forms/entity/minecraft_navigation_walk.form.json +4 -2
  116. package/data/forms/entity/minecraft_rideable.form.json +19 -0
  117. package/data/forms/entity/minecraft_shooter.form.json +27 -26
  118. package/data/forms/entity/minecraft_type_family.form.json +40 -4
  119. package/data/forms/entityevents/emit_vibration.form.json +1 -0
  120. package/data/forms/entityfilters/actor_health.form.json +65 -6
  121. package/data/forms/entityfilters/all_slots_empty.form.json +1 -0
  122. package/data/forms/entityfilters/any_slot_empty.form.json +1 -0
  123. package/data/forms/entityfilters/bool_property.form.json +63 -10
  124. package/data/forms/entityfilters/clock_time.form.json +1 -0
  125. package/data/forms/entityfilters/enum_property.form.json +362 -37
  126. package/data/forms/entityfilters/has_biome_tag.form.json +564 -90
  127. package/data/forms/entityfilters/has_component.form.json +454 -63
  128. package/data/forms/entityfilters/has_equipment.form.json +104 -7
  129. package/data/forms/entityfilters/has_nametag.form.json +57 -10
  130. package/data/forms/entityfilters/has_ranged_weapon.form.json +124 -14
  131. package/data/forms/entityfilters/in_block.form.json +84 -7
  132. package/data/forms/entityfilters/in_caravan.form.json +31 -3
  133. package/data/forms/entityfilters/in_contact_with_water.form.json +67 -6
  134. package/data/forms/entityfilters/in_lava.form.json +569 -92
  135. package/data/forms/entityfilters/in_nether.form.json +94 -9
  136. package/data/forms/entityfilters/in_water.form.json +113 -11
  137. package/data/forms/entityfilters/in_water_or_rain.form.json +59 -4
  138. package/data/forms/entityfilters/int_property.form.json +78 -6
  139. package/data/forms/entityfilters/is_biome.form.json +70 -6
  140. package/data/forms/entityfilters/is_block.form.json +122 -10
  141. package/data/forms/entityfilters/is_brightness.form.json +73 -6
  142. package/data/forms/entityfilters/is_daytime.form.json +70 -11
  143. package/data/forms/entityfilters/is_difficulty.form.json +128 -17
  144. package/data/forms/entityfilters/is_family.form.json +2381 -341
  145. package/data/forms/entityfilters/is_game_rule.form.json +27 -2
  146. package/data/forms/entityfilters/is_mark_variant.form.json +145 -14
  147. package/data/forms/entityfilters/is_riding.form.json +101 -8
  148. package/data/forms/entityfilters/is_skin_id.form.json +137 -14
  149. package/data/forms/entityfilters/is_snow_covered.form.json +48 -5
  150. package/data/forms/entityfilters/is_underground.form.json +26 -2
  151. package/data/forms/entityfilters/is_underwater.form.json +139 -17
  152. package/data/forms/entityfilters/is_variant.form.json +110 -9
  153. package/data/forms/entityfilters/weather_at_position.form.json +76 -8
  154. package/data/forms/index.json +1 -1
  155. package/data/forms/item/index.json +1 -1
  156. package/data/forms/item/minecraft_allow_off_hand.form.json +1 -0
  157. package/data/forms/item/minecraft_block_placer.form.json +2 -1
  158. package/data/forms/item/minecraft_bundle_interaction.form.json +2 -1
  159. package/data/forms/item/minecraft_can_destroy_in_creative.form.json +1 -0
  160. package/data/forms/item/minecraft_chargeable.form.json +4 -4
  161. package/data/forms/item/minecraft_compostable.form.json +2 -1
  162. package/data/forms/item/minecraft_cooldown.form.json +2 -1
  163. package/data/forms/item/minecraft_custom_components.form.json +6 -0
  164. package/data/forms/item/minecraft_damage.form.json +1 -0
  165. package/data/forms/item/minecraft_damage_absorption.form.json +2 -1
  166. package/data/forms/item/minecraft_digger.form.json +2 -1
  167. package/data/forms/item/minecraft_display_name.form.json +2 -1
  168. package/data/forms/item/minecraft_durability.form.json +2 -1
  169. package/data/forms/item/minecraft_durability_sensor.form.json +9 -2
  170. package/data/forms/item/minecraft_dyeable.form.json +2 -1
  171. package/data/forms/item/minecraft_enchantable.form.json +2 -1
  172. package/data/forms/item/minecraft_entity_placer.form.json +2 -1
  173. package/data/forms/item/minecraft_food.form.json +2 -1
  174. package/data/forms/item/minecraft_fuel.form.json +1 -0
  175. package/data/forms/item/minecraft_glint.form.json +1 -0
  176. package/data/forms/item/minecraft_hand_equipped.form.json +1 -0
  177. package/data/forms/item/minecraft_hover_text_color.form.json +1 -0
  178. package/data/forms/item/minecraft_icon.form.json +1 -0
  179. package/data/forms/item/minecraft_interact_button.form.json +3 -1
  180. package/data/forms/item/minecraft_item.form.json +2 -14
  181. package/data/forms/item/minecraft_liquid_clipped.form.json +1 -0
  182. package/data/forms/item/minecraft_max_stack_size.form.json +1 -0
  183. package/data/forms/item/minecraft_on_use.form.json +1 -0
  184. package/data/forms/item/minecraft_on_use_on.form.json +1 -0
  185. package/data/forms/item/minecraft_projectile.form.json +2 -1
  186. package/data/forms/item/minecraft_rarity.form.json +16 -1
  187. package/data/forms/item/minecraft_record.form.json +2 -1
  188. package/data/forms/item/minecraft_repairable.form.json +2 -1
  189. package/data/forms/item/minecraft_shooter.form.json +2 -1
  190. package/data/forms/item/minecraft_should_despawn.form.json +1 -0
  191. package/data/forms/item/minecraft_stacked_by_data.form.json +1 -0
  192. package/data/forms/item/minecraft_storage_item.form.json +2 -1
  193. package/data/forms/item/minecraft_storage_weight_limit.form.json +13 -0
  194. package/data/forms/item/minecraft_storage_weight_modifier.form.json +13 -0
  195. package/data/forms/item/minecraft_tags.form.json +2 -1
  196. package/data/forms/item/minecraft_throwable.form.json +2 -1
  197. package/data/forms/item/minecraft_use_animation.form.json +1 -0
  198. package/data/forms/item/minecraft_use_duration.form.json +1 -0
  199. package/data/forms/item/minecraft_use_modifiers.form.json +2 -1
  200. package/data/forms/item/minecraft_wearable.form.json +2 -1
  201. package/data/forms/mctoolsval/caddonreq.form.json +579 -0
  202. package/data/forms/mctoolsval/index.json +1 -0
  203. package/data/forms/misc/crafting_catalog_category.form.json +18 -0
  204. package/data/forms/misc/crafting_catalog_document.form.json +12 -0
  205. package/data/forms/misc/dimensiondocument.form.json +12 -0
  206. package/data/forms/misc/emitter_initialization.form.json +28 -0
  207. package/data/forms/misc/emitter_lifetime_expression.form.json +28 -0
  208. package/data/forms/misc/emitter_lifetime_looping.form.json +28 -0
  209. package/data/forms/misc/emitter_lifetime_once.form.json +17 -0
  210. package/data/forms/misc/emitter_rate_instant.form.json +17 -0
  211. package/data/forms/misc/emitter_rate_manual.form.json +17 -0
  212. package/data/forms/misc/emitter_rate_steady.form.json +28 -0
  213. package/data/forms/misc/emitter_shape_box.form.json +35 -0
  214. package/data/forms/misc/emitter_shape_custom.form.json +18 -0
  215. package/data/forms/misc/emitter_shape_disc.form.json +51 -0
  216. package/data/forms/misc/emitter_shape_entity_aabb.form.json +23 -0
  217. package/data/forms/misc/emitter_shape_point.form.json +18 -0
  218. package/data/forms/misc/emitter_shape_sphere.form.json +40 -0
  219. package/data/forms/misc/index.json +1 -1
  220. package/data/forms/misc/minecraft_aim_assist_categories.form.json +18 -0
  221. package/data/forms/misc/minecraft_aim_assist_preset.form.json +18 -0
  222. package/data/forms/misc/minecraft_jigsaw_structure_metadata.form.json +18 -0
  223. package/data/forms/misc/particle_appearance_billboard.form.json +143 -0
  224. package/data/forms/misc/particle_appearance_billboard_flipbook_data_1.21.0.form.json +53 -0
  225. package/data/forms/misc/particle_appearance_tinting.form.json +17 -0
  226. package/data/forms/misc/particle_curve_bezier_chain.form.json +29 -0
  227. package/data/forms/misc/particle_curve_linear.form.json +40 -0
  228. package/data/forms/misc/particle_effect.form.json +1073 -0
  229. package/data/forms/misc/particle_effect_basic_render_parameters.form.json +18 -0
  230. package/data/forms/misc/particle_effect_component.form.json +1007 -0
  231. package/data/forms/spawn/index.json +1 -1
  232. package/data/forms/spawn/struct_sharedtypes_v1_21_60_spawn_contents.form.json +24 -0
  233. package/data/forms/world/feature_rule_definition.form.json +91 -0
  234. package/data/forms/world/index.json +1 -1
  235. package/data/forms/world/scatter_params.form.json +67 -0
  236. package/data/gallery.json +42 -2
  237. package/data/mci/release.mci.json +1 -1
  238. package/data/snippets/index.json +1 -0
  239. package/data/snippets/new-templates.json +25 -0
  240. package/dataform/DataFormUtilities.js +3 -3
  241. package/dataform/FieldUtilities.js +13 -0
  242. package/dataform/IField.js +7 -1
  243. package/dataform/ILookupProvider.js +4 -0
  244. package/docgen/FormJsonDocumentationGenerator.js +302 -279
  245. package/docgen/FormMarkdownDocumentationGenerator.js +140 -3
  246. package/docgen/JsonSchemaGenerator.js +121 -0
  247. package/info/CooperativeAddOnItemRequirementsGenerator.js +18 -17
  248. package/info/CooperativeAddOnRequirementsGenerator.js +21 -17
  249. package/info/GeneratorRegistrations.js +22 -9
  250. package/info/IInfoItemData.js +1 -0
  251. package/info/JsonFileTagsInfoGenerator.js +35 -30
  252. package/info/LineSizeInfoGenerator.js +1 -0
  253. package/info/PackInfoGenerator.js +3 -2
  254. package/info/PackSizeInfoGenerator.js +1 -0
  255. package/info/PathLengthFileGenerator.js +5 -4
  256. package/info/ProjectInfoSet.js +57 -10
  257. package/info/SchemaItemInfoGenerator.js +1 -0
  258. package/info/StrictPlatformInfoGenerator.js +4 -3
  259. package/info/TextureImageInfoGenerator.js +148 -27
  260. package/info/TextureInfoGenerator.js +43 -27
  261. package/info/TextureReferenceInfoGenerator.js +80 -0
  262. package/info/TypesInfoGenerator.js +71 -0
  263. package/info/UnknownFileGenerator.js +2 -1
  264. package/info/UnknownItemGenerator.js +2 -1
  265. package/info/UnlinkedItemInfoGenerator.js +30 -56
  266. package/info/ValidFileGenerator.js +47 -0
  267. package/info/WorldDataInfoGenerator.js +2 -2
  268. package/integrations/BlockbenchModel.js +86 -51
  269. package/local/NodeFile.js +8 -0
  270. package/manager/BaseGameVersionManager.js +1 -17
  271. package/manager/BlocksCatalogManager.js +102 -0
  272. package/manager/{BehaviorPackEntityTypeManager.js → EntityTypeManager.js} +38 -76
  273. package/manager/FormatVersionManager.js +23 -40
  274. package/manager/{BehaviorPackItemTypeManager.js → ItemTypeManager.js} +45 -80
  275. package/manager/MinEngineVersionManager.js +4 -11
  276. package/manager/ScriptModuleManager.js +0 -12
  277. package/maps/app/Carto.js.map +1 -1
  278. package/maps/app/IGalleryItem.js.map +1 -1
  279. package/maps/app/IProjectData.js.map +1 -1
  280. package/maps/app/IProjectItemData.js.map +1 -1
  281. package/maps/app/IProjectSeed.js.map +1 -1
  282. package/maps/app/LookupUtilities.js.map +1 -0
  283. package/maps/app/Project.js.map +1 -1
  284. package/maps/app/ProjectExporter.js.map +1 -1
  285. package/maps/app/ProjectIntegrator.js.map +1 -1
  286. package/maps/app/ProjectItem.js.map +1 -1
  287. package/maps/app/ProjectItemRelations.js.map +1 -1
  288. package/maps/app/ProjectItemUtilities.js.map +1 -1
  289. package/maps/app/ProjectLookupUtilities.js.map +1 -0
  290. package/maps/app/ProjectUtilities.js.map +1 -1
  291. package/maps/cli/ClUtils.js.map +1 -1
  292. package/maps/cli/ISearchResultSet.js.map +1 -0
  293. package/maps/core/Constants.js.map +1 -1
  294. package/maps/core/ContentIndex.js.map +1 -1
  295. package/maps/core/ISimpleReference.js.map +1 -1
  296. package/maps/core/StandardInit.js.map +1 -1
  297. package/maps/core/Utilities.js.map +1 -1
  298. package/maps/dataform/DataFormUtilities.js.map +1 -1
  299. package/maps/dataform/FieldUtilities.js.map +1 -1
  300. package/maps/dataform/IField.js.map +1 -1
  301. package/maps/dataform/IFormDefinition.js.map +1 -1
  302. package/maps/dataform/IGetSetPropertyObject.js.map +1 -1
  303. package/maps/dataform/ILookupProvider.js.map +1 -0
  304. package/maps/docgen/FormJsonDocumentationGenerator.js.map +1 -1
  305. package/maps/docgen/FormMarkdownDocumentationGenerator.js.map +1 -1
  306. package/maps/docgen/JsonSchemaGenerator.js.map +1 -0
  307. package/maps/info/CooperativeAddOnItemRequirementsGenerator.js.map +1 -1
  308. package/maps/info/CooperativeAddOnRequirementsGenerator.js.map +1 -1
  309. package/maps/info/GeneratorRegistrations.js.map +1 -1
  310. package/maps/info/IInfoItemData.js.map +1 -1
  311. package/maps/info/IProjectInfo.js.map +1 -1
  312. package/maps/info/IProjectInfoGeneratorBase.js.map +1 -1
  313. package/maps/info/JsonFileTagsInfoGenerator.js.map +1 -1
  314. package/maps/info/LineSizeInfoGenerator.js.map +1 -1
  315. package/maps/info/PackInfoGenerator.js.map +1 -1
  316. package/maps/info/PackSizeInfoGenerator.js.map +1 -1
  317. package/maps/info/PathLengthFileGenerator.js.map +1 -1
  318. package/maps/info/ProjectInfoItem.js.map +1 -1
  319. package/maps/info/ProjectInfoSet.js.map +1 -1
  320. package/maps/info/SchemaItemInfoGenerator.js.map +1 -1
  321. package/maps/info/StrictPlatformInfoGenerator.js.map +1 -1
  322. package/maps/info/TextureImageInfoGenerator.js.map +1 -1
  323. package/maps/info/TextureInfoGenerator.js.map +1 -1
  324. package/maps/info/TextureReferenceInfoGenerator.js.map +1 -0
  325. package/maps/info/TypesInfoGenerator.js.map +1 -0
  326. package/maps/info/UnknownFileGenerator.js.map +1 -1
  327. package/maps/info/UnknownItemGenerator.js.map +1 -1
  328. package/maps/info/UnlinkedItemInfoGenerator.js.map +1 -1
  329. package/maps/info/ValidFileGenerator.js.map +1 -0
  330. package/maps/info/WorldDataInfoGenerator.js.map +1 -1
  331. package/maps/integrations/BlockbenchModel.js.map +1 -1
  332. package/maps/local/NodeFile.js.map +1 -1
  333. package/maps/manager/BaseGameVersionManager.js.map +1 -1
  334. package/maps/manager/BlocksCatalogManager.js.map +1 -0
  335. package/maps/manager/EntityTypeManager.js.map +1 -0
  336. package/maps/manager/FormatVersionManager.js.map +1 -1
  337. package/maps/manager/ItemTypeManager.js.map +1 -0
  338. package/maps/manager/MinEngineVersionManager.js.map +1 -1
  339. package/maps/manager/ScriptModuleManager.js.map +1 -1
  340. package/maps/minecraft/AttachableResourceDefinition.js.map +1 -1
  341. package/maps/minecraft/AudioDefinition.js.map +1 -0
  342. package/maps/minecraft/BlockType.js.map +1 -1
  343. package/maps/minecraft/BlockTypeDefinition.js.map +1 -1
  344. package/maps/minecraft/BlocksCatalogDefinition.js.map +1 -1
  345. package/maps/minecraft/ComponentizedBase.js.map +1 -1
  346. package/maps/minecraft/Database.js.map +1 -1
  347. package/maps/minecraft/EntityTypeDefinition.js.map +1 -1
  348. package/maps/minecraft/EntityTypeResourceDefinition.js.map +1 -1
  349. package/maps/minecraft/FlipbookTextureCatalogDefinition.js.map +1 -1
  350. package/maps/minecraft/IBlockTypeBehaviorPack.js.map +1 -1
  351. package/maps/minecraft/IBlockTypeDescription.js.map +1 -1
  352. package/maps/minecraft/IBlocksCatalog.js.map +1 -1
  353. package/maps/minecraft/IComponentDataItem.js.map +1 -1
  354. package/maps/minecraft/IComponentGroup.js.map +1 -1
  355. package/maps/minecraft/IEntitiesMetadata.js.map +1 -0
  356. package/maps/minecraft/IItemTypeBehaviorPack.js.map +1 -1
  357. package/maps/minecraft/IItemTypeResourcePack.js.map +1 -0
  358. package/maps/minecraft/IItemsMetadata.js.map +1 -0
  359. package/maps/minecraft/IJsonUIScreen.js.map +1 -1
  360. package/maps/minecraft/IManagedComponent.js.map +1 -1
  361. package/maps/minecraft/IManagedComponentSetItem.js.map +1 -1
  362. package/maps/minecraft/IMolangExpression.js.map +1 -0
  363. package/maps/minecraft/IMolangNode.js.map +1 -0
  364. package/maps/minecraft/ItemTextureCatalogDefinition.js.map +1 -1
  365. package/maps/minecraft/ItemTypeBehaviorDefinition.js.map +1 -1
  366. package/maps/minecraft/ItemTypeResourceDefinition.js.map +1 -0
  367. package/maps/minecraft/JsonUIResourceDefinition.js.map +1 -1
  368. package/maps/minecraft/MCWorld.js.map +1 -1
  369. package/maps/minecraft/ManagedComponent.js.map +1 -1
  370. package/maps/minecraft/ManagedComponentGroup.js.map +1 -1
  371. package/maps/minecraft/ManagedPermutation.js.map +1 -0
  372. package/maps/minecraft/MinecraftDefinitions.js.map +1 -1
  373. package/maps/minecraft/MinecraftUtilities.js.map +1 -1
  374. package/maps/minecraft/MusicDefinitionCatalogDefinition.js.map +1 -1
  375. package/maps/minecraft/ParticleEffectResourceDefinition.js.map +1 -1
  376. package/maps/minecraft/SoundCatalogDefinition.js.map +1 -1
  377. package/maps/minecraft/SoundDefinitionCatalogDefinition.js.map +1 -1
  378. package/maps/minecraft/TerrainTextureCatalogDefinition.js.map +1 -1
  379. package/maps/minecraft/TextureDefinition.js.map +1 -0
  380. package/maps/minecraft/TypeScriptDefinition.js.map +1 -0
  381. package/maps/storage/BrowserFile.js.map +1 -1
  382. package/maps/storage/FileBase.js.map +1 -1
  383. package/maps/storage/FileSystemFolder.js.map +1 -1
  384. package/maps/storage/IFile.js.map +1 -1
  385. package/maps/storage/StorageUtilities.js.map +1 -1
  386. package/maps/updates/ProjectUpdateRunner.js.map +1 -1
  387. package/minecraft/AttachableResourceDefinition.js +9 -12
  388. package/minecraft/{AudioFileDefinition.js → AudioDefinition.js} +25 -5
  389. package/minecraft/BlockType.js +9 -5
  390. package/minecraft/BlockTypeDefinition.js +434 -13
  391. package/minecraft/BlocksCatalogDefinition.js +92 -1
  392. package/minecraft/ComponentizedBase.js +4 -3
  393. package/minecraft/Database.js +118 -7
  394. package/minecraft/EntityTypeDefinition.js +10 -7
  395. package/minecraft/EntityTypeResourceDefinition.js +9 -12
  396. package/minecraft/FlipbookTextureCatalogDefinition.js +13 -6
  397. package/minecraft/IEntitiesMetadata.js +4 -0
  398. package/minecraft/IItemTypeResourcePack.js +6 -0
  399. package/minecraft/IItemsMetadata.js +4 -0
  400. package/minecraft/IMolangExpression.js +4 -0
  401. package/minecraft/IMolangNode.js +15 -0
  402. package/minecraft/ItemTextureCatalogDefinition.js +47 -11
  403. package/minecraft/ItemTypeBehaviorDefinition.js +7 -4
  404. package/minecraft/ItemTypeResourceDefinition.js +201 -0
  405. package/minecraft/JsonUIResourceDefinition.js +99 -0
  406. package/minecraft/MCWorld.js +9 -2
  407. package/minecraft/ManagedComponent.js +13 -1
  408. package/minecraft/ManagedComponentGroup.js +9 -5
  409. package/minecraft/ManagedPermutation.js +111 -0
  410. package/minecraft/MinecraftDefinitions.js +2 -2
  411. package/minecraft/MinecraftUtilities.js +19 -0
  412. package/minecraft/MusicDefinitionCatalogDefinition.js +1 -1
  413. package/minecraft/ParticleEffectResourceDefinition.js +8 -10
  414. package/minecraft/SoundCatalogDefinition.js +9 -3
  415. package/minecraft/SoundDefinitionCatalogDefinition.js +79 -49
  416. package/minecraft/TerrainTextureCatalogDefinition.js +67 -6
  417. package/minecraft/TextureDefinition.js +109 -0
  418. package/minecraft/TypeScriptDefinition.js +65 -0
  419. package/package.json +2 -1
  420. package/storage/BrowserFile.js +5 -0
  421. package/storage/FileSystemFolder.js +27 -0
  422. package/storage/StorageUtilities.js +21 -3
  423. package/updates/ProjectUpdateRunner.js +3 -18
  424. package/maps/manager/BehaviorPackEntityTypeManager.js.map +0 -1
  425. package/maps/manager/BehaviorPackItemTypeManager.js.map +0 -1
  426. package/maps/minecraft/AudioFileDefinition.js.map +0 -1
package/NOTICE.md CHANGED
@@ -4,6 +4,28 @@ Copyright 2024 Mojang AB
4
4
 
5
5
  This repository incorporates material as listed below or described in the code.
6
6
 
7
+ ### @lunapaint/tga-codec
8
+
9
+ Copyright (c) 2022, Daniel Imms (https://github.com/Tyriar)
10
+
11
+ Permission is hereby granted, free of charge, to any person obtaining a copy
12
+ of this software and associated documentation files (the "Software"), to deal
13
+ in the Software without restriction, including without limitation the rights
14
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15
+ copies of the Software, and to permit persons to whom the Software is
16
+ furnished to do so, subject to the following conditions:
17
+
18
+ The above copyright notice and this permission notice shall be included in
19
+ all copies or substantial portions of the Software.
20
+
21
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
27
+ THE SOFTWARE.
28
+
7
29
  ### waveform-playlist
8
30
 
9
31
  #### MIT License
package/app/Carto.js CHANGED
@@ -961,18 +961,30 @@ class Carto {
961
961
  }
962
962
  return newProjectName;
963
963
  }
964
- async createNewProject(newProjectName, newProjectPath, focus, includeDefaultItems, projectLanguage) {
964
+ async createNewProject(newProjectName, newProjectPath, newProjectFolder, newProjectFolderTitle, focus, includeDefaultItems, projectLanguage) {
965
965
  await this.load();
966
966
  const targetProjectName = await this.getNewProjectName(newProjectName);
967
- const projectPrefs = await this.prefsProjectsFolder.createFile(targetProjectName + ".json");
967
+ let projectPrefs;
968
+ if (newProjectFolder) {
969
+ projectPrefs = await newProjectFolder.ensureFileFromRelativePath("/.mct/prefs.mctp.json");
970
+ }
971
+ else {
972
+ projectPrefs = await this.prefsProjectsFolder.createFile(targetProjectName + ".json");
973
+ }
968
974
  const newProject = new Project_1.default(this, targetProjectName, projectPrefs);
969
- if (newProjectPath) {
975
+ if (newProjectPath && !newProjectFolder) {
970
976
  newProject.mainDeployFolderPath = newProjectPath;
971
977
  }
972
978
  if (projectLanguage) {
973
979
  newProject.preferredScriptLanguage = projectLanguage;
974
980
  }
975
- await newProject.ensureProjectFolder();
981
+ if (newProjectFolder) {
982
+ newProject.setProjectFolder(newProjectFolder);
983
+ newProject.projectFolderTitle = newProjectFolderTitle;
984
+ }
985
+ else {
986
+ await newProject.ensureProjectFolder();
987
+ }
976
988
  newProject.focus = focus;
977
989
  if (includeDefaultItems) {
978
990
  await newProject.ensureDefaultItems();
@@ -1056,7 +1068,7 @@ class Carto {
1056
1068
  const project = this.getProjectByName(desiredProjectName);
1057
1069
  const canonPath = StorageUtilities_1.default.canonicalizePath(messageProjectPath);
1058
1070
  if (project !== undefined) {
1059
- await project.ensureLoadedFromFile();
1071
+ await project.ensurePreferencesAndFolderLoadedFromFile();
1060
1072
  if (project.mainDeployFolderPath !== undefined) {
1061
1073
  if (canonPath === StorageUtilities_1.default.canonicalizePath(project.mainDeployFolderPath)) {
1062
1074
  await project.ensureInflated();
@@ -1104,7 +1116,7 @@ class Carto {
1104
1116
  project = this.getProjectByName(desiredProjectName);
1105
1117
  }
1106
1118
  if (project !== undefined && !openDirect) {
1107
- await project.ensureLoadedFromFile();
1119
+ await project.ensurePreferencesAndFolderLoadedFromFile();
1108
1120
  if (project.mainDeployFolderPath !== undefined) {
1109
1121
  if (canonPath === StorageUtilities_1.default.canonicalizePath(project.mainDeployFolderPath)) {
1110
1122
  await project.ensureInflated();
@@ -1130,7 +1142,7 @@ class Carto {
1130
1142
  // now check all other projects to see if one exists.
1131
1143
  for (let i = 0; i < this.projects.length; i++) {
1132
1144
  project = this.projects[i];
1133
- await project.ensureLoadedFromFile();
1145
+ await project.ensurePreferencesAndFolderLoadedFromFile();
1134
1146
  if (project.mainDeployFolderPath !== undefined) {
1135
1147
  if (canonPath === StorageUtilities_1.default.canonicalizePath(project.mainDeployFolderPath)) {
1136
1148
  await project.ensureInflated();
@@ -1161,7 +1173,7 @@ class Carto {
1161
1173
  await this.load();
1162
1174
  for (let i = 0; i < this.projects.length; i++) {
1163
1175
  const project = this.projects[i];
1164
- await project.ensureLoadedFromFile();
1176
+ await project.ensurePreferencesAndFolderLoadedFromFile();
1165
1177
  await project.ensureProjectFolder();
1166
1178
  if (project.projectFolder) {
1167
1179
  const projectTargetFolder = zipRoot.ensureFolder(project.name);
@@ -3,7 +3,7 @@
3
3
  // Licensed under the MIT License.
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
5
  exports.ProjectItemCreationType = exports.ProjectItemErrorStatus = exports.ProjectItemEditPreference = exports.ProjectItemStorageType = exports.ProjectItemType = exports.ProjectItemCategory = exports.MaxItemTypes = void 0;
6
- exports.MaxItemTypes = 128;
6
+ exports.MaxItemTypes = 129;
7
7
  var ProjectItemCategory;
8
8
  (function (ProjectItemCategory) {
9
9
  ProjectItemCategory[ProjectItemCategory["assets"] = 0] = "assets";
@@ -14,6 +14,7 @@ var ProjectItemCategory;
14
14
  ProjectItemCategory[ProjectItemCategory["meta"] = 5] = "meta";
15
15
  ProjectItemCategory[ProjectItemCategory["package"] = 6] = "package";
16
16
  ProjectItemCategory[ProjectItemCategory["unknown"] = 7] = "unknown";
17
+ ProjectItemCategory[ProjectItemCategory["mctools"] = 8] = "mctools";
17
18
  })(ProjectItemCategory = exports.ProjectItemCategory || (exports.ProjectItemCategory = {}));
18
19
  var ProjectItemType;
19
20
  (function (ProjectItemType) {
@@ -69,7 +70,7 @@ var ProjectItemType;
69
70
  ProjectItemType[ProjectItemType["materialsResourceJson"] = 49] = "materialsResourceJson";
70
71
  ProjectItemType[ProjectItemType["musicDefinitionJson"] = 50] = "musicDefinitionJson";
71
72
  ProjectItemType[ProjectItemType["soundDefinitionCatalog"] = 51] = "soundDefinitionCatalog";
72
- ProjectItemType[ProjectItemType["blockTypeResourceJson"] = 52] = "blockTypeResourceJson";
73
+ ProjectItemType[ProjectItemType["blockTypeResourceJsonDoNotUse"] = 52] = "blockTypeResourceJsonDoNotUse";
73
74
  ProjectItemType[ProjectItemType["MCAddon"] = 53] = "MCAddon";
74
75
  ProjectItemType[ProjectItemType["zip"] = 54] = "zip";
75
76
  ProjectItemType[ProjectItemType["MCPack"] = 55] = "MCPack";
@@ -145,6 +146,7 @@ var ProjectItemType;
145
146
  ProjectItemType[ProjectItemType["personaPackFolder"] = 126] = "personaPackFolder";
146
147
  ProjectItemType[ProjectItemType["blockCulling"] = 127] = "blockCulling";
147
148
  ProjectItemType[ProjectItemType["craftingItemCatalog"] = 128] = "craftingItemCatalog";
149
+ ProjectItemType[ProjectItemType["mcToolsProjectPreferences"] = 129] = "mcToolsProjectPreferences";
148
150
  })(ProjectItemType = exports.ProjectItemType || (exports.ProjectItemType = {}));
149
151
  var ProjectItemStorageType;
150
152
  (function (ProjectItemStorageType) {
@@ -0,0 +1,223 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const Utilities_1 = require("../core/Utilities");
4
+ const Database_1 = require("../minecraft/Database");
5
+ const MinecraftUtilities_1 = require("../minecraft/MinecraftUtilities");
6
+ class LookupUtilities {
7
+ static async getLookup(lookupId) {
8
+ switch (lookupId) {
9
+ case "blockType":
10
+ return await this.getBlockTypeReferences();
11
+ case "entityType":
12
+ return await this.getEntityTypeReferences();
13
+ case "itemType":
14
+ return await this.getItemTypeReferences();
15
+ case "soundDefinition":
16
+ return await this.getSoundDefinitionReferences();
17
+ case "terrainTexture":
18
+ return await this.getTerrainTextureReferences();
19
+ case "entityTypeEvents":
20
+ break;
21
+ case "difficulty":
22
+ break;
23
+ case "damageCause":
24
+ break;
25
+ case "lootTable":
26
+ break;
27
+ case "entityTypePlusVariants":
28
+ break;
29
+ }
30
+ return undefined;
31
+ }
32
+ static async getSoundDefinitionReferences() {
33
+ if (this.soundDefRefs) {
34
+ return this.soundDefRefs;
35
+ }
36
+ const soundData = await Database_1.default.getVanillaSoundDefinitionCatalog();
37
+ const refs = [];
38
+ if (soundData) {
39
+ const soundSets = soundData.getSoundDefinitionSetNameList();
40
+ if (soundSets) {
41
+ for (const soundSet of soundSets) {
42
+ refs.push({
43
+ id: soundSet,
44
+ title: Utilities_1.default.humanifyMinecraftName(soundSet),
45
+ });
46
+ }
47
+ }
48
+ }
49
+ LookupUtilities.sortReferences(refs);
50
+ this.soundDefRefs = refs;
51
+ return this.soundDefRefs;
52
+ }
53
+ static async getItemTextureReferences() {
54
+ if (this.itemTextureRefs) {
55
+ return this.itemTextureRefs;
56
+ }
57
+ const itemData = await Database_1.default.getVanillaItemTexturesCatalog();
58
+ const refs = [];
59
+ if (itemData) {
60
+ const textureRefs = itemData.getTextureReferences();
61
+ if (textureRefs) {
62
+ for (const textureRef of textureRefs) {
63
+ refs.push({
64
+ id: textureRef,
65
+ title: Utilities_1.default.humanifyMinecraftName(textureRef),
66
+ });
67
+ }
68
+ }
69
+ }
70
+ LookupUtilities.sortReferences(refs);
71
+ this.itemTextureRefs = refs;
72
+ return this.itemTextureRefs;
73
+ }
74
+ static async getTerrainTextureReferences() {
75
+ if (this.terrainTextureRefs) {
76
+ return this.terrainTextureRefs;
77
+ }
78
+ const terrainData = await Database_1.default.getVanillaTerrainTexturesCatalog();
79
+ const refs = [];
80
+ if (terrainData) {
81
+ const textureRefs = terrainData.getTextureReferences();
82
+ if (textureRefs) {
83
+ for (const textureRef of textureRefs) {
84
+ refs.push({
85
+ id: textureRef,
86
+ title: Utilities_1.default.humanifyMinecraftName(textureRef),
87
+ });
88
+ }
89
+ }
90
+ }
91
+ LookupUtilities.sortReferences(refs);
92
+ this.terrainTextureRefs = refs;
93
+ return this.terrainTextureRefs;
94
+ }
95
+ static async getBlockTypeReferences() {
96
+ if (this.blockTypeRefs) {
97
+ return this.blockTypeRefs;
98
+ }
99
+ const blockData = await Database_1.default.getBlocksMetadata();
100
+ const refs = [];
101
+ if (blockData && blockData.data_items) {
102
+ for (const dataItem of blockData.data_items) {
103
+ if (dataItem.name && MinecraftUtilities_1.default.isBedrockItem(dataItem.name)) {
104
+ const iconImage = MinecraftUtilities_1.default.getBlockDefaultTexturePath(dataItem.name);
105
+ refs.push({
106
+ id: dataItem.name,
107
+ title: Utilities_1.default.humanifyMinecraftName(dataItem.name),
108
+ iconImage: iconImage ? "/res/latest/van/preview/resource_pack/" + iconImage + ".png" : undefined,
109
+ });
110
+ }
111
+ }
112
+ }
113
+ LookupUtilities.sortReferences(refs);
114
+ this.blockTypeRefs = refs;
115
+ return this.blockTypeRefs;
116
+ }
117
+ static async getEntityTypeReferences() {
118
+ if (this.entityTypeRefs) {
119
+ return this.entityTypeRefs;
120
+ }
121
+ const entitiesData = await Database_1.default.getEntitiesMetadata();
122
+ const refs = [];
123
+ if (entitiesData && entitiesData.data_items) {
124
+ for (const dataItem of entitiesData.data_items) {
125
+ if (dataItem.name && MinecraftUtilities_1.default.isBedrockItem(dataItem.name)) {
126
+ refs.push({
127
+ id: dataItem.name,
128
+ title: Utilities_1.default.humanifyMinecraftName(dataItem.name),
129
+ });
130
+ }
131
+ }
132
+ }
133
+ LookupUtilities.sortReferences(refs);
134
+ LookupUtilities.entityTypeRefs = refs;
135
+ return LookupUtilities.entityTypeRefs;
136
+ }
137
+ static async getItemTypeReferences() {
138
+ if (this.itemTypeRefs) {
139
+ return this.itemTypeRefs;
140
+ }
141
+ const itemsData = await Database_1.default.getItemsMetadata();
142
+ const refs = [];
143
+ if (itemsData && itemsData.data_items) {
144
+ for (const dataItem of itemsData.data_items) {
145
+ if (dataItem.name && MinecraftUtilities_1.default.isBedrockItem(dataItem.name)) {
146
+ refs.push({
147
+ id: dataItem.name,
148
+ title: Utilities_1.default.humanifyMinecraftName(dataItem.name),
149
+ });
150
+ }
151
+ }
152
+ }
153
+ LookupUtilities.sortReferences(refs);
154
+ LookupUtilities.itemTypeRefs = refs;
155
+ return LookupUtilities.itemTypeRefs;
156
+ }
157
+ static appendReferences(core, references) {
158
+ if (references === undefined) {
159
+ return;
160
+ }
161
+ for (const ref of references) {
162
+ let foundRef = false;
163
+ for (const targetRef of core) {
164
+ if (targetRef.id === ref.id) {
165
+ foundRef = true;
166
+ }
167
+ }
168
+ if (!foundRef) {
169
+ core.push(ref);
170
+ }
171
+ }
172
+ }
173
+ static sortReferences(references) {
174
+ references.sort((a, b) => {
175
+ if (a.title && b.title) {
176
+ return a.title.localeCompare(b.title);
177
+ }
178
+ if (a.id && b.id) {
179
+ return a.id.toString().localeCompare(b.id.toString());
180
+ }
181
+ return 0;
182
+ });
183
+ }
184
+ static getReferencesFromAnnotatedValues(paths, annotationCategory, description, startsWithFilter) {
185
+ if (!paths) {
186
+ return undefined;
187
+ }
188
+ let simpleRefs = [];
189
+ for (let path in paths) {
190
+ const val = paths[path];
191
+ if (path && val && (!startsWithFilter || path.startsWith(startsWithFilter))) {
192
+ if (startsWithFilter) {
193
+ path = path.substring(startsWithFilter.length);
194
+ }
195
+ for (const annotatedVal of val) {
196
+ if (annotatedVal.annotation === annotationCategory) {
197
+ simpleRefs.push({
198
+ id: path,
199
+ title: Utilities_1.default.humanifyMinecraftName(path),
200
+ description: description
201
+ ? Utilities_1.default.stringFormat(description, Utilities_1.default.humanifyMinecraftName(path))
202
+ : undefined,
203
+ });
204
+ continue;
205
+ }
206
+ }
207
+ }
208
+ }
209
+ if (simpleRefs && simpleRefs.length === 0) {
210
+ return undefined;
211
+ }
212
+ return simpleRefs;
213
+ }
214
+ }
215
+ exports.default = LookupUtilities;
216
+ LookupUtilities.blockTypeRefs = undefined;
217
+ LookupUtilities.entityTypeRefs = undefined;
218
+ LookupUtilities.itemTypeRefs = undefined;
219
+ LookupUtilities.soundDefRefs = undefined;
220
+ LookupUtilities.terrainTextureRefs = undefined;
221
+ LookupUtilities.itemTextureRefs = undefined;
222
+
223
+ //# sourceMappingURL=../maps/app/LookupUtilities.js.map