Skip to content

Commit c6d4cbc

Browse files
committed
✨ Reduce performance impact when summoning rigs
1 parent 7acb737 commit c6d4cbc

File tree

9 files changed

+33
-35
lines changed

9 files changed

+33
-35
lines changed

src/systems/datapackCompiler/1.20.4/animation.mcb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ dir <%export_namespace%> {
432432
execute store result score @s <%OBJECTIVES.ID()%> run scoreboard players add aj.last_id <%OBJECTIVES.ID()%> 1
433433

434434
execute on passengers if entity @s[tag=<%TAGS.GLOBAL_DATA()%>] run {
435-
function *global/internal/gu/convert_uuid_array_to_string with entity @s
435+
function *global/internal/gu/convert_uuid_array_to_string
436436
data modify entity @s data.bones.data_data set from storage aj:uuid main.out
437437

438438
REPEAT (Object.values(rig.nodes).filter(v => v.type === 'locator' && v.config?.use_entity)) as locator {
@@ -444,7 +444,7 @@ dir <%export_namespace%> {
444444
execute as @e[type=<%locator.config.entity_type%>,tag=<%TAGS.NEW()%>,tag=<%TAGS.GLOBAL_LOCATOR()%>,limit=1,distance=..0.01] run {
445445
tag @s remove <%TAGS.NEW()%>
446446

447-
function *global/internal/gu/convert_uuid_array_to_string with entity @s
447+
function *global/internal/gu/convert_uuid_array_to_string
448448
tp @s \
449449
^<%roundTo(locator.default_transform.pos[0], 10)%> \
450450
^<%roundTo(locator.default_transform.pos[1], 10)%> \
@@ -468,7 +468,7 @@ dir <%export_namespace%> {
468468
{Tags:<%getNodeTags(camera, rig)%>, teleport_duration: 2}
469469
execute as @e[type=item_display,tag=<%TAGS.NEW()%>,tag=<%TAGS.GLOBAL_CAMERA()%>,limit=1,distance=..0.01] run {
470470
tag @s remove <%TAGS.NEW()%>
471-
function *global/internal/gu/convert_uuid_array_to_string with entity @s
471+
function *global/internal/gu/convert_uuid_array_to_string
472472
tp @s \
473473
^<%roundTo(camera.default_transform.pos[0], 10)%> \
474474
^<%roundTo(camera.default_transform.pos[1], 10)%> \
@@ -481,7 +481,7 @@ dir <%export_namespace%> {
481481

482482
REPEAT (Object.values(rig.nodes).filter(v => ['bone', 'text_display', 'item_display', 'block_display'].includes(v.type))) as node {
483483
execute on vehicle on passengers if entity @s[tag=<%TAGS.PROJECT_NODE_NAMED(export_namespace, node.name)%>] run \
484-
function *global/internal/gu/convert_uuid_array_to_string with entity @s
484+
function *global/internal/gu/convert_uuid_array_to_string
485485
data modify entity @s data.bones.<%node.type + '_' + node.name%> set from storage aj:uuid main.out
486486
}
487487
}

src/systems/datapackCompiler/1.20.4/core.mcb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,8 @@ dir global {
6969
}
7070

7171
function convert_uuid_array_to_string {
72-
#ARGS: {UUID: [int, int, int, int]}
73-
7472
data modify storage aj:uuid temp set value {0:0,1:0,2:0,3:0,4:0,5:0,6:0,7:0,8:0,9:0,a:0,b:0,c:0,d:0,e:0,f:0}
75-
$data modify storage aj:uuid main.in set value $(UUID)
73+
data modify storage aj:uuid main.in set from entity @s UUID
7674

7775
execute store result score 0= <%OBJECTIVES.I()%> store result score 1= <%OBJECTIVES.I()%> run data get storage aj:uuid main.in[0]
7876
execute store result storage aj:uuid temp.0 int 1 run scoreboard players operation 0= <%OBJECTIVES.I()%> %= 256 <%OBJECTIVES.I()%>

src/systems/datapackCompiler/1.20.4/static.mcb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ dir <%export_namespace%> {
117117
execute store result score @s <%OBJECTIVES.ID()%> run scoreboard players add aj.last_id <%OBJECTIVES.ID()%> 1
118118

119119
execute on passengers if entity @s[tag=<%TAGS.GLOBAL_DATA()%>] run {
120-
function *global/internal/gu/convert_uuid_array_to_string with entity @s
120+
function *global/internal/gu/convert_uuid_array_to_string
121121
data modify entity @s data.bones.data_data set from storage aj:uuid main.out
122122

123123
REPEAT (Object.values(rig.nodes).filter(v => v.type === 'locator' && v.config?.use_entity)) as locator {
@@ -129,7 +129,7 @@ dir <%export_namespace%> {
129129
execute as @e[type=<%locator.config.entity_type%>,tag=<%TAGS.NEW()%>,tag=<%TAGS.GLOBAL_LOCATOR()%>,limit=1,distance=..0.01] run {
130130
tag @s remove <%TAGS.NEW()%>
131131

132-
function *global/internal/gu/convert_uuid_array_to_string with entity @s
132+
function *global/internal/gu/convert_uuid_array_to_string
133133
tp @s \
134134
^<%roundTo(locator.default_transform.pos[0], 10)%> \
135135
^<%roundTo(locator.default_transform.pos[1], 10)%> \
@@ -153,7 +153,7 @@ dir <%export_namespace%> {
153153
{Tags:<%getNodeTags(camera, rig)%>, teleport_duration: 2}
154154
execute as @e[type=item_display,tag=<%TAGS.NEW()%>,tag=<%TAGS.GLOBAL_CAMERA()%>,limit=1,distance=..0.01] run {
155155
tag @s remove <%TAGS.NEW()%>
156-
function *global/internal/gu/convert_uuid_array_to_string with entity @s
156+
function *global/internal/gu/convert_uuid_array_to_string
157157
tp @s \
158158
^<%roundTo(camera.default_transform.pos[0], 10)%> \
159159
^<%roundTo(camera.default_transform.pos[1], 10)%> \
@@ -166,7 +166,7 @@ dir <%export_namespace%> {
166166

167167
REPEAT (Object.values(rig.nodes).filter(v => ['bone', 'text_display', 'item_display', 'block_display'].includes(v.type))) as node {
168168
execute on vehicle on passengers if entity @s[tag=<%TAGS.PROJECT_NODE_NAMED(export_namespace, node.name)%>] run \
169-
function *global/internal/gu/convert_uuid_array_to_string with entity @s
169+
function *global/internal/gu/convert_uuid_array_to_string
170170
data modify entity @s data.bones.<%node.type + '_' + node.name%> set from storage aj:uuid main.out
171171
}
172172
}

src/systems/datapackCompiler/1.20.5/animation.mcb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ dir <%export_namespace%> {
432432
execute store result score @s <%OBJECTIVES.ID()%> run scoreboard players add aj.last_id <%OBJECTIVES.ID()%> 1
433433

434434
execute on passengers if entity @s[tag=<%TAGS.GLOBAL_DATA()%>] run {
435-
function *global/internal/gu/convert_uuid_array_to_string with entity @s
435+
function *global/internal/gu/convert_uuid_array_to_string
436436
data modify entity @s data.bones.data_data set from storage aj:uuid main.out
437437

438438
REPEAT (Object.values(rig.nodes).filter(v => v.type === 'locator' && v.config?.use_entity)) as locator {
@@ -444,7 +444,7 @@ dir <%export_namespace%> {
444444
execute as @e[type=<%locator.config.entity_type%>,tag=<%TAGS.NEW()%>,tag=<%TAGS.GLOBAL_LOCATOR()%>,limit=1,distance=..0.01] run {
445445
tag @s remove <%TAGS.NEW()%>
446446

447-
function *global/internal/gu/convert_uuid_array_to_string with entity @s
447+
function *global/internal/gu/convert_uuid_array_to_string
448448
tp @s \
449449
^<%roundTo(locator.default_transform.pos[0], 10)%> \
450450
^<%roundTo(locator.default_transform.pos[1], 10)%> \
@@ -468,7 +468,7 @@ dir <%export_namespace%> {
468468
{Tags:<%getNodeTags(camera, rig)%>, teleport_duration: 2}
469469
execute as @e[type=item_display,tag=<%TAGS.NEW()%>,tag=<%TAGS.GLOBAL_CAMERA()%>,limit=1,distance=..0.01] run {
470470
tag @s remove <%TAGS.NEW()%>
471-
function *global/internal/gu/convert_uuid_array_to_string with entity @s
471+
function *global/internal/gu/convert_uuid_array_to_string
472472
tp @s \
473473
^<%roundTo(camera.default_transform.pos[0], 10)%> \
474474
^<%roundTo(camera.default_transform.pos[1], 10)%> \
@@ -481,7 +481,7 @@ dir <%export_namespace%> {
481481

482482
REPEAT (Object.values(rig.nodes).filter(v => ['bone', 'text_display', 'item_display', 'block_display'].includes(v.type))) as node {
483483
execute on vehicle on passengers if entity @s[tag=<%TAGS.PROJECT_NODE_NAMED(export_namespace, node.name)%>] run \
484-
function *global/internal/gu/convert_uuid_array_to_string with entity @s
484+
function *global/internal/gu/convert_uuid_array_to_string
485485
data modify entity @s data.bones.<%node.type + '_' + node.name%> set from storage aj:uuid main.out
486486
}
487487
}

src/systems/datapackCompiler/1.20.5/static.mcb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ dir <%export_namespace%> {
117117
execute store result score @s <%OBJECTIVES.ID()%> run scoreboard players add aj.last_id <%OBJECTIVES.ID()%> 1
118118

119119
execute on passengers if entity @s[tag=<%TAGS.GLOBAL_DATA()%>] run {
120-
function *global/internal/gu/convert_uuid_array_to_string with entity @s
120+
function *global/internal/gu/convert_uuid_array_to_string
121121
data modify entity @s data.bones.data_data set from storage aj:uuid main.out
122122

123123
REPEAT (Object.values(rig.nodes).filter(v => v.type === 'locator' && v.config?.use_entity)) as locator {
@@ -129,7 +129,7 @@ dir <%export_namespace%> {
129129
execute as @e[type=<%locator.config.entity_type%>,tag=<%TAGS.NEW()%>,tag=<%TAGS.GLOBAL_LOCATOR()%>,limit=1,distance=..0.01] run {
130130
tag @s remove <%TAGS.NEW()%>
131131

132-
function *global/internal/gu/convert_uuid_array_to_string with entity @s
132+
function *global/internal/gu/convert_uuid_array_to_string
133133
tp @s \
134134
^<%roundTo(locator.default_transform.pos[0], 10)%> \
135135
^<%roundTo(locator.default_transform.pos[1], 10)%> \
@@ -153,7 +153,7 @@ dir <%export_namespace%> {
153153
{Tags:<%getNodeTags(camera, rig)%>, teleport_duration: 2}
154154
execute as @e[type=item_display,tag=<%TAGS.NEW()%>,tag=<%TAGS.GLOBAL_CAMERA()%>,limit=1,distance=..0.01] run {
155155
tag @s remove <%TAGS.NEW()%>
156-
function *global/internal/gu/convert_uuid_array_to_string with entity @s
156+
function *global/internal/gu/convert_uuid_array_to_string
157157
tp @s \
158158
^<%roundTo(camera.default_transform.pos[0], 10)%> \
159159
^<%roundTo(camera.default_transform.pos[1], 10)%> \
@@ -166,7 +166,7 @@ dir <%export_namespace%> {
166166

167167
REPEAT (Object.values(rig.nodes).filter(v => ['bone', 'text_display', 'item_display', 'block_display'].includes(v.type))) as node {
168168
execute on vehicle on passengers if entity @s[tag=<%TAGS.PROJECT_NODE_NAMED(export_namespace, node.name)%>] run \
169-
function *global/internal/gu/convert_uuid_array_to_string with entity @s
169+
function *global/internal/gu/convert_uuid_array_to_string
170170
data modify entity @s data.bones.<%node.type + '_' + node.name%> set from storage aj:uuid main.out
171171
}
172172
}

src/systems/datapackCompiler/1.21.2/animation.mcb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ dir <%export_namespace%> {
432432
execute store result score @s <%OBJECTIVES.ID()%> run scoreboard players add aj.last_id <%OBJECTIVES.ID()%> 1
433433

434434
execute on passengers if entity @s[tag=<%TAGS.GLOBAL_DATA()%>] run {
435-
function *global/internal/gu/convert_uuid_array_to_string with entity @s
435+
function *global/internal/gu/convert_uuid_array_to_string
436436
data modify entity @s data.bones.data_data set from storage aj:uuid main.out
437437

438438
REPEAT (Object.values(rig.nodes).filter(v => v.type === 'locator' && v.config?.use_entity)) as locator {
@@ -444,7 +444,7 @@ dir <%export_namespace%> {
444444
execute as @e[type=<%locator.config.entity_type%>,tag=<%TAGS.NEW()%>,tag=<%TAGS.GLOBAL_LOCATOR()%>,limit=1,distance=..0.01] run {
445445
tag @s remove <%TAGS.NEW()%>
446446

447-
function *global/internal/gu/convert_uuid_array_to_string with entity @s
447+
function *global/internal/gu/convert_uuid_array_to_string
448448
tp @s \
449449
^<%roundTo(locator.default_transform.pos[0], 10)%> \
450450
^<%roundTo(locator.default_transform.pos[1], 10)%> \
@@ -468,7 +468,7 @@ dir <%export_namespace%> {
468468
{Tags:<%getNodeTags(camera, rig)%>, teleport_duration: 2}
469469
execute as @e[type=item_display,tag=<%TAGS.NEW()%>,tag=<%TAGS.GLOBAL_CAMERA()%>,limit=1,distance=..0.01] run {
470470
tag @s remove <%TAGS.NEW()%>
471-
function *global/internal/gu/convert_uuid_array_to_string with entity @s
471+
function *global/internal/gu/convert_uuid_array_to_string
472472
tp @s \
473473
^<%roundTo(camera.default_transform.pos[0], 10)%> \
474474
^<%roundTo(camera.default_transform.pos[1], 10)%> \
@@ -481,7 +481,7 @@ dir <%export_namespace%> {
481481

482482
REPEAT (Object.values(rig.nodes).filter(v => ['bone', 'text_display', 'item_display', 'block_display'].includes(v.type))) as node {
483483
execute on vehicle on passengers if entity @s[tag=<%TAGS.PROJECT_NODE_NAMED(export_namespace, node.name)%>] run \
484-
function *global/internal/gu/convert_uuid_array_to_string with entity @s
484+
function *global/internal/gu/convert_uuid_array_to_string
485485
data modify entity @s data.bones.<%node.type + '_' + node.name%> set from storage aj:uuid main.out
486486
}
487487
}

src/systems/datapackCompiler/1.21.2/static.mcb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ dir <%export_namespace%> {
117117
execute store result score @s <%OBJECTIVES.ID()%> run scoreboard players add aj.last_id <%OBJECTIVES.ID()%> 1
118118

119119
execute on passengers if entity @s[tag=<%TAGS.GLOBAL_DATA()%>] run {
120-
function *global/internal/gu/convert_uuid_array_to_string with entity @s
120+
function *global/internal/gu/convert_uuid_array_to_string
121121
data modify entity @s data.bones.data_data set from storage aj:uuid main.out
122122

123123
REPEAT (Object.values(rig.nodes).filter(v => v.type === 'locator' && v.config?.use_entity)) as locator {
@@ -129,7 +129,7 @@ dir <%export_namespace%> {
129129
execute as @e[type=<%locator.config.entity_type%>,tag=<%TAGS.NEW()%>,tag=<%TAGS.GLOBAL_LOCATOR()%>,limit=1,distance=..0.01] run {
130130
tag @s remove <%TAGS.NEW()%>
131131

132-
function *global/internal/gu/convert_uuid_array_to_string with entity @s
132+
function *global/internal/gu/convert_uuid_array_to_string
133133
tp @s \
134134
^<%roundTo(locator.default_transform.pos[0], 10)%> \
135135
^<%roundTo(locator.default_transform.pos[1], 10)%> \
@@ -153,7 +153,7 @@ dir <%export_namespace%> {
153153
{Tags:<%getNodeTags(camera, rig)%>, teleport_duration: 2}
154154
execute as @e[type=item_display,tag=<%TAGS.NEW()%>,tag=<%TAGS.GLOBAL_CAMERA()%>,limit=1,distance=..0.01] run {
155155
tag @s remove <%TAGS.NEW()%>
156-
function *global/internal/gu/convert_uuid_array_to_string with entity @s
156+
function *global/internal/gu/convert_uuid_array_to_string
157157
tp @s \
158158
^<%roundTo(camera.default_transform.pos[0], 10)%> \
159159
^<%roundTo(camera.default_transform.pos[1], 10)%> \
@@ -166,7 +166,7 @@ dir <%export_namespace%> {
166166

167167
REPEAT (Object.values(rig.nodes).filter(v => ['bone', 'text_display', 'item_display', 'block_display'].includes(v.type))) as node {
168168
execute on vehicle on passengers if entity @s[tag=<%TAGS.PROJECT_NODE_NAMED(export_namespace, node.name)%>] run \
169-
function *global/internal/gu/convert_uuid_array_to_string with entity @s
169+
function *global/internal/gu/convert_uuid_array_to_string
170170
data modify entity @s data.bones.<%node.type + '_' + node.name%> set from storage aj:uuid main.out
171171
}
172172
}

src/systems/datapackCompiler/1.21.4/animation.mcb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,7 @@ dir <%export_namespace%> {
512512
execute store result score @s <%OBJECTIVES.ID()%> run scoreboard players add aj.last_id <%OBJECTIVES.ID()%> 1
513513

514514
execute on passengers if entity @s[tag=<%TAGS.GLOBAL_DATA()%>] run block as_data_entity {
515-
function *global/internal/gu/convert_uuid_array_to_string with entity @s
515+
function *global/internal/gu/convert_uuid_array_to_string
516516
data modify entity @s data.bones.data_data set from storage aj:uuid main.out
517517

518518
REPEAT (Object.values(rig.nodes).filter(v => v.type === 'locator' && v.config?.use_entity)) as locator {
@@ -532,7 +532,7 @@ dir <%export_namespace%> {
532532
# run block ../as_locator/<%locator.path_name%> {
533533
tag @s remove <%TAGS.NEW()%>
534534

535-
function *global/internal/gu/convert_uuid_array_to_string with entity @s
535+
function *global/internal/gu/convert_uuid_array_to_string
536536
tp @s \
537537
^<%roundTo(locator.default_transform.pos[0], 10)%> \
538538
^<%roundTo(locator.default_transform.pos[1], 10)%> \
@@ -564,7 +564,7 @@ dir <%export_namespace%> {
564564
] \
565565
run block ../as_camera/<%camera.path_name%> {
566566
tag @s remove <%TAGS.NEW()%>
567-
function *global/internal/gu/convert_uuid_array_to_string with entity @s
567+
function *global/internal/gu/convert_uuid_array_to_string
568568
tp @s \
569569
^<%roundTo(camera.default_transform.pos[0], 10)%> \
570570
^<%roundTo(camera.default_transform.pos[1], 10)%> \
@@ -577,7 +577,7 @@ dir <%export_namespace%> {
577577

578578
REPEAT (Object.values(rig.nodes).filter(v => ['bone', 'text_display', 'item_display', 'block_display'].includes(v.type))) as node {
579579
execute on vehicle on passengers if entity @s[tag=<%TAGS.PROJECT_NODE_NAMED(export_namespace, node.name)%>] run \
580-
function *global/internal/gu/convert_uuid_array_to_string with entity @s
580+
function *global/internal/gu/convert_uuid_array_to_string
581581
data modify entity @s data.bones.<%node.type + '_' + node.name%> set from storage aj:uuid main.out
582582
}
583583
}

src/systems/datapackCompiler/1.21.4/static.mcb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ dir <%export_namespace%> {
117117
execute store result score @s <%OBJECTIVES.ID()%> run scoreboard players add aj.last_id <%OBJECTIVES.ID()%> 1
118118

119119
execute on passengers if entity @s[tag=<%TAGS.GLOBAL_DATA()%>] run {
120-
function *global/internal/gu/convert_uuid_array_to_string with entity @s
120+
function *global/internal/gu/convert_uuid_array_to_string
121121
data modify entity @s data.bones.data_data set from storage aj:uuid main.out
122122

123123
REPEAT (Object.values(rig.nodes).filter(v => v.type === 'locator' && v.config?.use_entity)) as locator {
@@ -129,7 +129,7 @@ dir <%export_namespace%> {
129129
execute as @e[type=<%locator.config.entity_type%>,tag=<%TAGS.NEW()%>,tag=<%TAGS.GLOBAL_LOCATOR()%>,limit=1,distance=..0.01] run {
130130
tag @s remove <%TAGS.NEW()%>
131131

132-
function *global/internal/gu/convert_uuid_array_to_string with entity @s
132+
function *global/internal/gu/convert_uuid_array_to_string
133133
tp @s \
134134
^<%roundTo(locator.default_transform.pos[0], 10)%> \
135135
^<%roundTo(locator.default_transform.pos[1], 10)%> \
@@ -153,7 +153,7 @@ dir <%export_namespace%> {
153153
{Tags:<%getNodeTags(camera, rig)%>, teleport_duration: 2}
154154
execute as @e[type=item_display,tag=<%TAGS.NEW()%>,tag=<%TAGS.GLOBAL_CAMERA()%>,limit=1,distance=..0.01] run {
155155
tag @s remove <%TAGS.NEW()%>
156-
function *global/internal/gu/convert_uuid_array_to_string with entity @s
156+
function *global/internal/gu/convert_uuid_array_to_string
157157
tp @s \
158158
^<%roundTo(camera.default_transform.pos[0], 10)%> \
159159
^<%roundTo(camera.default_transform.pos[1], 10)%> \
@@ -166,7 +166,7 @@ dir <%export_namespace%> {
166166

167167
REPEAT (Object.values(rig.nodes).filter(v => ['bone', 'text_display', 'item_display', 'block_display'].includes(v.type))) as node {
168168
execute on vehicle on passengers if entity @s[tag=<%TAGS.PROJECT_NODE_NAMED(export_namespace, node.name)%>] run \
169-
function *global/internal/gu/convert_uuid_array_to_string with entity @s
169+
function *global/internal/gu/convert_uuid_array_to_string
170170
data modify entity @s data.bones.<%node.type + '_' + node.name%> set from storage aj:uuid main.out
171171
}
172172
}

0 commit comments

Comments
 (0)