Skip to content

Commit e9aece3

Browse files
committed
🩹 Fix possible minor performance leak in as_own_locator_entities function
1 parent 7882899 commit e9aece3

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

‎src/systems/datapackCompiler/1.20.4/animation.mcb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ dir <%export_namespace%> {
435435
function *global/internal/gu/convert_uuid_array_to_string with entity @s
436436
data modify entity @s data.bones.data_data set from storage aj:uuid main.out
437437

438-
REPEAT (Object.values(rig.nodes).filter(v => v.type === 'locator')) as locator {
438+
REPEAT (Object.values(rig.nodes).filter(v => v.type === 'locator' && v.config?.use_entity)) as locator {
439439
IF (locator.config && locator.config.use_entity) {
440440
summon <%locator.config.entity_type%> \
441441
^<%locator.default_transform.pos[0]%> \
@@ -573,7 +573,7 @@ dir <%export_namespace%> {
573573
}
574574
$data modify storage aj:temp command set value '$(command)'
575575
execute on passengers if entity @s[tag=<%TAGS.GLOBAL_DATA()%>] run {
576-
REPEAT (Object.values(rig.nodes).filter(v => v.type === 'locator')) as locator {
576+
REPEAT (Object.values(rig.nodes).filter(v => v.type === 'locator' && v.config?.use_entity)) as locator {
577577
data modify storage aj:temp uuid set from entity @s data.locators.<%locator.name%>.uuid
578578
block zzz/execute { with storage aj:temp
579579
$execute as $(uuid) run $(command)

‎src/systems/datapackCompiler/1.20.4/static.mcb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ dir <%export_namespace%> {
120120
function *global/internal/gu/convert_uuid_array_to_string with entity @s
121121
data modify entity @s data.bones.data_data set from storage aj:uuid main.out
122122

123-
REPEAT (Object.values(rig.nodes).filter(v => v.type === 'locator')) as locator {
123+
REPEAT (Object.values(rig.nodes).filter(v => v.type === 'locator' && v.config?.use_entity)) as locator {
124124
IF (locator.config && locator.config.use_entity) {
125125
summon <%locator.config.entity_type%> \
126126
^<%locator.default_transform.pos[0]%> \
@@ -229,7 +229,7 @@ dir <%export_namespace%> {
229229
}
230230
$data modify storage aj:temp command set value '$(command)'
231231
execute on passengers if entity @s[tag=<%TAGS.GLOBAL_DATA()%>] run {
232-
REPEAT (Object.values(rig.nodes).filter(v => v.type === 'locator')) as locator {
232+
REPEAT (Object.values(rig.nodes).filter(v => v.type === 'locator' && v.config?.use_entity)) as locator {
233233
data modify storage aj:temp uuid set from entity @s data.locators.<%locator.name%>.uuid
234234
block zzz/execute { with storage aj:temp
235235
$execute as $(uuid) run $(command)

‎src/systems/datapackCompiler/1.21.4/animation.mcb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ dir <%export_namespace%> {
435435
function *global/internal/gu/convert_uuid_array_to_string with entity @s
436436
data modify entity @s data.bones.data_data set from storage aj:uuid main.out
437437

438-
REPEAT (Object.values(rig.nodes).filter(v => v.type === 'locator')) as locator {
438+
REPEAT (Object.values(rig.nodes).filter(v => v.type === 'locator' && v.config?.use_entity)) as locator {
439439
IF (locator.config && locator.config.use_entity) {
440440
summon <%locator.config.entity_type%> \
441441
^<%locator.default_transform.pos[0]%> \
@@ -573,7 +573,7 @@ dir <%export_namespace%> {
573573
}
574574
$data modify storage aj:temp command set value '$(command)'
575575
execute on passengers if entity @s[tag=<%TAGS.GLOBAL_DATA()%>] run {
576-
REPEAT (Object.values(rig.nodes).filter(v => v.type === 'locator')) as locator {
576+
REPEAT (Object.values(rig.nodes).filter(v => v.type === 'locator' && v.config?.use_entity)) as locator {
577577
data modify storage aj:temp uuid set from entity @s data.locators.<%locator.name%>.uuid
578578
block zzz/execute { with storage aj:temp
579579
$execute as $(uuid) run $(command)

‎src/systems/datapackCompiler/1.21.4/static.mcb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ dir <%export_namespace%> {
120120
function *global/internal/gu/convert_uuid_array_to_string with entity @s
121121
data modify entity @s data.bones.data_data set from storage aj:uuid main.out
122122

123-
REPEAT (Object.values(rig.nodes).filter(v => v.type === 'locator')) as locator {
123+
REPEAT (Object.values(rig.nodes).filter(v => v.type === 'locator' && v.config?.use_entity)) as locator {
124124
IF (locator.config && locator.config.use_entity) {
125125
summon <%locator.config.entity_type%> \
126126
^<%locator.default_transform.pos[0]%> \
@@ -228,7 +228,7 @@ dir <%export_namespace%> {
228228
}
229229
$data modify storage aj:temp command set value '$(command)'
230230
execute on passengers if entity @s[tag=<%TAGS.GLOBAL_DATA()%>] run {
231-
REPEAT (Object.values(rig.nodes).filter(v => v.type === 'locator')) as locator {
231+
REPEAT (Object.values(rig.nodes).filter(v => v.type === 'locator' && v.config?.use_entity)) as locator {
232232
data modify storage aj:temp uuid set from entity @s data.locators.<%locator.name%>.uuid
233233
block zzz/execute { with storage aj:temp
234234
$execute as $(uuid) run $(command)

0 commit comments

Comments
 (0)