From 573c42becc496a50564a93ebc8a3ce491cfc4780 Mon Sep 17 00:00:00 2001 From: SnaveSutit Date: Wed, 7 May 2025 12:31:08 -0400 Subject: [PATCH 1/3] =?UTF-8?q?=F0=9F=A7=AA=20Add=20test=20Data=20Pack=20f?= =?UTF-8?q?or=201.21.4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../1.21.4/blueprints/armor_stand.ajblueprint | 1897 +++++++++++++++++ .../datapacks/animated_java/pack.mcmeta | 6 + .../datapacks/test-framework/mcb.config.js | 8 + .../datapacks/test-framework/pack.mcmeta | 6 + .../datapacks/test-framework/package.json | 3 + .../datapacks/test-framework/src/test.mcb | 9 + test-packs/1.21.4/resources/pack.mcmeta | 6 + 7 files changed, 1935 insertions(+) create mode 100644 test-packs/1.21.4/blueprints/armor_stand.ajblueprint create mode 100644 test-packs/1.21.4/datapacks/animated_java/pack.mcmeta create mode 100644 test-packs/1.21.4/datapacks/test-framework/mcb.config.js create mode 100644 test-packs/1.21.4/datapacks/test-framework/pack.mcmeta create mode 100644 test-packs/1.21.4/datapacks/test-framework/package.json create mode 100644 test-packs/1.21.4/datapacks/test-framework/src/test.mcb create mode 100644 test-packs/1.21.4/resources/pack.mcmeta diff --git a/test-packs/1.21.4/blueprints/armor_stand.ajblueprint b/test-packs/1.21.4/blueprints/armor_stand.ajblueprint new file mode 100644 index 00000000..0015eda6 --- /dev/null +++ b/test-packs/1.21.4/blueprints/armor_stand.ajblueprint @@ -0,0 +1,1897 @@ +{ + "meta": { + "format": "animated_java_blueprint", + "format_version": "1.7.1", + "uuid": "167b27cd-b559-3f13-a97c-0841fe21f1d1", + "save_location": "D:\\github-repos\\animated-java\\animated-java\\test-packs\\1.21.4\\blueprints\\armor_stand.ajblueprint", + "last_used_export_namespace": "armor_stand" + }, + "blueprint_settings": { + "export_namespace": "armor_stand", + "show_bounding_box": false, + "auto_bounding_box": true, + "bounding_box": [95, 32], + "enable_plugin_mode": false, + "resource_pack_export_mode": "raw", + "data_pack_export_mode": "raw", + "target_minecraft_versions": ["1.21.4"], + "display_item": "minecraft:white_dye", + "custom_model_data_offset": 0, + "enable_advanced_resource_pack_settings": false, + "resource_pack": "../resources", + "enable_advanced_data_pack_settings": false, + "data_pack": "../datapacks/animated_java", + "summon_commands": "say On-Summon!", + "remove_commands": "say On-Remove!", + "ticking_commands": "", + "interpolation_duration": 1, + "teleportation_duration": 1, + "use_storage_for_animation": false, + "show_function_errors": true, + "show_outdated_warning": true, + "baked_animations": false, + "json_file": "../testPluginExport.json", + "target_minecraft_version": "1.21.4", + "enable_advanced_resource_pack_folders": false, + "display_item_path": "", + "model_folder": "", + "texture_folder": "", + "customModelDataOffset": 0, + "custom_summon_commands": "" + }, + "resolution": { + "width": 64, + "height": 64 + }, + "elements": [ + { + "name": "cube", + "box_uv": false, + "rescale": false, + "locked": false, + "light_emission": 0, + "render_order": "default", + "allow_mirror_modeling": true, + "from": [-6, 0, -6], + "to": [6, 1, 6], + "autouv": 0, + "color": 2, + "origin": [0, 0, 0], + "faces": { + "north": { + "uv": [12, 44, 24, 45], + "texture": 0 + }, + "east": { + "uv": [0, 44, 12, 45], + "texture": 0 + }, + "south": { + "uv": [36, 44, 48, 45], + "texture": 0 + }, + "west": { + "uv": [24, 44, 36, 45], + "texture": 0 + }, + "up": { + "uv": [12, 32, 24, 44], + "texture": 0 + }, + "down": { + "uv": [24, 32, 36, 44], + "texture": 0 + } + }, + "type": "cube", + "uuid": "46624743-e0ef-5e97-e6d8-ba5dc100baf4" + }, + { + "name": "cube", + "box_uv": false, + "rescale": false, + "locked": false, + "light_emission": 0, + "render_order": "default", + "allow_mirror_modeling": true, + "from": [-4, 12, -1], + "to": [4, 14, 1], + "autouv": 0, + "color": 2, + "origin": [0, 13, 0], + "faces": { + "north": { + "uv": [2, 50, 10, 52], + "texture": 0 + }, + "east": { + "uv": [0, 50, 2, 52], + "texture": 0 + }, + "south": { + "uv": [12, 50, 20, 52], + "texture": 0 + }, + "west": { + "uv": [10, 50, 12, 52], + "texture": 0 + }, + "up": { + "uv": [2, 50, 10, 52], + "texture": 0 + }, + "down": { + "uv": [10, 48, 18, 50], + "texture": 0 + } + }, + "type": "cube", + "uuid": "9b73ebc3-aca6-b85c-d022-b0a811ab38f8" + }, + { + "name": "cube", + "box_uv": false, + "rescale": false, + "locked": false, + "light_emission": 0, + "render_order": "default", + "allow_mirror_modeling": true, + "from": [1, 1, -1], + "to": [3, 12, 1], + "autouv": 0, + "color": 2, + "origin": [2, 6.5, 0], + "faces": { + "north": { + "uv": [10, 2, 12, 13], + "texture": 0 + }, + "east": { + "uv": [12, 2, 14, 13], + "texture": 0 + }, + "south": { + "uv": [14, 2, 16, 13], + "texture": 0 + }, + "west": { + "uv": [8, 2, 10, 13], + "texture": 0 + }, + "up": { + "uv": [10, 0, 12, 2], + "texture": 0 + }, + "down": { + "uv": [12, 0, 14, 2], + "texture": 0 + } + }, + "type": "cube", + "uuid": "d29efa52-def5-a311-7438-1fc73aac804c" + }, + { + "name": "cube", + "box_uv": false, + "rescale": false, + "locked": false, + "light_emission": 0, + "render_order": "default", + "allow_mirror_modeling": true, + "from": [-3, 1, -1], + "to": [-1, 12, 1], + "autouv": 0, + "color": 2, + "origin": [-2, 6.5, 0], + "faces": { + "north": { + "uv": [44, 18, 42, 29], + "texture": 0 + }, + "east": { + "uv": [46, 18, 44, 29], + "texture": 0 + }, + "south": { + "uv": [48, 18, 46, 29], + "texture": 0 + }, + "west": { + "uv": [42, 18, 40, 29], + "texture": 0 + }, + "up": { + "uv": [42, 16, 44, 18], + "texture": 0 + }, + "down": { + "uv": [44, 16, 46, 18], + "texture": 0 + } + }, + "type": "cube", + "uuid": "60766231-bd45-cb3f-0a4f-c6c066e86f54" + }, + { + "name": "cube", + "box_uv": false, + "rescale": false, + "locked": false, + "light_emission": 0, + "render_order": "default", + "allow_mirror_modeling": true, + "from": [-6, 21, -1.5], + "to": [6, 24, 1.5], + "autouv": 0, + "color": 2, + "origin": [0, 22.5, 0], + "faces": { + "north": { + "uv": [3, 29, 15, 32], + "texture": 0 + }, + "east": { + "uv": [0, 29, 3, 32], + "texture": 0 + }, + "south": { + "uv": [18, 29, 30, 32], + "texture": 0 + }, + "west": { + "uv": [15, 29, 18, 32], + "texture": 0 + }, + "up": { + "uv": [3, 26, 15, 29], + "texture": 0 + }, + "down": { + "uv": [15, 26, 27, 29], + "texture": 0 + } + }, + "type": "cube", + "uuid": "55829f3d-26dc-8f49-39b8-5ba2c0159a24" + }, + { + "name": "cube", + "box_uv": false, + "rescale": false, + "locked": false, + "light_emission": 0, + "render_order": "default", + "allow_mirror_modeling": true, + "from": [1, 14, -1], + "to": [3, 21, 1], + "autouv": 0, + "color": 2, + "origin": [2, 17.5, 0], + "faces": { + "north": { + "uv": [18, 2, 20, 9], + "texture": 0 + }, + "east": { + "uv": [16, 2, 18, 9], + "texture": 0 + }, + "south": { + "uv": [22, 2, 24, 9], + "texture": 0 + }, + "west": { + "uv": [20, 2, 22, 9], + "texture": 0 + }, + "up": { + "uv": [18, 0, 20, 2], + "texture": 0 + }, + "down": { + "uv": [20, 0, 22, 2], + "texture": 0 + } + }, + "type": "cube", + "uuid": "9d16df18-0574-58bb-e0f9-f799946257c9" + }, + { + "name": "cube", + "box_uv": false, + "rescale": false, + "locked": false, + "light_emission": 0, + "render_order": "default", + "allow_mirror_modeling": true, + "from": [-3, 14, -1], + "to": [-1, 21, 1], + "autouv": 0, + "color": 2, + "origin": [-2, 17.5, 0], + "faces": { + "north": { + "uv": [50, 18, 52, 25], + "texture": 0 + }, + "east": { + "uv": [48, 18, 50, 25], + "texture": 0 + }, + "south": { + "uv": [54, 18, 56, 25], + "texture": 0 + }, + "west": { + "uv": [52, 18, 54, 25], + "texture": 0 + }, + "up": { + "uv": [50, 16, 52, 18], + "texture": 0 + }, + "down": { + "uv": [52, 16, 54, 18], + "texture": 0 + } + }, + "type": "cube", + "uuid": "f26e6144-8dab-547a-16e8-adaa6fa2c45d" + }, + { + "name": "cube", + "box_uv": false, + "rescale": false, + "locked": false, + "light_emission": 0, + "render_order": "default", + "allow_mirror_modeling": true, + "from": [-7, 12, -1], + "to": [-5, 24, 1], + "autouv": 0, + "color": 2, + "origin": [-6, 18, 0], + "faces": { + "north": { + "uv": [36, 18, 34, 30], + "texture": 0 + }, + "east": { + "uv": [34, 18, 32, 30], + "texture": 0 + }, + "south": { + "uv": [40, 18, 38, 30], + "texture": 0 + }, + "west": { + "uv": [38, 18, 36, 30], + "texture": 0 + }, + "up": { + "uv": [34, 18, 36, 16], + "texture": 0 + }, + "down": { + "uv": [36, 16, 38, 18], + "texture": 0 + } + }, + "type": "cube", + "uuid": "c219cb9b-53a7-6a5b-7b47-dce0a1e6ec14" + }, + { + "name": "cube", + "box_uv": false, + "rescale": false, + "locked": false, + "light_emission": 0, + "render_order": "default", + "allow_mirror_modeling": true, + "from": [5, 12, -1], + "to": [7, 24, 1], + "autouv": 0, + "color": 2, + "origin": [6, 18, 0], + "faces": { + "north": { + "uv": [26, 2, 28, 14], + "texture": 0 + }, + "east": { + "uv": [24, 2, 26, 14], + "texture": 0 + }, + "south": { + "uv": [30, 2, 32, 14], + "texture": 0 + }, + "west": { + "uv": [28, 2, 30, 14], + "texture": 0 + }, + "up": { + "uv": [26, 0, 28, 2], + "texture": 0 + }, + "down": { + "uv": [30, 0, 28, 2], + "texture": 0 + } + }, + "type": "cube", + "uuid": "13293700-7f42-2279-6a1f-4e0a6a4d89b3" + }, + { + "name": "cube", + "box_uv": false, + "rescale": false, + "locked": false, + "light_emission": 0, + "render_order": "default", + "allow_mirror_modeling": true, + "from": [-1, 23, -1], + "to": [1, 30, 1], + "autouv": 0, + "color": 2, + "origin": [0, 26.5, 0], + "faces": { + "north": { + "uv": [2, 2, 4, 9], + "texture": 0 + }, + "east": { + "uv": [0, 2, 2, 9], + "texture": 0 + }, + "south": { + "uv": [6, 2, 8, 9], + "texture": 0 + }, + "west": { + "uv": [4, 2, 6, 9], + "texture": 0 + }, + "up": { + "uv": [2, 0, 4, 2], + "texture": 0 + }, + "down": { + "uv": [4, 0, 6, 2], + "texture": 0 + } + }, + "type": "cube", + "uuid": "a23d9259-0d9a-4e16-1b42-47e5bedba00f" + }, + { + "name": "helmet", + "box_uv": false, + "rescale": false, + "locked": false, + "light_emission": 0, + "render_order": "default", + "allow_mirror_modeling": true, + "from": [-5, 22, -5], + "to": [5, 32, 5], + "autouv": 0, + "color": 9, + "origin": [0, 27, 0], + "faces": { + "north": { + "uv": [8, 16, 16, 32], + "texture": 1 + }, + "east": { + "uv": [0, 16, 8, 32], + "texture": 1 + }, + "south": { + "uv": [24, 16, 32, 32], + "texture": 1 + }, + "west": { + "uv": [16, 16, 24, 32], + "texture": 1 + }, + "up": { + "uv": [8, 0, 16, 16], + "texture": 1 + }, + "down": { + "uv": [16, 0, 24, 16], + "texture": 1 + } + }, + "type": "cube", + "uuid": "a302b268-1699-4013-011f-211bd85806d4" + }, + { + "name": "chestplate", + "box_uv": false, + "rescale": false, + "locked": false, + "light_emission": 0, + "render_order": "default", + "allow_mirror_modeling": true, + "from": [-5, 11.25, -3], + "to": [5, 23.75, 3], + "autouv": 0, + "color": 9, + "origin": [0, 17.5, 0], + "faces": { + "north": { + "uv": [20, 40, 28, 64], + "texture": 1 + }, + "east": { + "uv": [16, 40, 20, 64], + "texture": 1 + }, + "south": { + "uv": [32, 40, 40, 64], + "texture": 1 + }, + "west": { + "uv": [28, 40, 32, 64], + "texture": 1 + }, + "up": { + "uv": [20, 32, 28, 40], + "texture": 1 + }, + "down": { + "uv": [28, 32, 36, 40], + "texture": 1 + } + }, + "type": "cube", + "uuid": "6dd668dd-27bd-631d-5e44-a94f7a35ddbb" + }, + { + "name": "left_chestplate", + "box_uv": false, + "rescale": false, + "locked": false, + "light_emission": 0, + "render_order": "default", + "allow_mirror_modeling": true, + "from": [-9, 19.25, -3], + "to": [-3, 25, 3], + "autouv": 0, + "color": 9, + "origin": [-6, 22.125, 0], + "faces": { + "north": { + "uv": [48, 40, 44, 49.75], + "texture": 1 + }, + "east": { + "uv": [44, 40, 40, 49.75], + "texture": 1 + }, + "south": { + "uv": [56, 40, 52, 49.75], + "texture": 1 + }, + "west": { + "uv": [52, 40, 48, 49.75], + "texture": 1 + }, + "up": { + "uv": [44, 39.75, 48, 32], + "texture": 1 + }, + "down": { + "uv": [52, 32, 48, 39.75], + "texture": 1 + } + }, + "type": "cube", + "uuid": "967c77d0-2607-0ecb-8093-416d237cdb85" + }, + { + "name": "left_chestplate", + "box_uv": false, + "rescale": false, + "locked": false, + "light_emission": 0, + "render_order": "default", + "allow_mirror_modeling": true, + "from": [3, 19.25, -3], + "to": [9, 25, 3], + "autouv": 0, + "color": 9, + "origin": [6, 22.125, 0], + "faces": { + "north": { + "uv": [44, 40, 48, 49.75], + "texture": 1 + }, + "east": { + "uv": [48, 40, 52, 49.75], + "texture": 1 + }, + "south": { + "uv": [52, 40, 56, 49.75], + "texture": 1 + }, + "west": { + "uv": [40, 40, 44, 49.75], + "texture": 1 + }, + "up": { + "uv": [48, 39.75, 44, 32], + "texture": 1 + }, + "down": { + "uv": [48, 32, 52, 39.75], + "texture": 1 + } + }, + "type": "cube", + "uuid": "98475898-cfc8-f67b-3145-abaf659deb3e" + }, + { + "name": "pants", + "box_uv": false, + "rescale": false, + "locked": false, + "light_emission": 0, + "render_order": "default", + "allow_mirror_modeling": true, + "from": [-4.5, 11.5, -2.5], + "to": [4.5, 17, 2.5], + "autouv": 0, + "color": 9, + "origin": [0, 14.25, 0], + "faces": { + "north": { + "uv": [20, 54, 28, 64], + "texture": 2 + }, + "east": { + "uv": [16, 54, 20, 64], + "texture": 2 + }, + "south": { + "uv": [32, 54, 40, 64], + "texture": 2 + }, + "west": { + "uv": [28, 54, 32, 64], + "texture": 2 + }, + "up": { + "uv": [20, 48, 28, 54], + "texture": 2 + }, + "down": { + "uv": [28, 48, 36, 54], + "texture": 2 + } + }, + "type": "cube", + "uuid": "d5e974ae-a732-db7a-59a1-c16ff717e426" + }, + { + "name": "right_pants", + "box_uv": false, + "rescale": false, + "locked": false, + "light_emission": 0, + "render_order": "default", + "allow_mirror_modeling": true, + "from": [-0.5, 2.75, -2.375], + "to": [4.25, 12, 2.375], + "autouv": 0, + "color": 9, + "origin": [1.875, 7.375, 0], + "faces": { + "north": { + "uv": [4, 40, 8, 58], + "texture": 2 + }, + "east": { + "uv": [0, 40, 4, 58], + "texture": 2 + }, + "south": { + "uv": [12, 40, 16, 58], + "texture": 2 + }, + "west": { + "uv": [8, 40, 12, 58], + "texture": 2 + }, + "up": { + "uv": [4, 32, 8, 40], + "texture": 2 + }, + "down": { + "uv": [8, 32, 12, 40], + "texture": 2 + } + }, + "type": "cube", + "uuid": "71bfec99-5014-21d3-739b-6512074212db" + }, + { + "name": "left_pants", + "box_uv": false, + "rescale": false, + "locked": false, + "light_emission": 0, + "render_order": "default", + "allow_mirror_modeling": true, + "from": [-4.25, 2.75, -2.375], + "to": [0.5, 12, 2.375], + "autouv": 0, + "color": 9, + "origin": [-1.875, 7.375, 0], + "faces": { + "north": { + "uv": [8, 40, 4, 58], + "texture": 2 + }, + "east": { + "uv": [12, 40, 8, 58], + "texture": 2 + }, + "south": { + "uv": [16, 40, 12, 58], + "texture": 2 + }, + "west": { + "uv": [4, 40, 0, 58], + "texture": 2 + }, + "up": { + "uv": [8, 32, 4, 40], + "texture": 2 + }, + "down": { + "uv": [12, 32, 8, 40], + "texture": 2 + } + }, + "type": "cube", + "uuid": "4dd0c5f1-828f-d559-6496-16e2fbe6276d" + }, + { + "name": "right_shoe", + "box_uv": false, + "rescale": false, + "locked": false, + "light_emission": 0, + "render_order": "default", + "allow_mirror_modeling": true, + "from": [-1, -1, -3], + "to": [4.75, 6, 3], + "autouv": 0, + "color": 9, + "origin": [1.875, 2.5, 0], + "faces": { + "north": { + "uv": [4, 52, 8, 64], + "texture": 1 + }, + "east": { + "uv": [0, 52, 4, 64], + "texture": 1 + }, + "south": { + "uv": [12, 52, 16, 64], + "texture": 1 + }, + "west": { + "uv": [8, 52, 12, 64], + "texture": 1 + }, + "up": { + "uv": [4, 32, 8, 40], + "texture": 1 + }, + "down": { + "uv": [8, 32, 12, 40], + "texture": 1 + } + }, + "type": "cube", + "uuid": "41413d23-edf5-3fdc-2ddb-5fd45ea99a89" + }, + { + "name": "left_shoe", + "box_uv": false, + "rescale": false, + "locked": false, + "light_emission": 0, + "render_order": "default", + "allow_mirror_modeling": true, + "from": [-4.75, -1, -3], + "to": [1, 6, 3], + "autouv": 0, + "color": 9, + "origin": [-1.875, 2.5, 0], + "faces": { + "north": { + "uv": [8, 52, 4, 64], + "texture": 1 + }, + "east": { + "uv": [12, 52, 8, 64], + "texture": 1 + }, + "south": { + "uv": [16, 52, 12, 64], + "texture": 1 + }, + "west": { + "uv": [4, 52, 0, 64], + "texture": 1 + }, + "up": { + "uv": [8, 32, 4, 40], + "texture": 1 + }, + "down": { + "uv": [12, 32, 8, 40], + "texture": 1 + } + }, + "type": "cube", + "uuid": "11976d8b-3994-df35-0fb9-b92ac5012141" + }, + { + "name": "left_hand", + "position": [-6, 11, 0], + "rotation": [0, 0, 0], + "ignore_inherited_scale": false, + "visibility": true, + "locked": false, + "config": { + "use_entity": true, + "entity_type": "minecraft:item_display", + "sync_passenger_rotation": true, + "summon_commands": "", + "ticking_commands": "particle minecraft:bubble ^ ^ ^1\ntp @e[tag=test3,limit=1] ~ ~ ~ ~ ~" + }, + "uuid": "7de415a2-9fdd-e4b2-3455-c3bed72eb896", + "type": "locator" + }, + { + "name": "right_hand", + "position": [6, 11, 0], + "rotation": [0, 0, 0], + "ignore_inherited_scale": false, + "visibility": true, + "locked": false, + "config": { + "use_entity": true, + "entity_type": "minecraft:item_display", + "sync_passenger_rotation": false, + "summon_commands": "", + "ticking_commands": "particle minecraft:bubble ^ ^ ^1\ntp @e[tag=test2,limit=1] ~ ~ ~ ~ ~" + }, + "uuid": "7747736f-85e2-338f-207e-53f8d3d2fa39", + "type": "locator" + }, + { + "name": "text_display", + "position": [0, 38, 0], + "rotation": [45, 0, 0], + "scale": [1, 1, 1], + "visibility": true, + "block": "minecraft:stone", + "config": {}, + "item": "minecraft:diamond", + "itemDisplay": "none", + "text": "{\n\t\"text\": \"Hello, World!\",\n\t\"color\": \"green\"\n}\n", + "lineWidth": 200, + "backgroundColor": "#ffffff", + "backgroundAlpha": 0.25098, + "align": "center", + "shadow": true, + "seeThrough": true, + "uuid": "c2e217f1-b50a-5c9a-b342-71a35e984046", + "type": "animated_java:text_display" + }, + { + "name": "camera", + "box_uv": false, + "rescale": false, + "locked": false, + "light_emission": 0, + "render_order": "default", + "allow_mirror_modeling": true, + "from": [0, 0, 0], + "to": [1, 1, 1], + "autouv": 0, + "color": 0, + "origin": [0, 0, 0], + "faces": { + "north": { + "uv": [0, 0, 1, 1], + "texture": 0 + }, + "east": { + "uv": [0, 0, 1, 1], + "texture": 0 + }, + "south": { + "uv": [0, 0, 1, 1], + "texture": 0 + }, + "west": { + "uv": [0, 0, 1, 1], + "texture": 0 + }, + "up": { + "uv": [0, 0, 1, 1], + "texture": 0 + }, + "down": { + "uv": [0, 0, 1, 1], + "texture": 0 + } + }, + "type": "cube", + "uuid": "3f916352-b0e1-f1e4-0e09-308cc68f96e6" + } + ], + "outliner": [ + { + "name": "root", + "origin": [0, 0, 0], + "color": 0, + "configs": { + "default": { + "billboard": "fixed", + "brightness_override": 0, + "enchanted": false, + "glow_color": "#ffffff", + "glowing": false, + "inherit_settings": true, + "invisible": false, + "nbt": "{}", + "shadow_radius": 0, + "shadow_strength": 1, + "use_nbt": false + }, + "variants": {} + }, + "uuid": "98795982-9c43-6e3e-eed9-2c776a957938", + "export": true, + "mirror_uv": false, + "isOpen": true, + "locked": false, + "visibility": true, + "autouv": 0, + "selected": false, + "children": [ + { + "name": "baseplate_root", + "origin": [0, 0, 0], + "color": 0, + "configs": { + "default": { + "billboard": "fixed", + "brightness_override": 0, + "enchanted": false, + "glow_color": "#ffffff", + "glowing": false, + "inherit_settings": true, + "invisible": false, + "nbt": "{}", + "shadow_radius": 0, + "shadow_strength": 1, + "use_nbt": false + }, + "variants": {} + }, + "uuid": "102db36a-eeda-0e6f-d5cc-c186ecda8165", + "export": true, + "mirror_uv": false, + "isOpen": false, + "locked": false, + "visibility": true, + "autouv": 0, + "selected": false, + "children": [ + { + "name": "baseplate_pivot_a", + "origin": [0, 1, 6], + "color": 0, + "configs": { + "default": { + "billboard": "fixed", + "brightness_override": 0, + "enchanted": false, + "glow_color": "#ffffff", + "glowing": false, + "inherit_settings": true, + "invisible": false, + "nbt": "{}", + "shadow_radius": 0, + "shadow_strength": 1, + "use_nbt": false + }, + "variants": {} + }, + "uuid": "4f000ffc-11d6-3a4b-7c8d-6b5ba483228c", + "export": true, + "mirror_uv": false, + "isOpen": true, + "locked": false, + "visibility": true, + "autouv": 0, + "selected": false, + "children": ["46624743-e0ef-5e97-e6d8-ba5dc100baf4"] + } + ] + }, + { + "name": "armor_stand_root", + "origin": [0, 1, 0], + "color": 0, + "configs": { + "default": { + "billboard": "fixed", + "brightness_override": 0, + "enchanted": false, + "glowing": false, + "override_glow_color": true, + "glow_color": "#ffffff", + "inherit_settings": true, + "invisible": false, + "nbt": "{}", + "shadow_radius": 0, + "shadow_strength": 1, + "use_nbt": false + }, + "variants": {} + }, + "uuid": "5e08acae-d6ca-0dfd-9360-8cdb13c7a824", + "export": true, + "mirror_uv": false, + "isOpen": true, + "locked": false, + "visibility": true, + "autouv": 0, + "selected": false, + "children": [ + { + "name": "waist_pivot", + "origin": [0, 12, 0], + "color": 0, + "configs": { + "default": { + "billboard": "fixed", + "brightness_override": 0, + "enchanted": false, + "glowing": false, + "override_glow_color": true, + "glow_color": "#ffffff", + "inherit_settings": true, + "invisible": false, + "nbt": "{}", + "shadow_radius": 0, + "shadow_strength": 1, + "use_nbt": false + }, + "variants": { + "5417306e-2c69-3f36-1e3c-edd904034a36": {} + } + }, + "uuid": "98a28100-07e8-849a-38b7-f56abc2c2e56", + "export": true, + "mirror_uv": false, + "isOpen": true, + "locked": false, + "visibility": true, + "autouv": 0, + "selected": false, + "children": [ + { + "name": "body_waist_pivot", + "origin": [0, 12, 0], + "color": 0, + "configs": { + "default": { + "billboard": "fixed", + "brightness_override": 0, + "enchanted": false, + "glowing": false, + "override_glow_color": true, + "glow_color": "#ffffff", + "inherit_settings": true, + "invisible": false, + "nbt": "{}", + "shadow_radius": 0, + "shadow_strength": 1, + "use_nbt": false + }, + "variants": { + "5417306e-2c69-3f36-1e3c-edd904034a36": {} + } + }, + "uuid": "49e67c2a-3d1d-792d-9c75-72ecbc0f92e0", + "export": true, + "mirror_uv": false, + "isOpen": true, + "locked": false, + "visibility": true, + "autouv": 0, + "selected": false, + "children": [ + { + "name": "body", + "origin": [0, 24, 0], + "color": 0, + "configs": { + "default": { + "billboard": "fixed", + "brightness_override": 0, + "enchanted": false, + "glowing": false, + "override_glow_color": true, + "glow_color": "#ffffff", + "inherit_settings": true, + "invisible": false, + "nbt": "{}", + "shadow_radius": 0, + "shadow_strength": 1, + "use_nbt": false + }, + "variants": { + "5417306e-2c69-3f36-1e3c-edd904034a36": { + "billboard": "fixed", + "override_brightness": false, + "brightness_override": 0, + "enchanted": false, + "glowing": false, + "override_glow_color": false, + "glow_color": "#ffffff", + "inherit_settings": true, + "invisible": false, + "nbt": "{}", + "shadow_radius": 0, + "shadow_strength": 1, + "use_nbt": false + }, + "49521f4b-b970-e4bd-b594-2e05d2d46027": { + "billboard": "fixed", + "override_brightness": false, + "brightness_override": 0, + "enchanted": false, + "glowing": true, + "override_glow_color": true, + "glow_color": "#00ff06", + "inherit_settings": true, + "invisible": false, + "nbt": "{}", + "shadow_radius": 0, + "shadow_strength": 1, + "use_nbt": false + } + } + }, + "uuid": "6c53311f-ffc8-e567-ff1b-65840698e9ba", + "export": true, + "mirror_uv": false, + "isOpen": true, + "locked": false, + "visibility": true, + "autouv": 0, + "selected": false, + "children": [ + "55829f3d-26dc-8f49-39b8-5ba2c0159a24", + "9d16df18-0574-58bb-e0f9-f799946257c9", + "f26e6144-8dab-547a-16e8-adaa6fa2c45d", + "9b73ebc3-aca6-b85c-d022-b0a811ab38f8", + "6dd668dd-27bd-631d-5e44-a94f7a35ddbb", + "d5e974ae-a732-db7a-59a1-c16ff717e426", + { + "name": "head", + "origin": [0, 23, 0], + "color": 0, + "configs": { + "default": { + "billboard": "fixed", + "override_brightness": false, + "brightness_override": 0, + "enchanted": false, + "glowing": false, + "override_glow_color": true, + "glow_color": "#ffffff", + "inherit_settings": true, + "invisible": false, + "nbt": "{}", + "shadow_radius": 0, + "shadow_strength": 1, + "use_nbt": false + }, + "variants": { + "49521f4b-b970-e4bd-b594-2e05d2d46027": { + "billboard": "fixed", + "override_brightness": false, + "brightness_override": 0, + "enchanted": false, + "glowing": true, + "override_glow_color": true, + "glow_color": "#c400ff", + "inherit_settings": true, + "invisible": false, + "nbt": "{}", + "shadow_radius": 0, + "shadow_strength": 1, + "use_nbt": false + } + } + }, + "uuid": "808e3c26-7285-af3f-a079-d8b899176dd3", + "export": true, + "mirror_uv": false, + "isOpen": true, + "locked": false, + "visibility": true, + "autouv": 0, + "selected": false, + "children": ["a23d9259-0d9a-4e16-1b42-47e5bedba00f", "a302b268-1699-4013-011f-211bd85806d4"] + }, + { + "name": "left_arm", + "origin": [-6, 23, 0], + "color": 0, + "configs": { + "default": { + "billboard": "fixed", + "override_brightness": false, + "brightness_override": 0, + "enchanted": false, + "glowing": false, + "override_glow_color": true, + "glow_color": "#ffffff", + "inherit_settings": true, + "invisible": false, + "nbt": "{}", + "shadow_radius": 0, + "shadow_strength": 1, + "use_nbt": false + }, + "variants": { + "49521f4b-b970-e4bd-b594-2e05d2d46027": { + "billboard": "fixed", + "override_brightness": false, + "brightness_override": 0, + "enchanted": false, + "glowing": true, + "override_glow_color": true, + "glow_color": "#00ff9f", + "inherit_settings": true, + "invisible": false, + "nbt": "{}", + "shadow_radius": 0, + "shadow_strength": 1, + "use_nbt": false + } + } + }, + "uuid": "b5b52d2c-097c-08df-6457-372fbae12445", + "export": true, + "mirror_uv": false, + "isOpen": true, + "locked": false, + "visibility": true, + "autouv": 0, + "selected": false, + "children": ["c219cb9b-53a7-6a5b-7b47-dce0a1e6ec14", "967c77d0-2607-0ecb-8093-416d237cdb85", "7de415a2-9fdd-e4b2-3455-c3bed72eb896"] + }, + { + "name": "right_arm", + "origin": [6, 23, 0], + "color": 0, + "configs": { + "default": { + "billboard": "fixed", + "override_brightness": false, + "brightness_override": 0, + "enchanted": false, + "glowing": false, + "override_glow_color": true, + "glow_color": "#ffffff", + "inherit_settings": true, + "invisible": false, + "nbt": "{}", + "shadow_radius": 0, + "shadow_strength": 1, + "use_nbt": false + }, + "variants": { + "49521f4b-b970-e4bd-b594-2e05d2d46027": { + "billboard": "fixed", + "override_brightness": false, + "brightness_override": 0, + "enchanted": false, + "glowing": true, + "override_glow_color": true, + "glow_color": "#ff0000", + "inherit_settings": true, + "invisible": false, + "nbt": "{}", + "shadow_radius": 0, + "shadow_strength": 1, + "use_nbt": false + } + } + }, + "uuid": "215d1b02-0e64-a794-1b88-a9c5a6d7541c", + "export": true, + "mirror_uv": false, + "isOpen": true, + "locked": false, + "visibility": true, + "autouv": 0, + "selected": false, + "children": ["13293700-7f42-2279-6a1f-4e0a6a4d89b3", "98475898-cfc8-f67b-3145-abaf659deb3e", "7747736f-85e2-338f-207e-53f8d3d2fa39"] + } + ] + } + ] + }, + { + "name": "left_leg", + "origin": [2, 12, 0], + "color": 0, + "configs": { + "default": { + "billboard": "fixed", + "brightness_override": 0, + "enchanted": false, + "glow_color": "#ffffff", + "glowing": false, + "inherit_settings": true, + "invisible": false, + "nbt": "{}", + "shadow_radius": 0, + "shadow_strength": 1, + "use_nbt": false + }, + "variants": { + "49521f4b-b970-e4bd-b594-2e05d2d46027": { + "billboard": "fixed", + "override_brightness": false, + "brightness_override": 0, + "enchanted": false, + "glowing": true, + "override_glow_color": true, + "glow_color": "#ffee00", + "inherit_settings": true, + "invisible": false, + "nbt": "{}", + "shadow_radius": 0, + "shadow_strength": 1, + "use_nbt": false + } + } + }, + "uuid": "55b812fe-7e4c-b2a5-da5b-3a8c82f9fc69", + "export": true, + "mirror_uv": false, + "isOpen": true, + "locked": false, + "visibility": true, + "autouv": 0, + "selected": false, + "children": ["d29efa52-def5-a311-7438-1fc73aac804c", "71bfec99-5014-21d3-739b-6512074212db", "41413d23-edf5-3fdc-2ddb-5fd45ea99a89"] + }, + { + "name": "right_leg", + "origin": [-2, 12, 0], + "color": 0, + "configs": { + "default": { + "billboard": "fixed", + "brightness_override": 0, + "enchanted": false, + "glow_color": "#ffffff", + "glowing": false, + "inherit_settings": true, + "invisible": false, + "nbt": "{}", + "shadow_radius": 0, + "shadow_strength": 1, + "use_nbt": false + }, + "variants": { + "49521f4b-b970-e4bd-b594-2e05d2d46027": { + "billboard": "fixed", + "override_brightness": false, + "brightness_override": 0, + "enchanted": false, + "glowing": true, + "override_glow_color": true, + "glow_color": "#6e00ff", + "inherit_settings": true, + "invisible": false, + "nbt": "{}", + "shadow_radius": 0, + "shadow_strength": 1, + "use_nbt": false + } + } + }, + "uuid": "60d50d30-a018-429d-ba78-c5fb5804dd8a", + "export": true, + "mirror_uv": false, + "isOpen": true, + "locked": false, + "visibility": true, + "autouv": 0, + "selected": false, + "children": ["60766231-bd45-cb3f-0a4f-c6c066e86f54", "4dd0c5f1-828f-d559-6496-16e2fbe6276d", "11976d8b-3994-df35-0fb9-b92ac5012141"] + } + ] + } + ] + }, + "3f916352-b0e1-f1e4-0e09-308cc68f96e6" + ] + }, + "c2e217f1-b50a-5c9a-b342-71a35e984046" + ], + "textures": [ + { + "path": "", + "name": "wood.png", + "folder": "", + "namespace": "", + "id": "0", + "group": "", + "width": 64, + "height": 64, + "uv_width": 64, + "uv_height": 64, + "particle": false, + "use_as_default": false, + "layers_enabled": false, + "sync_to_project": "", + "render_mode": "default", + "render_sides": "auto", + "pbr_channel": "color", + "frame_time": 1, + "frame_order_type": "loop", + "frame_order": "", + "frame_interpolate": false, + "visible": true, + "internal": true, + "saved": false, + "uuid": "eb6c49b8-8e8e-a039-9a6f-ef6a06bc7924", + "source": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAAAXNSR0IArs4c6QAAB6xJREFUeF7tW01oXUUUnmebkjZNCU1bjSnVtAUNVks0VK1gEbLowmK6EIOKP3VRKBYNBldqiLoMRIkUurAq+PPEhUpduAiIgkVLMDy1qGCtDY3RmsRH07SxSb3yzfW7OW9y75u5uS/v3WBnc+fnzN8353wzc+a9jPovHHtzv4foRH5S59z79LsZluH7xev7vJOjf6otDesVvo8/dzR2+a8jf6nLV83qNu5+4khBfdlXOePBIGwAPPPInd59u5rVx5//oPA1J2Ar/+SVB72pv/9Rx0+cDq1fzknLvjKfvvaoXnmEizMXVH5qOiivq6nW8dGRMbWybrVCemXVqqAc8kivWrlMawVWVgYz78LFy7oPBPTTULdW7X7yrYpqQubDvvs9OWkMjhNHHBPkRE2AKEtQWI76aPNi/nwAHNuSAEF+b+cHlQXgUNc9WgN+n7ig/piYCsZ39doadc3audWW5ShDgPwdrU06Tu3gClNzNl+/qUBjuPrMNLmk3KaQAbmhU6inHnR+Yp4qF1Prd44e18UEBaCZYMpyxKXM4Y++r6wGgAMwaa4izQH2ieCi1uAAgkgNqF9TW3QxATj6rbgGgANo57Rbqq20fc4GhCjVmiBJcpTAsR55gV8tkz+vDvR+VlkN2N++TZtAlM0zP0qt2+66SZuPZHe59JJQpf1Dw1KhATbSgYkUU2vJASTNKEJFPoIk24pzgAsAlAk7J9i2MZIs2uC5ABpD3qj0idBqf7Zzgg2AN17e40lCJd8QVFt92wIlLbcCYDsn2EiMJ82wQxQGX/FdICmCtvoAkJwAQpX2j7qp5wDbBJd6udUElvoEbeMvAACEZatQrDyJPbv4G4r5E2z1o8adGgCS+hNs9VMLAA9a9CuYAx0/Nxn4IMLuJdua/duoGVzvGvo2iANKqQKcIujc1dEht0mMwXS+yIuaeYagLOot9K5RUgB4vo/j6eFlTJ425eXsq8FTuijqur17V3PB2snbrMtdI/AHlEIL6AGKAwDPCZhF2F1ib9ttwbFZXrp43cZdRF7Y0E6cu0bFt0GYQDGfIsDktVwuNflA+iEXctfQALyw73avafMG3T5tmLZ36pezOl+WI02S4aAgBxl8XzzytTOw0gSiSK7YdRv9J7lrZDh5NMKV4GTYOG9uYRNn5wBsISDw7BHlU8z97BO09FfI6zZMBGGhdw3nlSrVLmG2Ix0y5AE5wYf27NDXaC4QF0HvGPkJ7VVKcteY97rDAbr4+Sm7fFmV+unMb+qGjdeq2cszCmkE5lFu52OH5wFODuDETOcLzgEIdLmZ/sskp0+0WzAgvA5hArRvqjcngM6ZJx2hXI0oecgClCgAipGc9CFKM6H/0nYdt2nuPABYQa4eV1Wustmwi8aEeX9wECtGcjgHyHcIkw8SAyDfBdasrtYqjEC7m52dUcuX+yoNDVi/2nd3r6mt1pqCcpkmGUGO9WRd5EEjCEaYU1ZywGL7CwreBjEwTur4tydVy82bCs7hQ98NB3mQPTc5HUzSrLvjli0aGEwYoKDuzltv1IABvEr7AqnBGXkF5lEWhVA9PntRWOZJWZTHret6V7DZcNLy2Ntgd3e3NzU1pWpq/PdBxBEaGxvVyMiIjqOsrq5O5fP5QMZVvqenJ/aYkoAQu7Ouri6vtbVVVVf7T+dmGB8fD8AZHR3VoMSR7+zsjD2msgPQ3NysVqxYofu9dOmSjldV+USJAHCmp6fV4OCgTseR7+3tTTcAMIGWlhY9QQaYAQGRqzE2NqbNII586jWgr6/Pa2ryvTCTk/4pDaG2dv5r8NDQkOaCOPKp5wBowNatWwtUfmZmJkgjTtMYHh7W8TjyqQdAkiA1wFx9mgc5gCToIr8kOACkxiBXX5Ig4jABkqCrfOo1ABywbt06yXWRcZAgQhz51JMgdwGoM1Sf+z53Am6H2AqpAdgFXOVTrwHkAKwsCU/uArB/5udyOa0B4ABX+SXBAfIojG0OAfs9j8XFjsI2+bJrQDab1e+BcjWlUfOkZ+73UP36+nqt2uYpUNaXZwWZjzoSSPaPfJiPuWMgzbHIXae9vT3RyTFRZScmTLnQFQBSvkCLPrxAA+ibk45PxuntoUfWHFWcp7BFn1HMDq4AwD9K0Bk68OUJhV9/Isg4ff02ubT4+lwVIXCKUt2PffOjdl4iMB5mFlFySR8qXAdeKrkru0AYkngwNf88EefFt1SrU452QjWAvIABwObD/iVWjsGVo49QAOTvezEIl5+alGOwi9FHKADyXyTsdKmRmytYoQBIDuDD5P+KA1zRK5Ncol+v2sZIDWAnSMsOF5JWqr7bb2O8J6Pj5pejcinHeOq71cjbPbpW48NzcabxRTnKGJdlZh7bQr40AQyaE174d0O/p84enGuXaZkfFo8qV8rLvafU9qf6g8XMvXowNM38qC8bkPVLD0BD1lOjHXPtIs3AfCnDeFieX89TDVk18HyHanspqzMQRzDTzAsrhyzbkOVRK80hxzeBjQOeOtM2BwDTMt+MszfWK2zDUxsHtET2QJvqODQQfFnNzHdN0wTCbD4MGPZHUzHTc/nX5fw2T2/PKMTNL2u6lCvl9T/rVzj4vu9k7X9ge6BUyEO62Jd1wur/C4S4j3y2CFhdAAAAAElFTkSuQmCC" + }, + { + "path": "", + "name": "iron_layer_1.png", + "folder": "", + "namespace": "", + "id": "1", + "group": "", + "width": 64, + "height": 32, + "uv_width": 64, + "uv_height": 64, + "particle": false, + "use_as_default": false, + "layers_enabled": false, + "sync_to_project": "", + "render_mode": "default", + "render_sides": "auto", + "pbr_channel": "color", + "frame_time": 1, + "frame_order_type": "loop", + "frame_order": "", + "frame_interpolate": false, + "visible": true, + "internal": true, + "saved": false, + "uuid": "240844f3-f615-fe51-0ada-d208791fbdc0", + "source": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAAAgCAYAAACinX6EAAAAAXNSR0IArs4c6QAAA6VJREFUaEPlmb9qMkEUxVcIKCikUBCSTot0yROYwkqf2FQK8Qm0U0g6hYAWAYUEhP34DZzlOqzORqNu/KZJZufuOPfMvef+2UIUGK+vr/F6vXZS5XI5kdazbrdbCO2R5/Xg4QGg1Wo5Hebzufu7Wq3c34+Pj+j5+Tm4x1UAMBgMomq1muhSKpX+DwB6vV78+PgYLRaLaLlcJgAAxufn5/VbgA/A/f19AsL7+3t09RwAAI1GI/r6+nIWIAAqlUr09vZ2/RYACdbrdXfrgIDvozxjPB5fvwUAAMruCoV/3gV2KYjCNu7L8XcBIdm0dRsG7b78f2kAC4rzxHjFd5k7LM8hO51ONJ1OnQtowAff398OpNvbW+caGrjI3d1dNBwO3SObRxBNJJuHPKKQFuYIcbVazfm4MkCAgAxns1miuG7bD5P2fQACAO2lUAqZ5gYAbksHu7m5cUpbU1a2F8dxTELUbrdd9gd4unW5wGazcY8AQZkjAE0mk62EUOu5cAGr8L4D9ft9p7AASEtxBYrlBAFsM0ksLA9h9OR5vIopQLAhFOVzQYLnKlSwDGsVlzZ96X1yCzgXwIf+ThCA0WgUiyDx4aenp+A7hx4my3vKW8Rbx1pSUJnJZBKrDsgLAIRVIsxvkGgQgNlsFitBAohLW4DyFsIqIfvYhkwQAJsqQ2LH/mAWM98nY3MP5E7uAqED76olfKCs7/qJFvN98n79oOw0bZ+f1hpBC8gCAD5JrUBqy2g2m1v+qZ6C1tPkSZVtmKT+eHl5cc+sz2t/v9aAE7SH5LOU60cDYGsJWzzpQBxYxRQAcEOqHZBn6MDiGoopiib2AAAAtXPS7YeHh0RhijGG5JkTubJwxNEAYNr+AXTDHAplpBgtNFWPOrAFSNamqIMCAMZtMwSwPy8Wi6728NcBJMQRvwKAOkbWBbgxO9RF5llIXq03WQygqTiz/r+PA7J+tzgaAFxAxY5ujLI5bUghK28B8d85R7ns+gE/YVXdhiUsNU1lgpqnWYD6Cpi5b7LI26wziwmHSDq0vtURUoUGaSnTsiSVxrLyab9DxHvq/KiT5JMUHSWGtRjJnuvDiwMAn9SNyCSZ68B23b9BIWzjLyxta3/drJot8l1ZkUj0Eh9enAvAorSoLEsrjIiFdSPMJb/LR7WnQJB17GLktGTqXL2CxAL0oYPbIe4SukRamKhdxyKY70s0fjtlDfnyoevOAtJa2jbsiCTTQtGla4NDFdd7/wAIfE5OhlGtmAAAAABJRU5ErkJggg==" + }, + { + "path": "", + "name": "iron_layer_2.png", + "folder": "", + "namespace": "", + "id": "2", + "group": "", + "width": 64, + "height": 32, + "uv_width": 64, + "uv_height": 64, + "particle": false, + "use_as_default": false, + "layers_enabled": false, + "sync_to_project": "", + "render_mode": "default", + "render_sides": "auto", + "pbr_channel": "color", + "frame_time": 1, + "frame_order_type": "loop", + "frame_order": "", + "frame_interpolate": false, + "visible": true, + "internal": true, + "saved": false, + "uuid": "34528a28-3a31-8b47-65bb-ef2b60b02401", + "source": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAAAgCAYAAACinX6EAAAAAXNSR0IArs4c6QAAAZZJREFUaEPtVruqhDAQjZ1gYSlY+gH+gfZ+sb2fYWEpCDaCgt1eTrhHhlldLsgVNkkajZldmJPzmMh4viLP+zcBgMAAzxEIEvCcAMEEgwSCBDxHIEjAcwKEFAgSCBJQCHRd98KnbdtMkiSmrmunWfLWHACoqsr0fW+GYTBN0/gFQNu2r6IobPNYXgIgVeE8ANQ8dY8ntC994OrMBYZEAACGl+e5GcfRNp+mqQVA75dlsd9xjjMnAIDm0QgAYINZltnmpmmyaQBPwKIvYL/vu63/9pSwDOCNoyGy4YoBEhAA5AQAvHHcMCVA+pPycRxbRnCPpxMMkBJg07xlSkD6g/QAFwalQwK6eeqdjAADyBBpmt8ek28eoCMPzWqT1CnxKSZ1pHLE5v/yXMYuz55ImSMGz7L/L42hhqMzPQJ7mui6rvadqSLrySjW6988YbK353w5OgNE3F5Zlmae5wMEMogyg+lKOV3VP2GytwE4G6TYIG8eJsrU0JKSfqLrAdh/e8xtAJgiB89/hyrdsDzX72cAoeaJlPkBm2JOMHlI974AAAAASUVORK5CYII=" + }, + { + "path": "", + "name": "transparent.png", + "folder": "", + "namespace": "", + "id": "3", + "group": "", + "width": 16, + "height": 16, + "uv_width": 16, + "uv_height": 16, + "particle": false, + "use_as_default": false, + "layers_enabled": false, + "sync_to_project": "", + "render_mode": "default", + "render_sides": "auto", + "pbr_channel": "color", + "frame_time": 1, + "frame_order_type": "loop", + "frame_order": "", + "frame_interpolate": false, + "visible": true, + "internal": true, + "saved": false, + "uuid": "797174ae-5c58-4a83-a630-eefd51007c80", + "source": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABgWlDQ1BJQ0MgcHJvZmlsZQAAKJF9kTtIA0EURY+JokjEwhQiFltEK21UxFKiKIKBkETwV7i7MVHIrmE3YmMp2AYs/DRGLWystbWwFQTBD4i1hZWijcj6ZhNIEOPAMIc7cy9v3oNAKWdabuMoWHbBSUxGtdm5ea35hSaCQIAR3XTzseREirrr844Gdd72q6z67/5cbell14QGTXjUzDsF4SXh4Y1CXvGecNhc0dPCZ8J9jhQo/KB0o8yvirM+B1Rm2EklxoTDwlq2ho0aNlccS3hIOJK2bMkPzJY5rXhTsZVbNyt1qh+Glu2ZpNJldzPJFDHiaBiss0qOAv1y2qK4JOQ+Wsff5fvj4jLEtYopjnHWsNB9P2oGv3vrZgYHykmhKDQ9e957DzTvwHfR876OPO/7GIJPcGlX/WslGPkQvVjVIofQvgXnV1XN2IWLbeh8zOuO7kv+/DMZeDuVMc1Bxw20LpT7Vrnn5B5S0qvpa9g/gN6sZC/W+XdLbd/+fVPp3w9iNHKgdXImZAAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAAuIwAALiMBeKU/dgAAAAd0SU1FB+gFAwAFKkpaLkIAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAEklEQVQ4y2NgGAWjYBSMAggAAAQQAAGFP6pyAAAAAElFTkSuQmCC" + } + ], + "variants": { + "default": { + "name": "default", + "display_name": "Default", + "uuid": "aac00620-0822-f892-856c-635a4439bbd4", + "texture_map": {}, + "excluded_nodes": [], + "is_default": true + }, + "list": [ + { + "name": "no_armor", + "display_name": "no_armor", + "uuid": "5417306e-2c69-3f36-1e3c-edd904034a36", + "texture_map": { + "240844f3-f615-fe51-0ada-d208791fbdc0": "797174ae-5c58-4a83-a630-eefd51007c80", + "34528a28-3a31-8b47-65bb-ef2b60b02401": "797174ae-5c58-4a83-a630-eefd51007c80" + }, + "excluded_nodes": [] + }, + { + "name": "no_baseplate", + "display_name": "no_baseplate", + "uuid": "bf2a6915-ec63-7ccf-3844-ea8be00b97e6", + "texture_map": { + "eb6c49b8-8e8e-a039-9a6f-ef6a06bc7924": "797174ae-5c58-4a83-a630-eefd51007c80" + }, + "excluded_nodes": [ + "98795982-9c43-6e3e-eed9-2c776a957938", + "102db36a-eeda-0e6f-d5cc-c186ecda8165", + "5e08acae-d6ca-0dfd-9360-8cdb13c7a824", + "98a28100-07e8-849a-38b7-f56abc2c2e56", + "49e67c2a-3d1d-792d-9c75-72ecbc0f92e0", + "6c53311f-ffc8-e567-ff1b-65840698e9ba", + "808e3c26-7285-af3f-a079-d8b899176dd3", + "b5b52d2c-097c-08df-6457-372fbae12445", + "215d1b02-0e64-a794-1b88-a9c5a6d7541c", + "55b812fe-7e4c-b2a5-da5b-3a8c82f9fc69", + "60d50d30-a018-429d-ba78-c5fb5804dd8a" + ] + }, + { + "name": "colors", + "display_name": "colors", + "uuid": "49521f4b-b970-e4bd-b594-2e05d2d46027", + "texture_map": {}, + "excluded_nodes": [] + } + ] + }, + "animations": [ + { + "uuid": "5b786abf-47f3-0d36-5deb-834412c63569", + "name": "walk", + "loop": "loop", + "override": false, + "length": 1, + "snapping": 20, + "selected": true, + "saved": false, + "path": "", + "anim_time_update": "", + "blend_weight": "", + "start_delay": "", + "loop_delay": "0", + "excluded_nodes": [ + { + "name": "baseplate_pivot_a", + "value": "4f000ffc-11d6-3a4b-7c8d-6b5ba483228c" + } + ], + "animators": { + "5e08acae-d6ca-0dfd-9360-8cdb13c7a824": { + "name": "armor_stand_root", + "type": "bone", + "keyframes": [ + { + "channel": "position", + "data_points": [ + { + "x": "0", + "y": "-1", + "z": "0" + } + ], + "uuid": "fe4ec2e7-5246-ebf1-b38a-521a5f3d9907", + "time": 0, + "color": -1, + "interpolation": "linear", + "easing": "linear", + "easingArgs": [] + } + ] + }, + "6c53311f-ffc8-e567-ff1b-65840698e9ba": { + "name": "body", + "type": "bone", + "keyframes": [ + { + "channel": "rotation", + "data_points": [ + { + "x": "0", + "y": "1 - math.sin(q.life_time * v.walk_speed + 90) * 12.25\n", + "z": "0" + } + ], + "uuid": "6bbb9d3d-e9c7-4ee6-79fc-ca26899b722c", + "time": 0, + "color": -1, + "interpolation": "linear", + "easing": "linear", + "easingArgs": [] + }, + { + "channel": "position", + "data_points": [ + { + "x": "0", + "y": "1 + math.sin(q.life_time * v.walk_speed * 2) * 0.5", + "z": "0" + } + ], + "uuid": "15fe5d50-bd56-ade8-1de5-c1e234e7d019", + "time": 0, + "color": -1, + "interpolation": "linear", + "easing": "linear", + "easingArgs": [] + } + ] + }, + "808e3c26-7285-af3f-a079-d8b899176dd3": { + "name": "head", + "type": "bone", + "keyframes": [ + { + "channel": "rotation", + "data_points": [ + { + "x": "0", + "y": "1 + math.sin(q.life_time * v.walk_speed + 90) * 12.25", + "z": "0" + } + ], + "uuid": "f62415e9-43b1-de7f-8c6a-ab713dafa65e", + "time": 0, + "color": -1, + "interpolation": "linear", + "easing": "linear", + "easingArgs": [] + } + ] + }, + "b5b52d2c-097c-08df-6457-372fbae12445": { + "name": "left_arm", + "type": "bone", + "keyframes": [ + { + "channel": "rotation", + "data_points": [ + { + "x": "math.sin(q.life_time * v.walk_speed) * 8", + "y": "0", + "z": "22.5" + } + ], + "uuid": "20a2dfee-e0e7-87aa-13cb-27861c08b166", + "time": 0, + "color": -1, + "interpolation": "linear", + "easing": "linear", + "easingArgs": [] + }, + { + "channel": "position", + "data_points": [ + { + "x": "2", + "y": "0", + "z": "-math.sin(q.life_time * v.walk_speed) * 2" + } + ], + "uuid": "2e24c9ea-de91-bd22-2d7c-bb95813a0658", + "time": 0, + "color": -1, + "interpolation": "linear", + "easing": "linear", + "easingArgs": [] + } + ] + }, + "215d1b02-0e64-a794-1b88-a9c5a6d7541c": { + "name": "right_arm", + "type": "bone", + "keyframes": [ + { + "channel": "rotation", + "data_points": [ + { + "x": "math.sin(q.life_time * v.walk_speed) * 22.5", + "y": "math.sin(q.life_time * v.walk_speed) * 12.25", + "z": "math.cos(q.life_time * v.walk_speed * 2) * 6 + 6" + } + ], + "uuid": "8eaf4e97-7b14-ac66-b575-4cc50963c99d", + "time": 0, + "color": -1, + "interpolation": "linear", + "easing": "linear", + "easingArgs": [] + } + ] + }, + "55b812fe-7e4c-b2a5-da5b-3a8c82f9fc69": { + "name": "left_leg", + "type": "bone", + "keyframes": [ + { + "channel": "rotation", + "data_points": [ + { + "x": "-math.sin(q.life_time * v.walk_speed) * 22.5", + "y": "0", + "z": "0" + } + ], + "uuid": "32f56ab1-fa8f-fa32-0418-45fddbb261a1", + "time": 0, + "color": -1, + "interpolation": "linear", + "easing": "linear", + "easingArgs": [] + }, + { + "channel": "position", + "data_points": [ + { + "x": "0", + "y": "math.clamp(math.cos(q.life_time * v.walk_speed) * 2, 0, 10)", + "z": "-math.sin(q.life_time * v.walk_speed) * 1\n" + } + ], + "uuid": "95a4ed7e-6530-bf4a-398f-76fe64d52033", + "time": 0, + "color": -1, + "interpolation": "linear", + "easing": "linear", + "easingArgs": [] + } + ] + }, + "60d50d30-a018-429d-ba78-c5fb5804dd8a": { + "name": "right_leg", + "type": "bone", + "keyframes": [ + { + "channel": "rotation", + "data_points": [ + { + "x": "math.sin(q.life_time * v.walk_speed) * 22.5", + "y": "0", + "z": "0" + } + ], + "uuid": "151bdae6-6e4a-718c-3317-f5c8bf83d366", + "time": 0, + "color": -1, + "interpolation": "linear", + "easing": "linear", + "easingArgs": [] + }, + { + "channel": "position", + "data_points": [ + { + "x": "0", + "y": "math.clamp(-math.cos(q.life_time * v.walk_speed) * 2, 0, 10)", + "z": "math.sin(q.life_time * v.walk_speed) * 1\n" + } + ], + "uuid": "4de6bc86-4ddf-3253-9e00-3d6eb70e0e50", + "time": 0, + "color": -1, + "interpolation": "linear", + "easing": "linear", + "easingArgs": [] + } + ] + }, + "49e67c2a-3d1d-792d-9c75-72ecbc0f92e0": { + "name": "body_waist_pivot", + "type": "bone", + "keyframes": [ + { + "channel": "rotation", + "data_points": [ + { + "x": "0", + "y": "0", + "z": "1 - math.sin(q.life_time * v.walk_speed - 90) * 3" + } + ], + "uuid": "d3d81801-bcd6-8e3c-8c8c-1e62874345de", + "time": 0, + "color": -1, + "interpolation": "linear", + "easing": "linear", + "easingArgs": [] + } + ] + }, + "effects": { + "name": "Effects", + "type": "effect", + "keyframes": [ + { + "channel": "variant", + "data_points": [ + { + "variant": "5417306e-2c69-3f36-1e3c-edd904034a36", + "execute_condition": "", + "repeat": false, + "repeat_frequency": 1 + } + ], + "uuid": "1baa095b-e941-62df-a215-698b50c93524", + "time": 0, + "color": -1, + "interpolation": "linear", + "easing": "linear", + "easingArgs": [] + } + ] + } + } + } + ], + "animation_controllers": [], + "animation_variable_placeholders": "v.walk_speed = 360 * 1;\nv.run_speed = 360 * 1.5;\nv.stickbug_speed = 360 * 1.25;\n" +} \ No newline at end of file diff --git a/test-packs/1.21.4/datapacks/animated_java/pack.mcmeta b/test-packs/1.21.4/datapacks/animated_java/pack.mcmeta new file mode 100644 index 00000000..348aa12d --- /dev/null +++ b/test-packs/1.21.4/datapacks/animated_java/pack.mcmeta @@ -0,0 +1,6 @@ +{ + "pack": { + "pack_format": 61, + "description": "AJ Testing DP" + } +} \ No newline at end of file diff --git a/test-packs/1.21.4/datapacks/test-framework/mcb.config.js b/test-packs/1.21.4/datapacks/test-framework/mcb.config.js new file mode 100644 index 00000000..45bc0388 --- /dev/null +++ b/test-packs/1.21.4/datapacks/test-framework/mcb.config.js @@ -0,0 +1,8 @@ +module.exports = { + libDir: null, // default: "null", determine where mcb looks for libraries, default is the bundled install location + generatedDirName: 'zzz', // default: "zzz", the name of the directory where mcb will put generated files + internalScoreboardName: 'aj.i', // default: "mcb.internal", the name of the internal scoreboard + header: null, // default: "#This file was generated by mcb\n", the header to put at the top of supported generated files + ioThreadCount: 1, // default: 1, the number of threads to use for IO operations, 1 is syncronous. + setup: null, // default: null, a function that will be called to allow binding to mcb events. +} diff --git a/test-packs/1.21.4/datapacks/test-framework/pack.mcmeta b/test-packs/1.21.4/datapacks/test-framework/pack.mcmeta new file mode 100644 index 00000000..618a6a2f --- /dev/null +++ b/test-packs/1.21.4/datapacks/test-framework/pack.mcmeta @@ -0,0 +1,6 @@ +{ + "pack":{ + "pack_format": 74, + "description": ". Made with MC-Build!" + } +} \ No newline at end of file diff --git a/test-packs/1.21.4/datapacks/test-framework/package.json b/test-packs/1.21.4/datapacks/test-framework/package.json new file mode 100644 index 00000000..a0df0c86 --- /dev/null +++ b/test-packs/1.21.4/datapacks/test-framework/package.json @@ -0,0 +1,3 @@ +{ + "type": "commonjs" +} diff --git a/test-packs/1.21.4/datapacks/test-framework/src/test.mcb b/test-packs/1.21.4/datapacks/test-framework/src/test.mcb new file mode 100644 index 00000000..57cbd78c --- /dev/null +++ b/test-packs/1.21.4/datapacks/test-framework/src/test.mcb @@ -0,0 +1,9 @@ +function on_load minecraft:load { + tellraw @a {text:'Test Framework loaded!', color:green} +} + +function summon { + #ARGS: {args:{...}} + function animated_java:armor_stand/remove/all + $execute positioned 0 -63 0 rotated 0 0 run function animated_java:armor_stand/summon {args:$(args)} +} diff --git a/test-packs/1.21.4/resources/pack.mcmeta b/test-packs/1.21.4/resources/pack.mcmeta new file mode 100644 index 00000000..9a4b5693 --- /dev/null +++ b/test-packs/1.21.4/resources/pack.mcmeta @@ -0,0 +1,6 @@ +{ + "pack": { + "pack_format": 46, + "description": "AJ Testing RP" + } +} \ No newline at end of file From 8a30259ed244087ae9fa12fee7290631773b97f2 Mon Sep 17 00:00:00 2001 From: SnaveSutit Date: Wed, 7 May 2025 12:31:13 -0400 Subject: [PATCH 2/3] =?UTF-8?q?=F0=9F=90=9B=20Fix=20incorrect=20data=20ent?= =?UTF-8?q?ity=20type=20on=20versions=20below=201.21.5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datapackCompiler/1.20.4/animation.mcb | 128 +++++++++++++---- .../datapackCompiler/1.20.4/static.mcb | 131 +++++++++++++---- .../datapackCompiler/1.20.5/animation.mcb | 128 +++++++++++++---- .../datapackCompiler/1.20.5/static.mcb | 131 +++++++++++++---- .../datapackCompiler/1.21.2/animation.mcb | 128 +++++++++++++---- .../datapackCompiler/1.21.2/static.mcb | 134 ++++++++++++++---- .../datapackCompiler/1.21.4/animation.mcb | 128 +++++++++++++---- .../datapackCompiler/1.21.4/static.mcb | 131 +++++++++++++---- .../datapackCompiler/1.21.5/animation.mcb | 46 +++--- .../datapackCompiler/1.21.5/static.mcb | 131 +++++++++++++---- src/systems/datapackCompiler/index.ts | 56 ++++++-- 11 files changed, 1020 insertions(+), 252 deletions(-) diff --git a/src/systems/datapackCompiler/1.20.4/animation.mcb b/src/systems/datapackCompiler/1.20.4/animation.mcb index 0c7eb900..f32e3b39 100644 --- a/src/systems/datapackCompiler/1.20.4/animation.mcb +++ b/src/systems/datapackCompiler/1.20.4/animation.mcb @@ -51,7 +51,7 @@ dir <%export_namespace%> { execute on passengers run data merge entity @s {Glowing: 1b, glow_color_override: <%0xff0000%>} summon minecraft:text_display ~ ~ ~ { \ Tags:['<%TAGS.GLOBAL_ENTITY()%>', '<%TAGS.OUTDATED_RIG_TEXT_DISPLAY()%>', '<%TAGS.NEW()%>'], \ - text:<%TELLRAW.RIG_OUTDATED_TEXT_DISPLAY()%>, \ + text:'<%TELLRAW.RIG_OUTDATED_TEXT_DISPLAY()%>', \ alignment: 'center', \ billboard: 'vertical', \ transformation:{ \ @@ -144,7 +144,7 @@ dir <%export_namespace%> { function play { IF (show_function_errors) { # Assert that the function is being run as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } @@ -158,7 +158,7 @@ dir <%export_namespace%> { function stop { IF (show_function_errors) { # Assert that the function is being run as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } @@ -172,7 +172,7 @@ dir <%export_namespace%> { function pause { IF (show_function_errors) { # Assert that the function is being run as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } @@ -182,7 +182,7 @@ dir <%export_namespace%> { function resume { IF (show_function_errors) { # Assert that the function is being run as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } @@ -192,7 +192,7 @@ dir <%export_namespace%> { function next_frame { IF (show_function_errors) { # Assert that the function is being run as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } @@ -208,7 +208,7 @@ dir <%export_namespace%> { #ARGS: {frame: int} IF (show_function_errors) { # Assert that the function is being run as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } @@ -221,7 +221,7 @@ dir <%export_namespace%> { #ARGS: {frame: int} IF (show_function_errors) { # Assert that the function is being run as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } @@ -235,7 +235,7 @@ dir <%export_namespace%> { #ARGS: {duration: int, to_frame: int} IF (show_function_errors) { # Assert that the function is being run as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } @@ -322,7 +322,7 @@ dir <%export_namespace%> { $execute $(condition)run function *<%export_namespace%>/variants/$(name)/apply } } - execute on passengers run data modify entity @s[type=!marker] start_interpolation set value -1 + execute on passengers run data modify entity @s[tag=!<%TAGS.GLOBAL_DATA()%>] start_interpolation set value -1 return 1 } @@ -501,7 +501,7 @@ dir <%export_namespace%> { # Pauses all animations IF (show_function_errors) { # Assert that the function is being run as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } @@ -530,7 +530,7 @@ dir <%export_namespace%> { interpolation_duration: <%interpolation_duration%>, \ Passengers:<%root_entity_passengers%>, \ } - execute as @e[type=item_display,tag=<%TAGS.NEW()%>,limit=1,distance=..0.01] run block zzz/summon/as_root_entity { + execute as @e[type=minecraft:item_display,tag=<%TAGS.NEW()%>,limit=1,distance=..0.01] run block zzz/summon/as_root_entity { execute store result score @s <%OBJECTIVES.ID()%> run scoreboard players add aj.last_id <%OBJECTIVES.ID()%> 1 execute on passengers if entity @s[tag=<%TAGS.GLOBAL_DATA()%>] run block as_data_entity { @@ -572,14 +572,14 @@ dir <%export_namespace%> { } REPEAT (Object.values(rig.nodes).filter(v => v.type === 'camera')) as camera { - summon item_display \ + summon minecraft:item_display \ ^<%roundTo(camera.default_transform.pos[0], 10)%> \ ^<%roundTo(camera.default_transform.pos[1], 10)%> \ ^<%roundTo(camera.default_transform.pos[2], 10)%> \ {Tags:<%getNodeTags(camera, rig)%>, teleport_duration: 2} execute \ as @n[ \ - type=item_display, \ + type=minecraft:item_display, \ tag=<%TAGS.NEW()%>, \ tag=<%TAGS.PROJECT_CAMERA_NAMED(export_namespace, camera.storage_name)%>, \ distance=..<%camera.max_distance + 1%> \ @@ -701,19 +701,23 @@ dir <%export_namespace%> { #ARGS: {name: string, command: string} IF (show_function_errors) { # Assert that the function is being run as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } - $data modify storage aj:temp args.command set value '$(command)' + data remove storage aj:temp args + $data modify storage aj:temp args merge value {name:'$(name)', command:'$(command)'} $execute \ on passengers \ if entity @s[tag=<%TAGS.GLOBAL_DATA()%>] \ run block zzz/as_locator/as_data { {name: $(name)} $data modify storage aj:temp args.uuid set from entity @s data.uuids.locator_$(name) + scoreboard players set #aj.check <%OBJECTIVES.I()%> 0 block execute_as_uuid { with storage aj:temp args - $execute as $(uuid) run $(command) + $execute as $(uuid) at @s run $(command) + scoreboard players set #aj.check <%OBJECTIVES.I()%> 1 } + execute if score #aj.check <%OBJECTIVES.I()%> matches 0 run tellraw @a <%TELLRAW.LOCATOR_NOT_FOUND_ENTITY()%> } } @@ -721,7 +725,7 @@ dir <%export_namespace%> { #ARGS: {command: string} IF (show_function_errors) { # Assert that the function is being run as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } @@ -731,17 +735,93 @@ dir <%export_namespace%> { REPEAT (Object.values(rig.nodes).filter(v => v.type === 'locator' && v.config?.use_entity)) as locator { data modify storage aj:temp args.uuid set from entity @s data.uuids.<%locator.type + '_' + locator.name%> block execute_as_uuid { with storage aj:temp args - $execute as $(uuid) run $(command) + $execute as $(uuid) at @s run $(command) } } } } } + IF (has_locators) { + function at_locator { + #ARGS: {name: string, command: string} + IF (show_function_errors) { + # Assert that the function is being run as the root entity. + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + function *global/errors/function_not_executed_as_root_entity \ + {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} + } + data remove storage aj:temp args + $data modify storage aj:temp args merge value {name:'$(name)', command:'$(command)'} + $execute \ + on passengers \ + if entity @s[tag=<%TAGS.GLOBAL_DATA()%>] \ + run block zzz/at_locator/as_data { {name: $(name)} + $execute unless data entity @s {data:{locators:{$(name):{}}}} run return run tellraw @a <%TELLRAW.LOCATOR_NOT_FOUND()%> + $data modify storage aj:temp args merge from entity @s data.locators.$(name) + block execute_at_transform { with storage aj:temp args + $execute \ + positioned ^$(posx) ^$(posy) ^$(posz) \ + rotated ~$(roty) ~$(rotx) \ + run $(command) + } + } + } + + function at_all_locators { + #ARGS: {command: string} + IF (show_function_errors) { + # Assert that the function is being run as the root entity. + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + function *global/errors/function_not_executed_as_root_entity \ + {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} + } + data remove storage aj:temp args + $data modify storage aj:temp args.command set value '$(command)' + execute on passengers if entity @s[tag=<%TAGS.GLOBAL_DATA()%>] run block zzz/at_all_locators/as_data { + REPEAT (Object.values(rig.nodes).filter(v => v.type === 'locator' && v.config?.use_entity)) as locator { + data modify storage aj:temp args merge from entity @s data.locators.<%locator.name%> + block execute_at_transform { with storage aj:temp args + $execute \ + positioned ^$(posx) ^$(posy) ^$(posz) \ + rotated ~$(roty) ~$(rotx) \ + run $(command) + } + } + } + } + } + + IF (has_cameras) { + function as_camera { + #ARGS: {name: string, command: string} + IF (show_function_errors) { + # Assert that the function is being run as the root entity. + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + function *global/errors/function_not_executed_as_root_entity \ + {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} + } + data remove storage aj:temp args + $data modify storage aj:temp args merge value {name:'$(name)', command:'$(command)'} + $execute \ + on passengers \ + if entity @s[tag=<%TAGS.GLOBAL_DATA()%>] \ + run block zzz/as_camera/as_data { {name: $(name)} + data modify storage aj:temp args.uuid set from entity @s data.cameras.$(name) + scoreboard players set #aj.check <%OBJECTIVES.I()%> 0 + block execute_as_uuid { with storage aj:temp args + $execute as $(uuid) at @s run $(command) + scoreboard players set #aj.check <%OBJECTIVES.I()%> 1 + } + execute if score #aj.check <%OBJECTIVES.I()%> matches 0 run tellraw @a <%TELLRAW.CAMERA_NOT_FOUND_ENTITY()%> + } + } + } + dir remove { function all { # Removes all instances of this rig from the world. - execute as @e[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run function *<%export_namespace%>/remove/this + execute as @e[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run function *<%export_namespace%>/remove/this } function entities { @@ -753,7 +833,7 @@ dir <%export_namespace%> { # Removes the rig this function is executed as. IF (show_function_errors) { # Assert that the function is being executed as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } @@ -803,7 +883,7 @@ dir <%export_namespace%> { function apply { IF (show_function_errors) { # Assert that the function is being executed as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } @@ -840,7 +920,7 @@ dir <%export_namespace%> { # Changes the pose of the rig to the the default pose with interpolation IF (show_function_errors) { # Assert that the function is being run as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } @@ -856,7 +936,7 @@ dir <%export_namespace%> { # Changes the pose of the rig to the the default pose without interpolation IF (show_function_errors) { # Assert that the function is being run as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } diff --git a/src/systems/datapackCompiler/1.20.4/static.mcb b/src/systems/datapackCompiler/1.20.4/static.mcb index bcbbec6d..a68f25e6 100644 --- a/src/systems/datapackCompiler/1.20.4/static.mcb +++ b/src/systems/datapackCompiler/1.20.4/static.mcb @@ -17,24 +17,25 @@ dir <%export_namespace%> { unless data entity @s {data:{rigHash: '<%rigHash%>'}} \ on vehicle \ run block zzz/check_rig_hash { - execute store result storage aj:temp x int 1 store result score #this.x aj.i run data get entity @s Pos[0] 1 - execute store result storage aj:temp y int 1 store result score #this.y aj.i run data get entity @s Pos[1] 1 - execute store result storage aj:temp z int 1 store result score #this.z aj.i run data get entity @s Pos[2] 1 - block show_outdated_warning { with storage aj:temp + data remove storage aj:temp args + execute store result storage aj:temp args.x int 1 store result score #this.x aj.i run data get entity @s Pos[0] 1 + execute store result storage aj:temp args.y int 1 store result score #this.y aj.i run data get entity @s Pos[1] 1 + execute store result storage aj:temp args.z int 1 store result score #this.z aj.i run data get entity @s Pos[2] 1 + block show_outdated_warning { with storage aj:temp args $tellraw @a <%TELLRAW.RIG_OUTDATED()%> } data modify entity @s data.rigHash set value '<%rigHash%>' execute on passengers run data merge entity @s {Glowing: 1b, glow_color_override: <%0xff0000%>} summon minecraft:text_display ~ ~ ~ { \ - Tags:['<%TAGS.GLOBAL_ENTITY()%>', '<%TAGS.OUTDATED_RIG_TEXT_DISPLAY()%>', '<%TAGS.NEW()%>'], \ - text:<%TELLRAW.RIG_OUTDATED_TEXT_DISPLAY()%>, \ - alignment: 'center', \ - billboard: 'vertical', \ - transformation:{ \ - translation:[0f,<%boundingBox[1]/16%>f,0f], \ - left_rotation:[0f,0f,0f,1f], \ - right_rotation:[0f,0f,0f,1f], \ - scale:[1f,1f,1f] \ + Tags:['<%TAGS.GLOBAL_ENTITY()%>', '<%TAGS.OUTDATED_RIG_TEXT_DISPLAY()%>', '<%TAGS.NEW()%>'], \ + text:'<%TELLRAW.RIG_OUTDATED_TEXT_DISPLAY()%>', \ + alignment: 'center', \ + billboard: 'vertical', \ + transformation:{ \ + translation:[0f,<%boundingBox[1]/16%>f,0f], \ + left_rotation:[0f,0f,0f,1f], \ + right_rotation:[0f,0f,0f,1f], \ + scale:[1f,1f,1f] \ } \ } ride @e[type=minecraft:text_display,tag=<%TAGS.NEW()%>,limit=1,distance=..0.01] mount @s @@ -126,7 +127,7 @@ dir <%export_namespace%> { interpolation_duration: <%interpolation_duration%>, \ Passengers:<%root_entity_passengers%>, \ } - execute as @e[type=item_display,tag=<%TAGS.NEW()%>,limit=1,distance=..0.01] run block zzz/summon/as_root_entity { + execute as @e[type=minecraft:item_display,tag=<%TAGS.NEW()%>,limit=1,distance=..0.01] run block zzz/summon/as_root_entity { execute store result score @s <%OBJECTIVES.ID()%> run scoreboard players add aj.last_id <%OBJECTIVES.ID()%> 1 execute on passengers if entity @s[tag=<%TAGS.GLOBAL_DATA()%>] run block as_data_entity { @@ -168,14 +169,14 @@ dir <%export_namespace%> { } REPEAT (Object.values(rig.nodes).filter(v => v.type === 'camera')) as camera { - summon item_display \ + summon minecraft:item_display \ ^<%roundTo(camera.default_transform.pos[0], 10)%> \ ^<%roundTo(camera.default_transform.pos[1], 10)%> \ ^<%roundTo(camera.default_transform.pos[2], 10)%> \ {Tags:<%getNodeTags(camera, rig)%>, teleport_duration: 2} execute \ as @n[ \ - type=item_display, \ + type=minecraft:item_display, \ tag=<%TAGS.NEW()%>, \ tag=<%TAGS.PROJECT_CAMERA_NAMED(export_namespace, camera.storage_name)%>, \ distance=..<%camera.max_distance + 1%> \ @@ -254,19 +255,23 @@ dir <%export_namespace%> { #ARGS: {name: string, command: string} IF (show_function_errors) { # Assert that the function is being run as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } - $data modify storage aj:temp args.command set value '$(command)' + data remove storage aj:temp args + $data modify storage aj:temp args merge value {name:'$(name)', command:'$(command)'} $execute \ on passengers \ if entity @s[tag=<%TAGS.GLOBAL_DATA()%>] \ run block zzz/as_locator/as_data { {name: $(name)} $data modify storage aj:temp args.uuid set from entity @s data.uuids.locator_$(name) + scoreboard players set #aj.check <%OBJECTIVES.I()%> 0 block execute_as_uuid { with storage aj:temp args - $execute as $(uuid) run $(command) + $execute as $(uuid) at @s run $(command) + scoreboard players set #aj.check <%OBJECTIVES.I()%> 1 } + execute if score #aj.check <%OBJECTIVES.I()%> matches 0 run tellraw @a <%TELLRAW.LOCATOR_NOT_FOUND_ENTITY()%> } } @@ -274,7 +279,7 @@ dir <%export_namespace%> { #ARGS: {command: string} IF (show_function_errors) { # Assert that the function is being run as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } @@ -284,17 +289,93 @@ dir <%export_namespace%> { REPEAT (Object.values(rig.nodes).filter(v => v.type === 'locator' && v.config?.use_entity)) as locator { data modify storage aj:temp args.uuid set from entity @s data.uuids.<%locator.type + '_' + locator.name%> block execute_as_uuid { with storage aj:temp args - $execute as $(uuid) run $(command) + $execute as $(uuid) at @s run $(command) } } } } } + IF (has_locators) { + function at_locator { + #ARGS: {name: string, command: string} + IF (show_function_errors) { + # Assert that the function is being run as the root entity. + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + function *global/errors/function_not_executed_as_root_entity \ + {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} + } + data remove storage aj:temp args + $data modify storage aj:temp args merge value {name:'$(name)', command:'$(command)'} + $execute \ + on passengers \ + if entity @s[tag=<%TAGS.GLOBAL_DATA()%>] \ + run block zzz/at_locator/as_data { {name: $(name)} + $execute unless data entity @s {data:{locators:{$(name):{}}}} run return run tellraw @a <%TELLRAW.LOCATOR_NOT_FOUND()%> + $data modify storage aj:temp args merge from entity @s data.locators.$(name) + block execute_at_transform { with storage aj:temp args + $execute \ + positioned ^$(posx) ^$(posy) ^$(posz) \ + rotated ~$(roty) ~$(rotx) \ + run $(command) + } + } + } + + function at_all_locators { + #ARGS: {command: string} + IF (show_function_errors) { + # Assert that the function is being run as the root entity. + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + function *global/errors/function_not_executed_as_root_entity \ + {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} + } + data remove storage aj:temp args + $data modify storage aj:temp args.command set value '$(command)' + execute on passengers if entity @s[tag=<%TAGS.GLOBAL_DATA()%>] run block zzz/at_all_locators/as_data { + REPEAT (Object.values(rig.nodes).filter(v => v.type === 'locator' && v.config?.use_entity)) as locator { + data modify storage aj:temp args merge from entity @s data.locators.<%locator.name%> + block execute_at_transform { with storage aj:temp args + $execute \ + positioned ^$(posx) ^$(posy) ^$(posz) \ + rotated ~$(roty) ~$(rotx) \ + run $(command) + } + } + } + } + } + + IF (has_cameras) { + function as_camera { + #ARGS: {name: string, command: string} + IF (show_function_errors) { + # Assert that the function is being run as the root entity. + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + function *global/errors/function_not_executed_as_root_entity \ + {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} + } + data remove storage aj:temp args + $data modify storage aj:temp args merge value {name:'$(name)', command:'$(command)'} + $execute \ + on passengers \ + if entity @s[tag=<%TAGS.GLOBAL_DATA()%>] \ + run block zzz/as_camera/as_data { {name: $(name)} + data modify storage aj:temp args.uuid set from entity @s data.cameras.$(name) + scoreboard players set #aj.check <%OBJECTIVES.I()%> 0 + block execute_as_uuid { with storage aj:temp args + $execute as $(uuid) at @s run $(command) + scoreboard players set #aj.check <%OBJECTIVES.I()%> 1 + } + execute if score #aj.check <%OBJECTIVES.I()%> matches 0 run tellraw @a <%TELLRAW.CAMERA_NOT_FOUND_ENTITY()%> + } + } + } + dir remove { function all { # Removes all instances of this rig from the world. - execute as @e[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run function *<%export_namespace%>/remove/this + execute as @e[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run function *<%export_namespace%>/remove/this } function entities { @@ -306,7 +387,7 @@ dir <%export_namespace%> { # Removes the rig this function is executed as. IF (show_function_errors) { # Assert that the function is being executed as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } @@ -356,7 +437,7 @@ dir <%export_namespace%> { function apply { IF (show_function_errors) { # Assert that the function is being executed as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } @@ -393,7 +474,7 @@ dir <%export_namespace%> { # Changes the pose of the rig to the the default pose without interpolation IF (show_function_errors) { # Assert that the function is being run as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } diff --git a/src/systems/datapackCompiler/1.20.5/animation.mcb b/src/systems/datapackCompiler/1.20.5/animation.mcb index f76acb8d..737c565c 100644 --- a/src/systems/datapackCompiler/1.20.5/animation.mcb +++ b/src/systems/datapackCompiler/1.20.5/animation.mcb @@ -51,7 +51,7 @@ dir <%export_namespace%> { execute on passengers run data merge entity @s {Glowing: 1b, glow_color_override: <%0xff0000%>} summon minecraft:text_display ~ ~ ~ { \ Tags:['<%TAGS.GLOBAL_ENTITY()%>', '<%TAGS.OUTDATED_RIG_TEXT_DISPLAY()%>', '<%TAGS.NEW()%>'], \ - text:<%TELLRAW.RIG_OUTDATED_TEXT_DISPLAY()%>, \ + text:'<%TELLRAW.RIG_OUTDATED_TEXT_DISPLAY()%>', \ alignment: 'center', \ billboard: 'vertical', \ transformation:{ \ @@ -144,7 +144,7 @@ dir <%export_namespace%> { function play { IF (show_function_errors) { # Assert that the function is being run as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } @@ -158,7 +158,7 @@ dir <%export_namespace%> { function stop { IF (show_function_errors) { # Assert that the function is being run as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } @@ -172,7 +172,7 @@ dir <%export_namespace%> { function pause { IF (show_function_errors) { # Assert that the function is being run as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } @@ -182,7 +182,7 @@ dir <%export_namespace%> { function resume { IF (show_function_errors) { # Assert that the function is being run as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } @@ -192,7 +192,7 @@ dir <%export_namespace%> { function next_frame { IF (show_function_errors) { # Assert that the function is being run as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } @@ -208,7 +208,7 @@ dir <%export_namespace%> { #ARGS: {frame: int} IF (show_function_errors) { # Assert that the function is being run as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } @@ -221,7 +221,7 @@ dir <%export_namespace%> { #ARGS: {frame: int} IF (show_function_errors) { # Assert that the function is being run as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } @@ -235,7 +235,7 @@ dir <%export_namespace%> { #ARGS: {duration: int, to_frame: int} IF (show_function_errors) { # Assert that the function is being run as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } @@ -322,7 +322,7 @@ dir <%export_namespace%> { $execute $(condition)run function *<%export_namespace%>/variants/$(name)/apply } } - execute on passengers run data modify entity @s[type=!marker] start_interpolation set value -1 + execute on passengers run data modify entity @s[tag=!<%TAGS.GLOBAL_DATA()%>] start_interpolation set value -1 return 1 } @@ -501,7 +501,7 @@ dir <%export_namespace%> { # Pauses all animations IF (show_function_errors) { # Assert that the function is being run as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } @@ -530,7 +530,7 @@ dir <%export_namespace%> { interpolation_duration: <%interpolation_duration%>, \ Passengers:<%root_entity_passengers%>, \ } - execute as @e[type=item_display,tag=<%TAGS.NEW()%>,limit=1,distance=..0.01] run block zzz/summon/as_root_entity { + execute as @e[type=minecraft:item_display,tag=<%TAGS.NEW()%>,limit=1,distance=..0.01] run block zzz/summon/as_root_entity { execute store result score @s <%OBJECTIVES.ID()%> run scoreboard players add aj.last_id <%OBJECTIVES.ID()%> 1 execute on passengers if entity @s[tag=<%TAGS.GLOBAL_DATA()%>] run block as_data_entity { @@ -572,14 +572,14 @@ dir <%export_namespace%> { } REPEAT (Object.values(rig.nodes).filter(v => v.type === 'camera')) as camera { - summon item_display \ + summon minecraft:item_display \ ^<%roundTo(camera.default_transform.pos[0], 10)%> \ ^<%roundTo(camera.default_transform.pos[1], 10)%> \ ^<%roundTo(camera.default_transform.pos[2], 10)%> \ {Tags:<%getNodeTags(camera, rig)%>, teleport_duration: 2} execute \ as @n[ \ - type=item_display, \ + type=minecraft:item_display, \ tag=<%TAGS.NEW()%>, \ tag=<%TAGS.PROJECT_CAMERA_NAMED(export_namespace, camera.storage_name)%>, \ distance=..<%camera.max_distance + 1%> \ @@ -701,19 +701,23 @@ dir <%export_namespace%> { #ARGS: {name: string, command: string} IF (show_function_errors) { # Assert that the function is being run as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } - $data modify storage aj:temp args.command set value '$(command)' + data remove storage aj:temp args + $data modify storage aj:temp args merge value {name:'$(name)', command:'$(command)'} $execute \ on passengers \ if entity @s[tag=<%TAGS.GLOBAL_DATA()%>] \ run block zzz/as_locator/as_data { {name: $(name)} $data modify storage aj:temp args.uuid set from entity @s data.uuids.locator_$(name) + scoreboard players set #aj.check <%OBJECTIVES.I()%> 0 block execute_as_uuid { with storage aj:temp args - $execute as $(uuid) run $(command) + $execute as $(uuid) at @s run $(command) + scoreboard players set #aj.check <%OBJECTIVES.I()%> 1 } + execute if score #aj.check <%OBJECTIVES.I()%> matches 0 run tellraw @a <%TELLRAW.LOCATOR_NOT_FOUND_ENTITY()%> } } @@ -721,7 +725,7 @@ dir <%export_namespace%> { #ARGS: {command: string} IF (show_function_errors) { # Assert that the function is being run as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } @@ -731,17 +735,93 @@ dir <%export_namespace%> { REPEAT (Object.values(rig.nodes).filter(v => v.type === 'locator' && v.config?.use_entity)) as locator { data modify storage aj:temp args.uuid set from entity @s data.uuids.<%locator.type + '_' + locator.name%> block execute_as_uuid { with storage aj:temp args - $execute as $(uuid) run $(command) + $execute as $(uuid) at @s run $(command) } } } } } + IF (has_locators) { + function at_locator { + #ARGS: {name: string, command: string} + IF (show_function_errors) { + # Assert that the function is being run as the root entity. + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + function *global/errors/function_not_executed_as_root_entity \ + {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} + } + data remove storage aj:temp args + $data modify storage aj:temp args merge value {name:'$(name)', command:'$(command)'} + $execute \ + on passengers \ + if entity @s[tag=<%TAGS.GLOBAL_DATA()%>] \ + run block zzz/at_locator/as_data { {name: $(name)} + $execute unless data entity @s {data:{locators:{$(name):{}}}} run return run tellraw @a <%TELLRAW.LOCATOR_NOT_FOUND()%> + $data modify storage aj:temp args merge from entity @s data.locators.$(name) + block execute_at_transform { with storage aj:temp args + $execute \ + positioned ^$(posx) ^$(posy) ^$(posz) \ + rotated ~$(roty) ~$(rotx) \ + run $(command) + } + } + } + + function at_all_locators { + #ARGS: {command: string} + IF (show_function_errors) { + # Assert that the function is being run as the root entity. + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + function *global/errors/function_not_executed_as_root_entity \ + {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} + } + data remove storage aj:temp args + $data modify storage aj:temp args.command set value '$(command)' + execute on passengers if entity @s[tag=<%TAGS.GLOBAL_DATA()%>] run block zzz/at_all_locators/as_data { + REPEAT (Object.values(rig.nodes).filter(v => v.type === 'locator' && v.config?.use_entity)) as locator { + data modify storage aj:temp args merge from entity @s data.locators.<%locator.name%> + block execute_at_transform { with storage aj:temp args + $execute \ + positioned ^$(posx) ^$(posy) ^$(posz) \ + rotated ~$(roty) ~$(rotx) \ + run $(command) + } + } + } + } + } + + IF (has_cameras) { + function as_camera { + #ARGS: {name: string, command: string} + IF (show_function_errors) { + # Assert that the function is being run as the root entity. + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + function *global/errors/function_not_executed_as_root_entity \ + {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} + } + data remove storage aj:temp args + $data modify storage aj:temp args merge value {name:'$(name)', command:'$(command)'} + $execute \ + on passengers \ + if entity @s[tag=<%TAGS.GLOBAL_DATA()%>] \ + run block zzz/as_camera/as_data { {name: $(name)} + data modify storage aj:temp args.uuid set from entity @s data.cameras.$(name) + scoreboard players set #aj.check <%OBJECTIVES.I()%> 0 + block execute_as_uuid { with storage aj:temp args + $execute as $(uuid) at @s run $(command) + scoreboard players set #aj.check <%OBJECTIVES.I()%> 1 + } + execute if score #aj.check <%OBJECTIVES.I()%> matches 0 run tellraw @a <%TELLRAW.CAMERA_NOT_FOUND_ENTITY()%> + } + } + } + dir remove { function all { # Removes all instances of this rig from the world. - execute as @e[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run function *<%export_namespace%>/remove/this + execute as @e[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run function *<%export_namespace%>/remove/this } function entities { @@ -753,7 +833,7 @@ dir <%export_namespace%> { # Removes the rig this function is executed as. IF (show_function_errors) { # Assert that the function is being executed as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } @@ -803,7 +883,7 @@ dir <%export_namespace%> { function apply { IF (show_function_errors) { # Assert that the function is being executed as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } @@ -840,7 +920,7 @@ dir <%export_namespace%> { # Changes the pose of the rig to the the default pose with interpolation IF (show_function_errors) { # Assert that the function is being run as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } @@ -856,7 +936,7 @@ dir <%export_namespace%> { # Changes the pose of the rig to the the default pose without interpolation IF (show_function_errors) { # Assert that the function is being run as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } diff --git a/src/systems/datapackCompiler/1.20.5/static.mcb b/src/systems/datapackCompiler/1.20.5/static.mcb index 32aeba93..6b474dd2 100644 --- a/src/systems/datapackCompiler/1.20.5/static.mcb +++ b/src/systems/datapackCompiler/1.20.5/static.mcb @@ -17,24 +17,25 @@ dir <%export_namespace%> { unless data entity @s {data:{rigHash: '<%rigHash%>'}} \ on vehicle \ run block zzz/check_rig_hash { - execute store result storage aj:temp x int 1 store result score #this.x aj.i run data get entity @s Pos[0] 1 - execute store result storage aj:temp y int 1 store result score #this.y aj.i run data get entity @s Pos[1] 1 - execute store result storage aj:temp z int 1 store result score #this.z aj.i run data get entity @s Pos[2] 1 - block show_outdated_warning { with storage aj:temp + data remove storage aj:temp args + execute store result storage aj:temp args.x int 1 store result score #this.x aj.i run data get entity @s Pos[0] 1 + execute store result storage aj:temp args.y int 1 store result score #this.y aj.i run data get entity @s Pos[1] 1 + execute store result storage aj:temp args.z int 1 store result score #this.z aj.i run data get entity @s Pos[2] 1 + block show_outdated_warning { with storage aj:temp args $tellraw @a <%TELLRAW.RIG_OUTDATED()%> } data modify entity @s data.rigHash set value '<%rigHash%>' execute on passengers run data merge entity @s {Glowing: 1b, glow_color_override: <%0xff0000%>} summon minecraft:text_display ~ ~ ~ { \ - Tags:['<%TAGS.GLOBAL_ENTITY()%>', '<%TAGS.OUTDATED_RIG_TEXT_DISPLAY()%>', '<%TAGS.NEW()%>'], \ - text:<%TELLRAW.RIG_OUTDATED_TEXT_DISPLAY()%>, \ - alignment: 'center', \ - billboard: 'vertical', \ - transformation:{ \ - translation:[0f,<%boundingBox[1]/16%>f,0f], \ - left_rotation:[0f,0f,0f,1f], \ - right_rotation:[0f,0f,0f,1f], \ - scale:[1f,1f,1f] \ + Tags:['<%TAGS.GLOBAL_ENTITY()%>', '<%TAGS.OUTDATED_RIG_TEXT_DISPLAY()%>', '<%TAGS.NEW()%>'], \ + text:'<%TELLRAW.RIG_OUTDATED_TEXT_DISPLAY()%>', \ + alignment: 'center', \ + billboard: 'vertical', \ + transformation:{ \ + translation:[0f,<%boundingBox[1]/16%>f,0f], \ + left_rotation:[0f,0f,0f,1f], \ + right_rotation:[0f,0f,0f,1f], \ + scale:[1f,1f,1f] \ } \ } ride @e[type=minecraft:text_display,tag=<%TAGS.NEW()%>,limit=1,distance=..0.01] mount @s @@ -126,7 +127,7 @@ dir <%export_namespace%> { interpolation_duration: <%interpolation_duration%>, \ Passengers:<%root_entity_passengers%>, \ } - execute as @e[type=item_display,tag=<%TAGS.NEW()%>,limit=1,distance=..0.01] run block zzz/summon/as_root_entity { + execute as @e[type=minecraft:item_display,tag=<%TAGS.NEW()%>,limit=1,distance=..0.01] run block zzz/summon/as_root_entity { execute store result score @s <%OBJECTIVES.ID()%> run scoreboard players add aj.last_id <%OBJECTIVES.ID()%> 1 execute on passengers if entity @s[tag=<%TAGS.GLOBAL_DATA()%>] run block as_data_entity { @@ -168,14 +169,14 @@ dir <%export_namespace%> { } REPEAT (Object.values(rig.nodes).filter(v => v.type === 'camera')) as camera { - summon item_display \ + summon minecraft:item_display \ ^<%roundTo(camera.default_transform.pos[0], 10)%> \ ^<%roundTo(camera.default_transform.pos[1], 10)%> \ ^<%roundTo(camera.default_transform.pos[2], 10)%> \ {Tags:<%getNodeTags(camera, rig)%>, teleport_duration: 2} execute \ as @n[ \ - type=item_display, \ + type=minecraft:item_display, \ tag=<%TAGS.NEW()%>, \ tag=<%TAGS.PROJECT_CAMERA_NAMED(export_namespace, camera.storage_name)%>, \ distance=..<%camera.max_distance + 1%> \ @@ -254,19 +255,23 @@ dir <%export_namespace%> { #ARGS: {name: string, command: string} IF (show_function_errors) { # Assert that the function is being run as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } - $data modify storage aj:temp args.command set value '$(command)' + data remove storage aj:temp args + $data modify storage aj:temp args merge value {name:'$(name)', command:'$(command)'} $execute \ on passengers \ if entity @s[tag=<%TAGS.GLOBAL_DATA()%>] \ run block zzz/as_locator/as_data { {name: $(name)} $data modify storage aj:temp args.uuid set from entity @s data.uuids.locator_$(name) + scoreboard players set #aj.check <%OBJECTIVES.I()%> 0 block execute_as_uuid { with storage aj:temp args - $execute as $(uuid) run $(command) + $execute as $(uuid) at @s run $(command) + scoreboard players set #aj.check <%OBJECTIVES.I()%> 1 } + execute if score #aj.check <%OBJECTIVES.I()%> matches 0 run tellraw @a <%TELLRAW.LOCATOR_NOT_FOUND_ENTITY()%> } } @@ -274,7 +279,7 @@ dir <%export_namespace%> { #ARGS: {command: string} IF (show_function_errors) { # Assert that the function is being run as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } @@ -284,17 +289,93 @@ dir <%export_namespace%> { REPEAT (Object.values(rig.nodes).filter(v => v.type === 'locator' && v.config?.use_entity)) as locator { data modify storage aj:temp args.uuid set from entity @s data.uuids.<%locator.type + '_' + locator.name%> block execute_as_uuid { with storage aj:temp args - $execute as $(uuid) run $(command) + $execute as $(uuid) at @s run $(command) } } } } } + IF (has_locators) { + function at_locator { + #ARGS: {name: string, command: string} + IF (show_function_errors) { + # Assert that the function is being run as the root entity. + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + function *global/errors/function_not_executed_as_root_entity \ + {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} + } + data remove storage aj:temp args + $data modify storage aj:temp args merge value {name:'$(name)', command:'$(command)'} + $execute \ + on passengers \ + if entity @s[tag=<%TAGS.GLOBAL_DATA()%>] \ + run block zzz/at_locator/as_data { {name: $(name)} + $execute unless data entity @s {data:{locators:{$(name):{}}}} run return run tellraw @a <%TELLRAW.LOCATOR_NOT_FOUND()%> + $data modify storage aj:temp args merge from entity @s data.locators.$(name) + block execute_at_transform { with storage aj:temp args + $execute \ + positioned ^$(posx) ^$(posy) ^$(posz) \ + rotated ~$(roty) ~$(rotx) \ + run $(command) + } + } + } + + function at_all_locators { + #ARGS: {command: string} + IF (show_function_errors) { + # Assert that the function is being run as the root entity. + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + function *global/errors/function_not_executed_as_root_entity \ + {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} + } + data remove storage aj:temp args + $data modify storage aj:temp args.command set value '$(command)' + execute on passengers if entity @s[tag=<%TAGS.GLOBAL_DATA()%>] run block zzz/at_all_locators/as_data { + REPEAT (Object.values(rig.nodes).filter(v => v.type === 'locator' && v.config?.use_entity)) as locator { + data modify storage aj:temp args merge from entity @s data.locators.<%locator.name%> + block execute_at_transform { with storage aj:temp args + $execute \ + positioned ^$(posx) ^$(posy) ^$(posz) \ + rotated ~$(roty) ~$(rotx) \ + run $(command) + } + } + } + } + } + + IF (has_cameras) { + function as_camera { + #ARGS: {name: string, command: string} + IF (show_function_errors) { + # Assert that the function is being run as the root entity. + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + function *global/errors/function_not_executed_as_root_entity \ + {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} + } + data remove storage aj:temp args + $data modify storage aj:temp args merge value {name:'$(name)', command:'$(command)'} + $execute \ + on passengers \ + if entity @s[tag=<%TAGS.GLOBAL_DATA()%>] \ + run block zzz/as_camera/as_data { {name: $(name)} + data modify storage aj:temp args.uuid set from entity @s data.cameras.$(name) + scoreboard players set #aj.check <%OBJECTIVES.I()%> 0 + block execute_as_uuid { with storage aj:temp args + $execute as $(uuid) at @s run $(command) + scoreboard players set #aj.check <%OBJECTIVES.I()%> 1 + } + execute if score #aj.check <%OBJECTIVES.I()%> matches 0 run tellraw @a <%TELLRAW.CAMERA_NOT_FOUND_ENTITY()%> + } + } + } + dir remove { function all { # Removes all instances of this rig from the world. - execute as @e[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run function *<%export_namespace%>/remove/this + execute as @e[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run function *<%export_namespace%>/remove/this } function entities { @@ -306,7 +387,7 @@ dir <%export_namespace%> { # Removes the rig this function is executed as. IF (show_function_errors) { # Assert that the function is being executed as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } @@ -356,7 +437,7 @@ dir <%export_namespace%> { function apply { IF (show_function_errors) { # Assert that the function is being executed as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } @@ -393,7 +474,7 @@ dir <%export_namespace%> { # Changes the pose of the rig to the the default pose without interpolation IF (show_function_errors) { # Assert that the function is being run as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } diff --git a/src/systems/datapackCompiler/1.21.2/animation.mcb b/src/systems/datapackCompiler/1.21.2/animation.mcb index a2b2874e..694adb9f 100644 --- a/src/systems/datapackCompiler/1.21.2/animation.mcb +++ b/src/systems/datapackCompiler/1.21.2/animation.mcb @@ -51,7 +51,7 @@ dir <%export_namespace%> { execute on passengers run data merge entity @s {Glowing: 1b, glow_color_override: <%0xff0000%>} summon minecraft:text_display ~ ~ ~ { \ Tags:['<%TAGS.GLOBAL_ENTITY()%>', '<%TAGS.OUTDATED_RIG_TEXT_DISPLAY()%>', '<%TAGS.NEW()%>'], \ - text:<%TELLRAW.RIG_OUTDATED_TEXT_DISPLAY()%>, \ + text:'<%TELLRAW.RIG_OUTDATED_TEXT_DISPLAY()%>', \ alignment: 'center', \ billboard: 'vertical', \ transformation:{ \ @@ -144,7 +144,7 @@ dir <%export_namespace%> { function play { IF (show_function_errors) { # Assert that the function is being run as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } @@ -158,7 +158,7 @@ dir <%export_namespace%> { function stop { IF (show_function_errors) { # Assert that the function is being run as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } @@ -172,7 +172,7 @@ dir <%export_namespace%> { function pause { IF (show_function_errors) { # Assert that the function is being run as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } @@ -182,7 +182,7 @@ dir <%export_namespace%> { function resume { IF (show_function_errors) { # Assert that the function is being run as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } @@ -192,7 +192,7 @@ dir <%export_namespace%> { function next_frame { IF (show_function_errors) { # Assert that the function is being run as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } @@ -208,7 +208,7 @@ dir <%export_namespace%> { #ARGS: {frame: int} IF (show_function_errors) { # Assert that the function is being run as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } @@ -221,7 +221,7 @@ dir <%export_namespace%> { #ARGS: {frame: int} IF (show_function_errors) { # Assert that the function is being run as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } @@ -235,7 +235,7 @@ dir <%export_namespace%> { #ARGS: {duration: int, to_frame: int} IF (show_function_errors) { # Assert that the function is being run as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } @@ -322,7 +322,7 @@ dir <%export_namespace%> { $execute $(condition)run function *<%export_namespace%>/variants/$(name)/apply } } - execute on passengers run data modify entity @s[type=!marker] start_interpolation set value -1 + execute on passengers run data modify entity @s[tag=!<%TAGS.GLOBAL_DATA()%>] start_interpolation set value -1 return 1 } @@ -501,7 +501,7 @@ dir <%export_namespace%> { # Pauses all animations IF (show_function_errors) { # Assert that the function is being run as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } @@ -530,7 +530,7 @@ dir <%export_namespace%> { interpolation_duration: <%interpolation_duration%>, \ Passengers:<%root_entity_passengers%>, \ } - execute as @e[type=item_display,tag=<%TAGS.NEW()%>,limit=1,distance=..0.01] run block zzz/summon/as_root_entity { + execute as @e[type=minecraft:item_display,tag=<%TAGS.NEW()%>,limit=1,distance=..0.01] run block zzz/summon/as_root_entity { execute store result score @s <%OBJECTIVES.ID()%> run scoreboard players add aj.last_id <%OBJECTIVES.ID()%> 1 execute on passengers if entity @s[tag=<%TAGS.GLOBAL_DATA()%>] run block as_data_entity { @@ -572,14 +572,14 @@ dir <%export_namespace%> { } REPEAT (Object.values(rig.nodes).filter(v => v.type === 'camera')) as camera { - summon item_display \ + summon minecraft:item_display \ ^<%roundTo(camera.default_transform.pos[0], 10)%> \ ^<%roundTo(camera.default_transform.pos[1], 10)%> \ ^<%roundTo(camera.default_transform.pos[2], 10)%> \ {Tags:<%getNodeTags(camera, rig)%>, teleport_duration: 2} execute \ as @n[ \ - type=item_display, \ + type=minecraft:item_display, \ tag=<%TAGS.NEW()%>, \ tag=<%TAGS.PROJECT_CAMERA_NAMED(export_namespace, camera.storage_name)%>, \ distance=..<%camera.max_distance + 1%> \ @@ -701,19 +701,23 @@ dir <%export_namespace%> { #ARGS: {name: string, command: string} IF (show_function_errors) { # Assert that the function is being run as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } - $data modify storage aj:temp args.command set value '$(command)' + data remove storage aj:temp args + $data modify storage aj:temp args merge value {name:'$(name)', command:'$(command)'} $execute \ on passengers \ if entity @s[tag=<%TAGS.GLOBAL_DATA()%>] \ run block zzz/as_locator/as_data { {name: $(name)} $data modify storage aj:temp args.uuid set from entity @s data.uuids.locator_$(name) + scoreboard players set #aj.check <%OBJECTIVES.I()%> 0 block execute_as_uuid { with storage aj:temp args - $execute as $(uuid) run $(command) + $execute as $(uuid) at @s run $(command) + scoreboard players set #aj.check <%OBJECTIVES.I()%> 1 } + execute if score #aj.check <%OBJECTIVES.I()%> matches 0 run tellraw @a <%TELLRAW.LOCATOR_NOT_FOUND_ENTITY()%> } } @@ -721,7 +725,7 @@ dir <%export_namespace%> { #ARGS: {command: string} IF (show_function_errors) { # Assert that the function is being run as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } @@ -731,17 +735,93 @@ dir <%export_namespace%> { REPEAT (Object.values(rig.nodes).filter(v => v.type === 'locator' && v.config?.use_entity)) as locator { data modify storage aj:temp args.uuid set from entity @s data.uuids.<%locator.type + '_' + locator.name%> block execute_as_uuid { with storage aj:temp args - $execute as $(uuid) run $(command) + $execute as $(uuid) at @s run $(command) } } } } } + IF (has_locators) { + function at_locator { + #ARGS: {name: string, command: string} + IF (show_function_errors) { + # Assert that the function is being run as the root entity. + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + function *global/errors/function_not_executed_as_root_entity \ + {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} + } + data remove storage aj:temp args + $data modify storage aj:temp args merge value {name:'$(name)', command:'$(command)'} + $execute \ + on passengers \ + if entity @s[tag=<%TAGS.GLOBAL_DATA()%>] \ + run block zzz/at_locator/as_data { {name: $(name)} + $execute unless data entity @s {data:{locators:{$(name):{}}}} run return run tellraw @a <%TELLRAW.LOCATOR_NOT_FOUND()%> + $data modify storage aj:temp args merge from entity @s data.locators.$(name) + block execute_at_transform { with storage aj:temp args + $execute \ + positioned ^$(posx) ^$(posy) ^$(posz) \ + rotated ~$(roty) ~$(rotx) \ + run $(command) + } + } + } + + function at_all_locators { + #ARGS: {command: string} + IF (show_function_errors) { + # Assert that the function is being run as the root entity. + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + function *global/errors/function_not_executed_as_root_entity \ + {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} + } + data remove storage aj:temp args + $data modify storage aj:temp args.command set value '$(command)' + execute on passengers if entity @s[tag=<%TAGS.GLOBAL_DATA()%>] run block zzz/at_all_locators/as_data { + REPEAT (Object.values(rig.nodes).filter(v => v.type === 'locator' && v.config?.use_entity)) as locator { + data modify storage aj:temp args merge from entity @s data.locators.<%locator.name%> + block execute_at_transform { with storage aj:temp args + $execute \ + positioned ^$(posx) ^$(posy) ^$(posz) \ + rotated ~$(roty) ~$(rotx) \ + run $(command) + } + } + } + } + } + + IF (has_cameras) { + function as_camera { + #ARGS: {name: string, command: string} + IF (show_function_errors) { + # Assert that the function is being run as the root entity. + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + function *global/errors/function_not_executed_as_root_entity \ + {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} + } + data remove storage aj:temp args + $data modify storage aj:temp args merge value {name:'$(name)', command:'$(command)'} + $execute \ + on passengers \ + if entity @s[tag=<%TAGS.GLOBAL_DATA()%>] \ + run block zzz/as_camera/as_data { {name: $(name)} + data modify storage aj:temp args.uuid set from entity @s data.cameras.$(name) + scoreboard players set #aj.check <%OBJECTIVES.I()%> 0 + block execute_as_uuid { with storage aj:temp args + $execute as $(uuid) at @s run $(command) + scoreboard players set #aj.check <%OBJECTIVES.I()%> 1 + } + execute if score #aj.check <%OBJECTIVES.I()%> matches 0 run tellraw @a <%TELLRAW.CAMERA_NOT_FOUND_ENTITY()%> + } + } + } + dir remove { function all { # Removes all instances of this rig from the world. - execute as @e[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run function *<%export_namespace%>/remove/this + execute as @e[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run function *<%export_namespace%>/remove/this } function entities { @@ -753,7 +833,7 @@ dir <%export_namespace%> { # Removes the rig this function is executed as. IF (show_function_errors) { # Assert that the function is being executed as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } @@ -803,7 +883,7 @@ dir <%export_namespace%> { function apply { IF (show_function_errors) { # Assert that the function is being executed as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } @@ -840,7 +920,7 @@ dir <%export_namespace%> { # Changes the pose of the rig to the the default pose with interpolation IF (show_function_errors) { # Assert that the function is being run as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } @@ -856,7 +936,7 @@ dir <%export_namespace%> { # Changes the pose of the rig to the the default pose without interpolation IF (show_function_errors) { # Assert that the function is being run as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } diff --git a/src/systems/datapackCompiler/1.21.2/static.mcb b/src/systems/datapackCompiler/1.21.2/static.mcb index 2a9b5bd3..5e93d120 100644 --- a/src/systems/datapackCompiler/1.21.2/static.mcb +++ b/src/systems/datapackCompiler/1.21.2/static.mcb @@ -17,24 +17,25 @@ dir <%export_namespace%> { unless data entity @s {data:{rigHash: '<%rigHash%>'}} \ on vehicle \ run block zzz/check_rig_hash { - execute store result storage aj:temp x int 1 store result score #this.x aj.i run data get entity @s Pos[0] 1 - execute store result storage aj:temp y int 1 store result score #this.y aj.i run data get entity @s Pos[1] 1 - execute store result storage aj:temp z int 1 store result score #this.z aj.i run data get entity @s Pos[2] 1 - block show_outdated_warning { with storage aj:temp + data remove storage aj:temp args + execute store result storage aj:temp args.x int 1 store result score #this.x aj.i run data get entity @s Pos[0] 1 + execute store result storage aj:temp args.y int 1 store result score #this.y aj.i run data get entity @s Pos[1] 1 + execute store result storage aj:temp args.z int 1 store result score #this.z aj.i run data get entity @s Pos[2] 1 + block show_outdated_warning { with storage aj:temp args $tellraw @a <%TELLRAW.RIG_OUTDATED()%> } data modify entity @s data.rigHash set value '<%rigHash%>' execute on passengers run data merge entity @s {Glowing: 1b, glow_color_override: <%0xff0000%>} summon minecraft:text_display ~ ~ ~ { \ - Tags:['<%TAGS.GLOBAL_ENTITY()%>', '<%TAGS.OUTDATED_RIG_TEXT_DISPLAY()%>', '<%TAGS.NEW()%>'], \ - text:<%TELLRAW.RIG_OUTDATED_TEXT_DISPLAY()%>, \ - alignment: 'center', \ - billboard: 'vertical', \ - transformation:{ \ - translation:[0f,<%boundingBox[1]/16%>f,0f], \ - left_rotation:[0f,0f,0f,1f], \ - right_rotation:[0f,0f,0f,1f], \ - scale:[1f,1f,1f] \ + Tags:['<%TAGS.GLOBAL_ENTITY()%>', '<%TAGS.OUTDATED_RIG_TEXT_DISPLAY()%>', '<%TAGS.NEW()%>'], \ + text:'<%TELLRAW.RIG_OUTDATED_TEXT_DISPLAY()%>', \ + alignment: 'center', \ + billboard: 'vertical', \ + transformation:{ \ + translation:[0f,<%boundingBox[1]/16%>f,0f], \ + left_rotation:[0f,0f,0f,1f], \ + right_rotation:[0f,0f,0f,1f], \ + scale:[1f,1f,1f] \ } \ } ride @e[type=minecraft:text_display,tag=<%TAGS.NEW()%>,limit=1,distance=..0.01] mount @s @@ -126,7 +127,7 @@ dir <%export_namespace%> { interpolation_duration: <%interpolation_duration%>, \ Passengers:<%root_entity_passengers%>, \ } - execute as @e[type=item_display,tag=<%TAGS.NEW()%>,limit=1,distance=..0.01] run block zzz/summon/as_root_entity { + execute as @e[type=minecraft:item_display,tag=<%TAGS.NEW()%>,limit=1,distance=..0.01] run block zzz/summon/as_root_entity { execute store result score @s <%OBJECTIVES.ID()%> run scoreboard players add aj.last_id <%OBJECTIVES.ID()%> 1 execute on passengers if entity @s[tag=<%TAGS.GLOBAL_DATA()%>] run block as_data_entity { @@ -168,14 +169,14 @@ dir <%export_namespace%> { } REPEAT (Object.values(rig.nodes).filter(v => v.type === 'camera')) as camera { - summon item_display \ + summon minecraft:item_display \ ^<%roundTo(camera.default_transform.pos[0], 10)%> \ ^<%roundTo(camera.default_transform.pos[1], 10)%> \ ^<%roundTo(camera.default_transform.pos[2], 10)%> \ {Tags:<%getNodeTags(camera, rig)%>, teleport_duration: 2} execute \ as @n[ \ - type=item_display, \ + type=minecraft:item_display, \ tag=<%TAGS.NEW()%>, \ tag=<%TAGS.PROJECT_CAMERA_NAMED(export_namespace, camera.storage_name)%>, \ distance=..<%camera.max_distance + 1%> \ @@ -232,6 +233,9 @@ dir <%export_namespace%> { } function *<%export_namespace%>/set_default_pose + # Align the position and rotation of the root with the summon context, then align the passengers with the root. + tp @s ~ ~ ~ ~ ~ + execute at @s on passengers run rotate @s ~ ~ # Apply teleport duration data modify entity @s teleport_duration set value <%teleportation_duration%> execute on passengers run data modify entity @s teleport_duration set value <%teleportation_duration%> @@ -251,19 +255,23 @@ dir <%export_namespace%> { #ARGS: {name: string, command: string} IF (show_function_errors) { # Assert that the function is being run as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } - $data modify storage aj:temp args.command set value '$(command)' + data remove storage aj:temp args + $data modify storage aj:temp args merge value {name:'$(name)', command:'$(command)'} $execute \ on passengers \ if entity @s[tag=<%TAGS.GLOBAL_DATA()%>] \ run block zzz/as_locator/as_data { {name: $(name)} $data modify storage aj:temp args.uuid set from entity @s data.uuids.locator_$(name) + scoreboard players set #aj.check <%OBJECTIVES.I()%> 0 block execute_as_uuid { with storage aj:temp args - $execute as $(uuid) run $(command) + $execute as $(uuid) at @s run $(command) + scoreboard players set #aj.check <%OBJECTIVES.I()%> 1 } + execute if score #aj.check <%OBJECTIVES.I()%> matches 0 run tellraw @a <%TELLRAW.LOCATOR_NOT_FOUND_ENTITY()%> } } @@ -271,7 +279,7 @@ dir <%export_namespace%> { #ARGS: {command: string} IF (show_function_errors) { # Assert that the function is being run as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } @@ -281,17 +289,93 @@ dir <%export_namespace%> { REPEAT (Object.values(rig.nodes).filter(v => v.type === 'locator' && v.config?.use_entity)) as locator { data modify storage aj:temp args.uuid set from entity @s data.uuids.<%locator.type + '_' + locator.name%> block execute_as_uuid { with storage aj:temp args - $execute as $(uuid) run $(command) + $execute as $(uuid) at @s run $(command) + } + } + } + } + } + + IF (has_locators) { + function at_locator { + #ARGS: {name: string, command: string} + IF (show_function_errors) { + # Assert that the function is being run as the root entity. + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + function *global/errors/function_not_executed_as_root_entity \ + {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} + } + data remove storage aj:temp args + $data modify storage aj:temp args merge value {name:'$(name)', command:'$(command)'} + $execute \ + on passengers \ + if entity @s[tag=<%TAGS.GLOBAL_DATA()%>] \ + run block zzz/at_locator/as_data { {name: $(name)} + $execute unless data entity @s {data:{locators:{$(name):{}}}} run return run tellraw @a <%TELLRAW.LOCATOR_NOT_FOUND()%> + $data modify storage aj:temp args merge from entity @s data.locators.$(name) + block execute_at_transform { with storage aj:temp args + $execute \ + positioned ^$(posx) ^$(posy) ^$(posz) \ + rotated ~$(roty) ~$(rotx) \ + run $(command) + } + } + } + + function at_all_locators { + #ARGS: {command: string} + IF (show_function_errors) { + # Assert that the function is being run as the root entity. + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + function *global/errors/function_not_executed_as_root_entity \ + {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} + } + data remove storage aj:temp args + $data modify storage aj:temp args.command set value '$(command)' + execute on passengers if entity @s[tag=<%TAGS.GLOBAL_DATA()%>] run block zzz/at_all_locators/as_data { + REPEAT (Object.values(rig.nodes).filter(v => v.type === 'locator' && v.config?.use_entity)) as locator { + data modify storage aj:temp args merge from entity @s data.locators.<%locator.name%> + block execute_at_transform { with storage aj:temp args + $execute \ + positioned ^$(posx) ^$(posy) ^$(posz) \ + rotated ~$(roty) ~$(rotx) \ + run $(command) } } } } } + IF (has_cameras) { + function as_camera { + #ARGS: {name: string, command: string} + IF (show_function_errors) { + # Assert that the function is being run as the root entity. + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + function *global/errors/function_not_executed_as_root_entity \ + {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} + } + data remove storage aj:temp args + $data modify storage aj:temp args merge value {name:'$(name)', command:'$(command)'} + $execute \ + on passengers \ + if entity @s[tag=<%TAGS.GLOBAL_DATA()%>] \ + run block zzz/as_camera/as_data { {name: $(name)} + data modify storage aj:temp args.uuid set from entity @s data.cameras.$(name) + scoreboard players set #aj.check <%OBJECTIVES.I()%> 0 + block execute_as_uuid { with storage aj:temp args + $execute as $(uuid) at @s run $(command) + scoreboard players set #aj.check <%OBJECTIVES.I()%> 1 + } + execute if score #aj.check <%OBJECTIVES.I()%> matches 0 run tellraw @a <%TELLRAW.CAMERA_NOT_FOUND_ENTITY()%> + } + } + } + dir remove { function all { # Removes all instances of this rig from the world. - execute as @e[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run function *<%export_namespace%>/remove/this + execute as @e[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run function *<%export_namespace%>/remove/this } function entities { @@ -303,7 +387,7 @@ dir <%export_namespace%> { # Removes the rig this function is executed as. IF (show_function_errors) { # Assert that the function is being executed as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } @@ -353,7 +437,7 @@ dir <%export_namespace%> { function apply { IF (show_function_errors) { # Assert that the function is being executed as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } @@ -390,7 +474,7 @@ dir <%export_namespace%> { # Changes the pose of the rig to the the default pose without interpolation IF (show_function_errors) { # Assert that the function is being run as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } diff --git a/src/systems/datapackCompiler/1.21.4/animation.mcb b/src/systems/datapackCompiler/1.21.4/animation.mcb index 2340d35a..4ad4b9b6 100644 --- a/src/systems/datapackCompiler/1.21.4/animation.mcb +++ b/src/systems/datapackCompiler/1.21.4/animation.mcb @@ -51,7 +51,7 @@ dir <%export_namespace%> { execute on passengers run data merge entity @s {Glowing: 1b, glow_color_override: <%0xff0000%>} summon minecraft:text_display ~ ~ ~ { \ Tags:['<%TAGS.GLOBAL_ENTITY()%>', '<%TAGS.OUTDATED_RIG_TEXT_DISPLAY()%>', '<%TAGS.NEW()%>'], \ - text:<%TELLRAW.RIG_OUTDATED_TEXT_DISPLAY()%>, \ + text:'<%TELLRAW.RIG_OUTDATED_TEXT_DISPLAY()%>', \ alignment: 'center', \ billboard: 'vertical', \ transformation:{ \ @@ -144,7 +144,7 @@ dir <%export_namespace%> { function play { IF (show_function_errors) { # Assert that the function is being run as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } @@ -158,7 +158,7 @@ dir <%export_namespace%> { function stop { IF (show_function_errors) { # Assert that the function is being run as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } @@ -172,7 +172,7 @@ dir <%export_namespace%> { function pause { IF (show_function_errors) { # Assert that the function is being run as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } @@ -182,7 +182,7 @@ dir <%export_namespace%> { function resume { IF (show_function_errors) { # Assert that the function is being run as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } @@ -192,7 +192,7 @@ dir <%export_namespace%> { function next_frame { IF (show_function_errors) { # Assert that the function is being run as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } @@ -208,7 +208,7 @@ dir <%export_namespace%> { #ARGS: {frame: int} IF (show_function_errors) { # Assert that the function is being run as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } @@ -221,7 +221,7 @@ dir <%export_namespace%> { #ARGS: {frame: int} IF (show_function_errors) { # Assert that the function is being run as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } @@ -235,7 +235,7 @@ dir <%export_namespace%> { #ARGS: {duration: int, to_frame: int} IF (show_function_errors) { # Assert that the function is being run as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } @@ -322,7 +322,7 @@ dir <%export_namespace%> { $execute $(condition)run function *<%export_namespace%>/variants/$(name)/apply } } - execute on passengers run data modify entity @s[type=!marker] start_interpolation set value -1 + execute on passengers run data modify entity @s[tag=!<%TAGS.GLOBAL_DATA()%>] start_interpolation set value -1 return 1 } @@ -501,7 +501,7 @@ dir <%export_namespace%> { # Pauses all animations IF (show_function_errors) { # Assert that the function is being run as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } @@ -530,7 +530,7 @@ dir <%export_namespace%> { interpolation_duration: <%interpolation_duration%>, \ Passengers:<%root_entity_passengers%>, \ } - execute as @e[type=item_display,tag=<%TAGS.NEW()%>,limit=1,distance=..0.01] run block zzz/summon/as_root_entity { + execute as @e[type=minecraft:item_display,tag=<%TAGS.NEW()%>,limit=1,distance=..0.01] run block zzz/summon/as_root_entity { execute store result score @s <%OBJECTIVES.ID()%> run scoreboard players add aj.last_id <%OBJECTIVES.ID()%> 1 execute on passengers if entity @s[tag=<%TAGS.GLOBAL_DATA()%>] run block as_data_entity { @@ -572,14 +572,14 @@ dir <%export_namespace%> { } REPEAT (Object.values(rig.nodes).filter(v => v.type === 'camera')) as camera { - summon item_display \ + summon minecraft:item_display \ ^<%roundTo(camera.default_transform.pos[0], 10)%> \ ^<%roundTo(camera.default_transform.pos[1], 10)%> \ ^<%roundTo(camera.default_transform.pos[2], 10)%> \ {Tags:<%getNodeTags(camera, rig)%>, teleport_duration: 2} execute \ as @n[ \ - type=item_display, \ + type=minecraft:item_display, \ tag=<%TAGS.NEW()%>, \ tag=<%TAGS.PROJECT_CAMERA_NAMED(export_namespace, camera.storage_name)%>, \ distance=..<%camera.max_distance + 1%> \ @@ -701,19 +701,23 @@ dir <%export_namespace%> { #ARGS: {name: string, command: string} IF (show_function_errors) { # Assert that the function is being run as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } - $data modify storage aj:temp args.command set value '$(command)' + data remove storage aj:temp args + $data modify storage aj:temp args merge value {name:'$(name)', command:'$(command)'} $execute \ on passengers \ if entity @s[tag=<%TAGS.GLOBAL_DATA()%>] \ run block zzz/as_locator/as_data { {name: $(name)} $data modify storage aj:temp args.uuid set from entity @s data.uuids.locator_$(name) + scoreboard players set #aj.check <%OBJECTIVES.I()%> 0 block execute_as_uuid { with storage aj:temp args - $execute as $(uuid) run $(command) + $execute as $(uuid) at @s run $(command) + scoreboard players set #aj.check <%OBJECTIVES.I()%> 1 } + execute if score #aj.check <%OBJECTIVES.I()%> matches 0 run tellraw @a <%TELLRAW.LOCATOR_NOT_FOUND_ENTITY()%> } } @@ -721,7 +725,7 @@ dir <%export_namespace%> { #ARGS: {command: string} IF (show_function_errors) { # Assert that the function is being run as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } @@ -731,17 +735,93 @@ dir <%export_namespace%> { REPEAT (Object.values(rig.nodes).filter(v => v.type === 'locator' && v.config?.use_entity)) as locator { data modify storage aj:temp args.uuid set from entity @s data.uuids.<%locator.type + '_' + locator.name%> block execute_as_uuid { with storage aj:temp args - $execute as $(uuid) run $(command) + $execute as $(uuid) at @s run $(command) } } } } } + IF (has_locators) { + function at_locator { + #ARGS: {name: string, command: string} + IF (show_function_errors) { + # Assert that the function is being run as the root entity. + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + function *global/errors/function_not_executed_as_root_entity \ + {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} + } + data remove storage aj:temp args + $data modify storage aj:temp args merge value {name:'$(name)', command:'$(command)'} + $execute \ + on passengers \ + if entity @s[tag=<%TAGS.GLOBAL_DATA()%>] \ + run block zzz/at_locator/as_data { {name: $(name)} + $execute unless data entity @s {data:{locators:{$(name):{}}}} run return run tellraw @a <%TELLRAW.LOCATOR_NOT_FOUND()%> + $data modify storage aj:temp args merge from entity @s data.locators.$(name) + block execute_at_transform { with storage aj:temp args + $execute \ + positioned ^$(posx) ^$(posy) ^$(posz) \ + rotated ~$(roty) ~$(rotx) \ + run $(command) + } + } + } + + function at_all_locators { + #ARGS: {command: string} + IF (show_function_errors) { + # Assert that the function is being run as the root entity. + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + function *global/errors/function_not_executed_as_root_entity \ + {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} + } + data remove storage aj:temp args + $data modify storage aj:temp args.command set value '$(command)' + execute on passengers if entity @s[tag=<%TAGS.GLOBAL_DATA()%>] run block zzz/at_all_locators/as_data { + REPEAT (Object.values(rig.nodes).filter(v => v.type === 'locator' && v.config?.use_entity)) as locator { + data modify storage aj:temp args merge from entity @s data.locators.<%locator.name%> + block execute_at_transform { with storage aj:temp args + $execute \ + positioned ^$(posx) ^$(posy) ^$(posz) \ + rotated ~$(roty) ~$(rotx) \ + run $(command) + } + } + } + } + } + + IF (has_cameras) { + function as_camera { + #ARGS: {name: string, command: string} + IF (show_function_errors) { + # Assert that the function is being run as the root entity. + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + function *global/errors/function_not_executed_as_root_entity \ + {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} + } + data remove storage aj:temp args + $data modify storage aj:temp args merge value {name:'$(name)', command:'$(command)'} + $execute \ + on passengers \ + if entity @s[tag=<%TAGS.GLOBAL_DATA()%>] \ + run block zzz/as_camera/as_data { {name: $(name)} + data modify storage aj:temp args.uuid set from entity @s data.cameras.$(name) + scoreboard players set #aj.check <%OBJECTIVES.I()%> 0 + block execute_as_uuid { with storage aj:temp args + $execute as $(uuid) at @s run $(command) + scoreboard players set #aj.check <%OBJECTIVES.I()%> 1 + } + execute if score #aj.check <%OBJECTIVES.I()%> matches 0 run tellraw @a <%TELLRAW.CAMERA_NOT_FOUND_ENTITY()%> + } + } + } + dir remove { function all { # Removes all instances of this rig from the world. - execute as @e[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run function *<%export_namespace%>/remove/this + execute as @e[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run function *<%export_namespace%>/remove/this } function entities { @@ -753,7 +833,7 @@ dir <%export_namespace%> { # Removes the rig this function is executed as. IF (show_function_errors) { # Assert that the function is being executed as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } @@ -803,7 +883,7 @@ dir <%export_namespace%> { function apply { IF (show_function_errors) { # Assert that the function is being executed as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } @@ -840,7 +920,7 @@ dir <%export_namespace%> { # Changes the pose of the rig to the the default pose with interpolation IF (show_function_errors) { # Assert that the function is being run as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } @@ -856,7 +936,7 @@ dir <%export_namespace%> { # Changes the pose of the rig to the the default pose without interpolation IF (show_function_errors) { # Assert that the function is being run as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } diff --git a/src/systems/datapackCompiler/1.21.4/static.mcb b/src/systems/datapackCompiler/1.21.4/static.mcb index 4b264b8e..b611a990 100644 --- a/src/systems/datapackCompiler/1.21.4/static.mcb +++ b/src/systems/datapackCompiler/1.21.4/static.mcb @@ -17,24 +17,25 @@ dir <%export_namespace%> { unless data entity @s {data:{rigHash: '<%rigHash%>'}} \ on vehicle \ run block zzz/check_rig_hash { - execute store result storage aj:temp x int 1 store result score #this.x aj.i run data get entity @s Pos[0] 1 - execute store result storage aj:temp y int 1 store result score #this.y aj.i run data get entity @s Pos[1] 1 - execute store result storage aj:temp z int 1 store result score #this.z aj.i run data get entity @s Pos[2] 1 - block show_outdated_warning { with storage aj:temp + data remove storage aj:temp args + execute store result storage aj:temp args.x int 1 store result score #this.x aj.i run data get entity @s Pos[0] 1 + execute store result storage aj:temp args.y int 1 store result score #this.y aj.i run data get entity @s Pos[1] 1 + execute store result storage aj:temp args.z int 1 store result score #this.z aj.i run data get entity @s Pos[2] 1 + block show_outdated_warning { with storage aj:temp args $tellraw @a <%TELLRAW.RIG_OUTDATED()%> } data modify entity @s data.rigHash set value '<%rigHash%>' execute on passengers run data merge entity @s {Glowing: 1b, glow_color_override: <%0xff0000%>} summon minecraft:text_display ~ ~ ~ { \ - Tags:['<%TAGS.GLOBAL_ENTITY()%>', '<%TAGS.OUTDATED_RIG_TEXT_DISPLAY()%>', '<%TAGS.NEW()%>'], \ - text:<%TELLRAW.RIG_OUTDATED_TEXT_DISPLAY()%>, \ - alignment: 'center', \ - billboard: 'vertical', \ - transformation:{ \ - translation:[0f,<%boundingBox[1]/16%>f,0f], \ - left_rotation:[0f,0f,0f,1f], \ - right_rotation:[0f,0f,0f,1f], \ - scale:[1f,1f,1f] \ + Tags:['<%TAGS.GLOBAL_ENTITY()%>', '<%TAGS.OUTDATED_RIG_TEXT_DISPLAY()%>', '<%TAGS.NEW()%>'], \ + text:'<%TELLRAW.RIG_OUTDATED_TEXT_DISPLAY()%>', \ + alignment: 'center', \ + billboard: 'vertical', \ + transformation:{ \ + translation:[0f,<%boundingBox[1]/16%>f,0f], \ + left_rotation:[0f,0f,0f,1f], \ + right_rotation:[0f,0f,0f,1f], \ + scale:[1f,1f,1f] \ } \ } ride @e[type=minecraft:text_display,tag=<%TAGS.NEW()%>,limit=1,distance=..0.01] mount @s @@ -126,7 +127,7 @@ dir <%export_namespace%> { interpolation_duration: <%interpolation_duration%>, \ Passengers:<%root_entity_passengers%>, \ } - execute as @e[type=item_display,tag=<%TAGS.NEW()%>,limit=1,distance=..0.01] run block zzz/summon/as_root_entity { + execute as @e[type=minecraft:item_display,tag=<%TAGS.NEW()%>,limit=1,distance=..0.01] run block zzz/summon/as_root_entity { execute store result score @s <%OBJECTIVES.ID()%> run scoreboard players add aj.last_id <%OBJECTIVES.ID()%> 1 execute on passengers if entity @s[tag=<%TAGS.GLOBAL_DATA()%>] run block as_data_entity { @@ -168,14 +169,14 @@ dir <%export_namespace%> { } REPEAT (Object.values(rig.nodes).filter(v => v.type === 'camera')) as camera { - summon item_display \ + summon minecraft:item_display \ ^<%roundTo(camera.default_transform.pos[0], 10)%> \ ^<%roundTo(camera.default_transform.pos[1], 10)%> \ ^<%roundTo(camera.default_transform.pos[2], 10)%> \ {Tags:<%getNodeTags(camera, rig)%>, teleport_duration: 2} execute \ as @n[ \ - type=item_display, \ + type=minecraft:item_display, \ tag=<%TAGS.NEW()%>, \ tag=<%TAGS.PROJECT_CAMERA_NAMED(export_namespace, camera.storage_name)%>, \ distance=..<%camera.max_distance + 1%> \ @@ -254,19 +255,23 @@ dir <%export_namespace%> { #ARGS: {name: string, command: string} IF (show_function_errors) { # Assert that the function is being run as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } - $data modify storage aj:temp args.command set value '$(command)' + data remove storage aj:temp args + $data modify storage aj:temp args merge value {name:'$(name)', command:'$(command)'} $execute \ on passengers \ if entity @s[tag=<%TAGS.GLOBAL_DATA()%>] \ run block zzz/as_locator/as_data { {name: $(name)} $data modify storage aj:temp args.uuid set from entity @s data.uuids.locator_$(name) + scoreboard players set #aj.check <%OBJECTIVES.I()%> 0 block execute_as_uuid { with storage aj:temp args - $execute as $(uuid) run $(command) + $execute as $(uuid) at @s run $(command) + scoreboard players set #aj.check <%OBJECTIVES.I()%> 1 } + execute if score #aj.check <%OBJECTIVES.I()%> matches 0 run tellraw @a <%TELLRAW.LOCATOR_NOT_FOUND_ENTITY()%> } } @@ -274,7 +279,7 @@ dir <%export_namespace%> { #ARGS: {command: string} IF (show_function_errors) { # Assert that the function is being run as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } @@ -284,17 +289,93 @@ dir <%export_namespace%> { REPEAT (Object.values(rig.nodes).filter(v => v.type === 'locator' && v.config?.use_entity)) as locator { data modify storage aj:temp args.uuid set from entity @s data.uuids.<%locator.type + '_' + locator.name%> block execute_as_uuid { with storage aj:temp args - $execute as $(uuid) run $(command) + $execute as $(uuid) at @s run $(command) } } } } } + IF (has_locators) { + function at_locator { + #ARGS: {name: string, command: string} + IF (show_function_errors) { + # Assert that the function is being run as the root entity. + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + function *global/errors/function_not_executed_as_root_entity \ + {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} + } + data remove storage aj:temp args + $data modify storage aj:temp args merge value {name:'$(name)', command:'$(command)'} + $execute \ + on passengers \ + if entity @s[tag=<%TAGS.GLOBAL_DATA()%>] \ + run block zzz/at_locator/as_data { {name: $(name)} + $execute unless data entity @s {data:{locators:{$(name):{}}}} run return run tellraw @a <%TELLRAW.LOCATOR_NOT_FOUND()%> + $data modify storage aj:temp args merge from entity @s data.locators.$(name) + block execute_at_transform { with storage aj:temp args + $execute \ + positioned ^$(posx) ^$(posy) ^$(posz) \ + rotated ~$(roty) ~$(rotx) \ + run $(command) + } + } + } + + function at_all_locators { + #ARGS: {command: string} + IF (show_function_errors) { + # Assert that the function is being run as the root entity. + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + function *global/errors/function_not_executed_as_root_entity \ + {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} + } + data remove storage aj:temp args + $data modify storage aj:temp args.command set value '$(command)' + execute on passengers if entity @s[tag=<%TAGS.GLOBAL_DATA()%>] run block zzz/at_all_locators/as_data { + REPEAT (Object.values(rig.nodes).filter(v => v.type === 'locator' && v.config?.use_entity)) as locator { + data modify storage aj:temp args merge from entity @s data.locators.<%locator.name%> + block execute_at_transform { with storage aj:temp args + $execute \ + positioned ^$(posx) ^$(posy) ^$(posz) \ + rotated ~$(roty) ~$(rotx) \ + run $(command) + } + } + } + } + } + + IF (has_cameras) { + function as_camera { + #ARGS: {name: string, command: string} + IF (show_function_errors) { + # Assert that the function is being run as the root entity. + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + function *global/errors/function_not_executed_as_root_entity \ + {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} + } + data remove storage aj:temp args + $data modify storage aj:temp args merge value {name:'$(name)', command:'$(command)'} + $execute \ + on passengers \ + if entity @s[tag=<%TAGS.GLOBAL_DATA()%>] \ + run block zzz/as_camera/as_data { {name: $(name)} + data modify storage aj:temp args.uuid set from entity @s data.cameras.$(name) + scoreboard players set #aj.check <%OBJECTIVES.I()%> 0 + block execute_as_uuid { with storage aj:temp args + $execute as $(uuid) at @s run $(command) + scoreboard players set #aj.check <%OBJECTIVES.I()%> 1 + } + execute if score #aj.check <%OBJECTIVES.I()%> matches 0 run tellraw @a <%TELLRAW.CAMERA_NOT_FOUND_ENTITY()%> + } + } + } + dir remove { function all { # Removes all instances of this rig from the world. - execute as @e[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run function *<%export_namespace%>/remove/this + execute as @e[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run function *<%export_namespace%>/remove/this } function entities { @@ -306,7 +387,7 @@ dir <%export_namespace%> { # Removes the rig this function is executed as. IF (show_function_errors) { # Assert that the function is being executed as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } @@ -356,7 +437,7 @@ dir <%export_namespace%> { function apply { IF (show_function_errors) { # Assert that the function is being executed as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } @@ -393,7 +474,7 @@ dir <%export_namespace%> { # Changes the pose of the rig to the the default pose without interpolation IF (show_function_errors) { # Assert that the function is being run as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } diff --git a/src/systems/datapackCompiler/1.21.5/animation.mcb b/src/systems/datapackCompiler/1.21.5/animation.mcb index 0b5351a0..a58f981d 100644 --- a/src/systems/datapackCompiler/1.21.5/animation.mcb +++ b/src/systems/datapackCompiler/1.21.5/animation.mcb @@ -144,7 +144,7 @@ dir <%export_namespace%> { function play { IF (show_function_errors) { # Assert that the function is being run as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } @@ -158,7 +158,7 @@ dir <%export_namespace%> { function stop { IF (show_function_errors) { # Assert that the function is being run as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } @@ -172,7 +172,7 @@ dir <%export_namespace%> { function pause { IF (show_function_errors) { # Assert that the function is being run as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } @@ -182,7 +182,7 @@ dir <%export_namespace%> { function resume { IF (show_function_errors) { # Assert that the function is being run as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } @@ -192,7 +192,7 @@ dir <%export_namespace%> { function next_frame { IF (show_function_errors) { # Assert that the function is being run as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } @@ -208,7 +208,7 @@ dir <%export_namespace%> { #ARGS: {frame: int} IF (show_function_errors) { # Assert that the function is being run as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } @@ -221,7 +221,7 @@ dir <%export_namespace%> { #ARGS: {frame: int} IF (show_function_errors) { # Assert that the function is being run as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } @@ -235,7 +235,7 @@ dir <%export_namespace%> { #ARGS: {duration: int, to_frame: int} IF (show_function_errors) { # Assert that the function is being run as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } @@ -322,7 +322,7 @@ dir <%export_namespace%> { $execute $(condition)run function *<%export_namespace%>/variants/$(name)/apply } } - execute on passengers run data modify entity @s[type=!marker] start_interpolation set value -1 + execute on passengers run data modify entity @s[tag=!<%TAGS.GLOBAL_DATA()%>] start_interpolation set value -1 return 1 } @@ -501,7 +501,7 @@ dir <%export_namespace%> { # Pauses all animations IF (show_function_errors) { # Assert that the function is being run as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } @@ -530,7 +530,7 @@ dir <%export_namespace%> { interpolation_duration: <%interpolation_duration%>, \ Passengers:<%root_entity_passengers%>, \ } - execute as @e[type=item_display,tag=<%TAGS.NEW()%>,limit=1,distance=..0.01] run block zzz/summon/as_root_entity { + execute as @e[type=minecraft:item_display,tag=<%TAGS.NEW()%>,limit=1,distance=..0.01] run block zzz/summon/as_root_entity { execute store result score @s <%OBJECTIVES.ID()%> run scoreboard players add aj.last_id <%OBJECTIVES.ID()%> 1 execute on passengers if entity @s[tag=<%TAGS.GLOBAL_DATA()%>] run block as_data_entity { @@ -572,14 +572,14 @@ dir <%export_namespace%> { } REPEAT (Object.values(rig.nodes).filter(v => v.type === 'camera')) as camera { - summon item_display \ + summon minecraft:item_display \ ^<%roundTo(camera.default_transform.pos[0], 10)%> \ ^<%roundTo(camera.default_transform.pos[1], 10)%> \ ^<%roundTo(camera.default_transform.pos[2], 10)%> \ {Tags:<%getNodeTags(camera, rig)%>, teleport_duration: 2} execute \ as @n[ \ - type=item_display, \ + type=minecraft:item_display, \ tag=<%TAGS.NEW()%>, \ tag=<%TAGS.PROJECT_CAMERA_NAMED(export_namespace, camera.storage_name)%>, \ distance=..<%camera.max_distance + 1%> \ @@ -701,7 +701,7 @@ dir <%export_namespace%> { #ARGS: {name: string, command: string} IF (show_function_errors) { # Assert that the function is being run as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } @@ -725,7 +725,7 @@ dir <%export_namespace%> { #ARGS: {command: string} IF (show_function_errors) { # Assert that the function is being run as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } @@ -747,7 +747,7 @@ dir <%export_namespace%> { #ARGS: {name: string, command: string} IF (show_function_errors) { # Assert that the function is being run as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } @@ -772,7 +772,7 @@ dir <%export_namespace%> { #ARGS: {command: string} IF (show_function_errors) { # Assert that the function is being run as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } @@ -797,7 +797,7 @@ dir <%export_namespace%> { #ARGS: {name: string, command: string} IF (show_function_errors) { # Assert that the function is being run as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } @@ -821,7 +821,7 @@ dir <%export_namespace%> { dir remove { function all { # Removes all instances of this rig from the world. - execute as @e[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run function *<%export_namespace%>/remove/this + execute as @e[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run function *<%export_namespace%>/remove/this } function entities { @@ -833,7 +833,7 @@ dir <%export_namespace%> { # Removes the rig this function is executed as. IF (show_function_errors) { # Assert that the function is being executed as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } @@ -883,7 +883,7 @@ dir <%export_namespace%> { function apply { IF (show_function_errors) { # Assert that the function is being executed as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } @@ -920,7 +920,7 @@ dir <%export_namespace%> { # Changes the pose of the rig to the the default pose with interpolation IF (show_function_errors) { # Assert that the function is being run as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } @@ -936,7 +936,7 @@ dir <%export_namespace%> { # Changes the pose of the rig to the the default pose without interpolation IF (show_function_errors) { # Assert that the function is being run as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } diff --git a/src/systems/datapackCompiler/1.21.5/static.mcb b/src/systems/datapackCompiler/1.21.5/static.mcb index 4b264b8e..b611a990 100644 --- a/src/systems/datapackCompiler/1.21.5/static.mcb +++ b/src/systems/datapackCompiler/1.21.5/static.mcb @@ -17,24 +17,25 @@ dir <%export_namespace%> { unless data entity @s {data:{rigHash: '<%rigHash%>'}} \ on vehicle \ run block zzz/check_rig_hash { - execute store result storage aj:temp x int 1 store result score #this.x aj.i run data get entity @s Pos[0] 1 - execute store result storage aj:temp y int 1 store result score #this.y aj.i run data get entity @s Pos[1] 1 - execute store result storage aj:temp z int 1 store result score #this.z aj.i run data get entity @s Pos[2] 1 - block show_outdated_warning { with storage aj:temp + data remove storage aj:temp args + execute store result storage aj:temp args.x int 1 store result score #this.x aj.i run data get entity @s Pos[0] 1 + execute store result storage aj:temp args.y int 1 store result score #this.y aj.i run data get entity @s Pos[1] 1 + execute store result storage aj:temp args.z int 1 store result score #this.z aj.i run data get entity @s Pos[2] 1 + block show_outdated_warning { with storage aj:temp args $tellraw @a <%TELLRAW.RIG_OUTDATED()%> } data modify entity @s data.rigHash set value '<%rigHash%>' execute on passengers run data merge entity @s {Glowing: 1b, glow_color_override: <%0xff0000%>} summon minecraft:text_display ~ ~ ~ { \ - Tags:['<%TAGS.GLOBAL_ENTITY()%>', '<%TAGS.OUTDATED_RIG_TEXT_DISPLAY()%>', '<%TAGS.NEW()%>'], \ - text:<%TELLRAW.RIG_OUTDATED_TEXT_DISPLAY()%>, \ - alignment: 'center', \ - billboard: 'vertical', \ - transformation:{ \ - translation:[0f,<%boundingBox[1]/16%>f,0f], \ - left_rotation:[0f,0f,0f,1f], \ - right_rotation:[0f,0f,0f,1f], \ - scale:[1f,1f,1f] \ + Tags:['<%TAGS.GLOBAL_ENTITY()%>', '<%TAGS.OUTDATED_RIG_TEXT_DISPLAY()%>', '<%TAGS.NEW()%>'], \ + text:'<%TELLRAW.RIG_OUTDATED_TEXT_DISPLAY()%>', \ + alignment: 'center', \ + billboard: 'vertical', \ + transformation:{ \ + translation:[0f,<%boundingBox[1]/16%>f,0f], \ + left_rotation:[0f,0f,0f,1f], \ + right_rotation:[0f,0f,0f,1f], \ + scale:[1f,1f,1f] \ } \ } ride @e[type=minecraft:text_display,tag=<%TAGS.NEW()%>,limit=1,distance=..0.01] mount @s @@ -126,7 +127,7 @@ dir <%export_namespace%> { interpolation_duration: <%interpolation_duration%>, \ Passengers:<%root_entity_passengers%>, \ } - execute as @e[type=item_display,tag=<%TAGS.NEW()%>,limit=1,distance=..0.01] run block zzz/summon/as_root_entity { + execute as @e[type=minecraft:item_display,tag=<%TAGS.NEW()%>,limit=1,distance=..0.01] run block zzz/summon/as_root_entity { execute store result score @s <%OBJECTIVES.ID()%> run scoreboard players add aj.last_id <%OBJECTIVES.ID()%> 1 execute on passengers if entity @s[tag=<%TAGS.GLOBAL_DATA()%>] run block as_data_entity { @@ -168,14 +169,14 @@ dir <%export_namespace%> { } REPEAT (Object.values(rig.nodes).filter(v => v.type === 'camera')) as camera { - summon item_display \ + summon minecraft:item_display \ ^<%roundTo(camera.default_transform.pos[0], 10)%> \ ^<%roundTo(camera.default_transform.pos[1], 10)%> \ ^<%roundTo(camera.default_transform.pos[2], 10)%> \ {Tags:<%getNodeTags(camera, rig)%>, teleport_duration: 2} execute \ as @n[ \ - type=item_display, \ + type=minecraft:item_display, \ tag=<%TAGS.NEW()%>, \ tag=<%TAGS.PROJECT_CAMERA_NAMED(export_namespace, camera.storage_name)%>, \ distance=..<%camera.max_distance + 1%> \ @@ -254,19 +255,23 @@ dir <%export_namespace%> { #ARGS: {name: string, command: string} IF (show_function_errors) { # Assert that the function is being run as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } - $data modify storage aj:temp args.command set value '$(command)' + data remove storage aj:temp args + $data modify storage aj:temp args merge value {name:'$(name)', command:'$(command)'} $execute \ on passengers \ if entity @s[tag=<%TAGS.GLOBAL_DATA()%>] \ run block zzz/as_locator/as_data { {name: $(name)} $data modify storage aj:temp args.uuid set from entity @s data.uuids.locator_$(name) + scoreboard players set #aj.check <%OBJECTIVES.I()%> 0 block execute_as_uuid { with storage aj:temp args - $execute as $(uuid) run $(command) + $execute as $(uuid) at @s run $(command) + scoreboard players set #aj.check <%OBJECTIVES.I()%> 1 } + execute if score #aj.check <%OBJECTIVES.I()%> matches 0 run tellraw @a <%TELLRAW.LOCATOR_NOT_FOUND_ENTITY()%> } } @@ -274,7 +279,7 @@ dir <%export_namespace%> { #ARGS: {command: string} IF (show_function_errors) { # Assert that the function is being run as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } @@ -284,17 +289,93 @@ dir <%export_namespace%> { REPEAT (Object.values(rig.nodes).filter(v => v.type === 'locator' && v.config?.use_entity)) as locator { data modify storage aj:temp args.uuid set from entity @s data.uuids.<%locator.type + '_' + locator.name%> block execute_as_uuid { with storage aj:temp args - $execute as $(uuid) run $(command) + $execute as $(uuid) at @s run $(command) } } } } } + IF (has_locators) { + function at_locator { + #ARGS: {name: string, command: string} + IF (show_function_errors) { + # Assert that the function is being run as the root entity. + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + function *global/errors/function_not_executed_as_root_entity \ + {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} + } + data remove storage aj:temp args + $data modify storage aj:temp args merge value {name:'$(name)', command:'$(command)'} + $execute \ + on passengers \ + if entity @s[tag=<%TAGS.GLOBAL_DATA()%>] \ + run block zzz/at_locator/as_data { {name: $(name)} + $execute unless data entity @s {data:{locators:{$(name):{}}}} run return run tellraw @a <%TELLRAW.LOCATOR_NOT_FOUND()%> + $data modify storage aj:temp args merge from entity @s data.locators.$(name) + block execute_at_transform { with storage aj:temp args + $execute \ + positioned ^$(posx) ^$(posy) ^$(posz) \ + rotated ~$(roty) ~$(rotx) \ + run $(command) + } + } + } + + function at_all_locators { + #ARGS: {command: string} + IF (show_function_errors) { + # Assert that the function is being run as the root entity. + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + function *global/errors/function_not_executed_as_root_entity \ + {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} + } + data remove storage aj:temp args + $data modify storage aj:temp args.command set value '$(command)' + execute on passengers if entity @s[tag=<%TAGS.GLOBAL_DATA()%>] run block zzz/at_all_locators/as_data { + REPEAT (Object.values(rig.nodes).filter(v => v.type === 'locator' && v.config?.use_entity)) as locator { + data modify storage aj:temp args merge from entity @s data.locators.<%locator.name%> + block execute_at_transform { with storage aj:temp args + $execute \ + positioned ^$(posx) ^$(posy) ^$(posz) \ + rotated ~$(roty) ~$(rotx) \ + run $(command) + } + } + } + } + } + + IF (has_cameras) { + function as_camera { + #ARGS: {name: string, command: string} + IF (show_function_errors) { + # Assert that the function is being run as the root entity. + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + function *global/errors/function_not_executed_as_root_entity \ + {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} + } + data remove storage aj:temp args + $data modify storage aj:temp args merge value {name:'$(name)', command:'$(command)'} + $execute \ + on passengers \ + if entity @s[tag=<%TAGS.GLOBAL_DATA()%>] \ + run block zzz/as_camera/as_data { {name: $(name)} + data modify storage aj:temp args.uuid set from entity @s data.cameras.$(name) + scoreboard players set #aj.check <%OBJECTIVES.I()%> 0 + block execute_as_uuid { with storage aj:temp args + $execute as $(uuid) at @s run $(command) + scoreboard players set #aj.check <%OBJECTIVES.I()%> 1 + } + execute if score #aj.check <%OBJECTIVES.I()%> matches 0 run tellraw @a <%TELLRAW.CAMERA_NOT_FOUND_ENTITY()%> + } + } + } + dir remove { function all { # Removes all instances of this rig from the world. - execute as @e[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run function *<%export_namespace%>/remove/this + execute as @e[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run function *<%export_namespace%>/remove/this } function entities { @@ -306,7 +387,7 @@ dir <%export_namespace%> { # Removes the rig this function is executed as. IF (show_function_errors) { # Assert that the function is being executed as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } @@ -356,7 +437,7 @@ dir <%export_namespace%> { function apply { IF (show_function_errors) { # Assert that the function is being executed as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } @@ -393,7 +474,7 @@ dir <%export_namespace%> { # Changes the pose of the rig to the the default pose without interpolation IF (show_function_errors) { # Assert that the function is being run as the root entity. - execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ + execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \ function *global/errors/function_not_executed_as_root_entity \ {'export_namespace': '<%export_namespace%>', 'function_path': '<%arguments[1].functions.at(-1)%>'} } diff --git a/src/systems/datapackCompiler/index.ts b/src/systems/datapackCompiler/index.ts index 7b5fc5ba..7765baa1 100644 --- a/src/systems/datapackCompiler/index.ts +++ b/src/systems/datapackCompiler/index.ts @@ -659,9 +659,21 @@ async function generateRootEntityPassengers( const { locators, cameras, uuids } = createPassengerStorage(rig) + const dataEntity = new NbtCompound() + + switch (version) { + case '1.20.4': + case '1.20.5': + case '1.21.0': + case '1.21.2': + case '1.21.4': + dataEntity.set('id', new NbtString('minecraft:marker')) + break + case '1.21.5': + dataEntity.set('id', new NbtString('minecraft:item_display')) + } passengers.add( - new NbtCompound() - .set('id', new NbtString('minecraft:item_display')) + dataEntity .set( 'Tags', new NbtList([ @@ -760,6 +772,11 @@ async function generateRootEntityPassengers( ) break } + default: { + throw new Error( + `Unsupported Minecraft version '${version}' for item display!` + ) + } } if (node.configs?.default) { @@ -786,12 +803,35 @@ async function generateRootEntityPassengers( passenger.set('height', new NbtFloat(aj.bounding_box[1])) passenger.set('width', new NbtFloat(aj.bounding_box[0])) - passenger.set( - 'text', - NbtTag.fromString( - node.text ? node.text.toString() : "{ text: 'Invalid Text Component' }" - ) - ) + switch (version) { + case '1.20.4': + case '1.20.5': + case '1.21.0': + case '1.21.2': + case '1.21.4': + passenger.set( + 'text_display', + new NbtString( + node.text?.toString() ?? `{ "text": "Invalid Text Component" }` + ) + ) + break + case '1.21.5': + passenger.set( + 'text', + NbtTag.fromString( + node.text + ? node.text.toString() + : "{ text: 'Invalid Text Component' }" + ) + ) + break + default: { + throw new Error( + `Unsupported Minecraft version '${version}' for text display!` + ) + } + } const color = new tinycolor( node.background_color + floatToHex(node.background_alpha) From b14dacddd3c706126891a55c5e05ca6c43c4bf2b Mon Sep 17 00:00:00 2001 From: SnaveSutit Date: Wed, 7 May 2025 12:34:41 -0400 Subject: [PATCH 3/3] =?UTF-8?q?=F0=9F=94=96=20v1.7.2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/pluginPackage/changelog.json | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 7c1678ae..cf8ef866 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "title": "Animated Java", "icon": "icon.svg", "description": "A Blockbench plugin that makes complex animation a breeze in Minecraft: Java Edition.", - "version": "1.7.1", + "version": "1.7.2", "min_blockbench_version": "4.12.0", "variant": "desktop", "tags": [ diff --git a/src/pluginPackage/changelog.json b/src/pluginPackage/changelog.json index 76ba9d35..c987e8ec 100644 --- a/src/pluginPackage/changelog.json +++ b/src/pluginPackage/changelog.json @@ -176,5 +176,20 @@ "list": ["Fixed [#412](https://github.com/Animated-Java/animated-java/issues/409)"] } ] + }, + "1.7.2": { + "title": "v1.7.2", + "author": "Titus Evans (SnaveSutit)", + "date": "2025-05-07", + "categories": [ + { + "title": "Fixes", + "list": [ + "Fixed incorrect entity type for data entities on versions below 1.21.5.", + "Fixed missing `as_...` functions in exported data packs below 1.21.5.", + "Improved .mcb code consistency." + ] + } + ] } }