Skip to content

Commit 538b1c3

Browse files
committed
🚧 Scoreboard tag overhaul & fixes for 1.21.2
- Fixed 1.21.2 using custom model data instead of item_model. - Overhauled the scoreboard tags used by Animated Java to identify different nodes.
1 parent 62d6035 commit 538b1c3

File tree

14 files changed

+809
-197
lines changed

14 files changed

+809
-197
lines changed

src/systems/datapackCompiler/1.20.4/animation.mcb

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ dir <%export_namespace%> {
3232
}
3333
data modify entity @s data.rigHash set value '<%rigHash%>'
3434
execute on passengers run data merge entity @s {Glowing: 1b, glow_color_override: <%0xff0000%>}
35-
summon minecraft:text_display ~ ~ ~ {Tags:['<%TAGS.GLOBAL_RIG()%>', '<%TAGS.OUTDATED_RIG_TEXT_DISPLAY()%>', '<%TAGS.NEW()%>'], text:'<%TELLRAW.RIG_OUTDATED_TEXT_DISPLAY()%>', 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]}}
35+
summon minecraft:text_display ~ ~ ~ {Tags:['<%TAGS.GLOBAL_ENTITY()%>', '<%TAGS.OUTDATED_RIG_TEXT_DISPLAY()%>', '<%TAGS.NEW()%>'], text:'<%TELLRAW.RIG_OUTDATED_TEXT_DISPLAY()%>', 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]}}
3636
ride @e[type=minecraft:text_display,tag=<%TAGS.NEW()%>,limit=1,distance=..0.01] mount @s
3737
tag @e[type=minecraft:text_display,tag=<%TAGS.NEW()%>,limit=1,distance=..0.01] remove <%TAGS.NEW()%>
3838
}
@@ -243,7 +243,7 @@ dir <%export_namespace%> {
243243
#ARGS: {frame: int}
244244
REPEAT (Object.values(animation.modified_nodes).sort(nodeSorter)) as node {
245245
IF (['bone', 'text_display', 'item_display', 'block_display'].includes(node.type)) {
246-
$execute on passengers run data modify entity @s[tag=<%TAGS.LOCAL_BONE(export_namespace, node.safe_name)%>] {} merge from \
246+
$execute on passengers run data modify entity @s[tag=<%TAGS.PROJECT_NODE_NAMED(export_namespace, node.safe_name)%>] {} merge from \
247247
storage aj.<%export_namespace%>:animations <%animation.safe_name%>.$(frame).<%node.type + '_' + node.safe_name%>
248248
} ELSE IF (['locator', 'camera'].includes(node.type)) {
249249
$execute on passengers if entity @s[tag=<%TAGS.GLOBAL_DATA()%>] run data modify entity @s data.<%node.type + 's.' + node.safe_name%> merge from \
@@ -261,7 +261,7 @@ dir <%export_namespace%> {
261261
#ARGS: {frame: int}
262262
REPEAT (Object.values(animation.modified_nodes).sort(nodeSorter)) as node {
263263
IF (['bone', 'text_display', 'item_display', 'block_display'].includes(node.type)) {
264-
$execute on passengers if entity @s[tag=<%TAGS.LOCAL_BONE(export_namespace, node.safe_name)%>] run data modify entity @s {} merge from \
264+
$execute on passengers if entity @s[tag=<%TAGS.PROJECT_NODE_NAMED(export_namespace, node.safe_name)%>] run data modify entity @s {} merge from \
265265
storage aj.<%export_namespace%>:animations <%animation.safe_name%>.$(frame).<%node.type + '_' + node.safe_name%>
266266
} ELSE IF (['locator', 'camera'].includes(node.type)) {
267267
$execute on passengers if entity @s[tag=<%TAGS.GLOBAL_DATA()%>] run data modify entity @s data.<%node.type + 's.' + node.safe_name%> merge from \
@@ -415,7 +415,7 @@ dir <%export_namespace%> {
415415
$execute store success score #success <%OBJECTIVES.I()%> run data modify storage aj:temp args set value $(args)
416416

417417
summon minecraft:item_display ~ ~ ~ { \
418-
Tags:['<%TAGS.NEW()%>','<%TAGS.GLOBAL_RIG()%>','<%TAGS.GLOBAL_ROOT()%>','<%TAGS.PROJECT_ROOT(export_namespace)%>'], \
418+
Tags:['<%TAGS.NEW()%>','<%TAGS.GLOBAL_ENTITY()%>','<%TAGS.GLOBAL_ROOT()%>','<%TAGS.PROJECT_ROOT(export_namespace)%>'], \
419419
teleport_duration: 0, \
420420
interpolation_duration: <%interpolation_duration%>, \
421421
Passengers:<%root_entity_passengers%>, \
@@ -429,7 +429,7 @@ dir <%export_namespace%> {
429429

430430
REPEAT (Object.values(rig.nodes).filter(v => v.type === 'locator')) as locator {
431431
IF (locator.config && locator.config.use_entity) {
432-
summon <%locator.config.entity_type%> ~ ~ ~ {Tags:['<%TAGS.NEW()%>', '<%TAGS.GLOBAL_LOCATOR()%>', '<%TAGS.PROJECT_LOCATOR(export_namespace)%>', '<%TAGS.LOCAL_LOCATOR(export_namespace, locator.name)%>']}
432+
summon <%locator.config.entity_type%> ~ ~ ~ {Tags:['<%TAGS.NEW()%>', '<%TAGS.GLOBAL_LOCATOR()%>', '<%TAGS.PROJECT_LOCATOR(export_namespace)%>', '<%TAGS.PROJECT_LOCATOR_NAMED(export_namespace, locator.name)%>']}
433433
execute as @e[type=<%locator.config.entity_type%>,tag=<%TAGS.NEW()%>,tag=<%TAGS.GLOBAL_LOCATOR()%>,limit=1,distance=..0.01] run {
434434
tag @s remove <%TAGS.NEW()%>
435435

@@ -445,7 +445,7 @@ dir <%export_namespace%> {
445445
}
446446

447447
REPEAT (Object.values(rig.nodes).filter(v => v.type === 'camera')) as camera {
448-
summon item_display ~ ~ ~ {Tags:['<%TAGS.NEW()%>', '<%TAGS.GLOBAL_CAMERA()%>', '<%TAGS.PROJECT_CAMERA(export_namespace)%>', '<%TAGS.LOCAL_CAMERA(export_namespace, camera.name)%>'], teleport_duration: 2}
448+
summon item_display ~ ~ ~ {Tags:['<%TAGS.NEW()%>', '<%TAGS.GLOBAL_CAMERA()%>', '<%TAGS.PROJECT_CAMERA(export_namespace)%>', '<%TAGS.PROJECT_CAMERA(export_namespace, camera.name)%>'], teleport_duration: 2}
449449
execute as @e[type=item_display,tag=<%TAGS.NEW()%>,tag=<%TAGS.GLOBAL_CAMERA()%>,limit=1,distance=..0.01] run {
450450
tag @s remove <%TAGS.NEW()%>
451451

@@ -455,7 +455,7 @@ dir <%export_namespace%> {
455455
}
456456

457457
REPEAT (Object.values(rig.nodes).filter(v => ['bone', 'text_display', 'item_display', 'block_display'].includes(v.type))) as bone {
458-
execute on vehicle on passengers if entity @s[tag=<%TAGS.LOCAL_BONE(export_namespace, bone.name)%>] run \
458+
execute on vehicle on passengers if entity @s[tag=<%TAGS.PROJECT_NODE_NAMED(export_namespace, bone.name)%>] run \
459459
function *global/internal/gu/convert_uuid_array_to_string with entity @s
460460
data modify entity @s data.bones.<%bone.type + '_' + bone.name%> set from storage aj:uuid main.out
461461
}
@@ -535,16 +535,6 @@ dir <%export_namespace%> {
535535
}
536536
}
537537

538-
IF (Object.keys(rig.variants).length > 1) {
539-
dir summon {
540-
REPEAT (Object.values(rig.variants)) as variant {
541-
function <%variant.name%> {
542-
function *<%export_namespace%>/summon {args:{variant: '<%variant.name%>'}}
543-
}
544-
}
545-
}
546-
}
547-
548538
IF (has_entity_locators) {
549539
function as_own_locator_entities {
550540
#ARGS: {command: string}

src/systems/datapackCompiler/1.20.4/core.mcb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ dir global {
5757
dir remove {
5858
# Removes all instances of all rigs from the world.
5959
function everything {
60-
kill @e[tag=<%TAGS.GLOBAL_RIG()%>]
60+
kill @e[tag=<%TAGS.GLOBAL_ENTITY()%>]
6161
}
6262
}
6363

src/systems/datapackCompiler/1.20.4/static.mcb

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ dir <%export_namespace%> {
1818
}
1919
data modify entity @s data.rigHash set value '<%rigHash%>'
2020
execute on passengers run data merge entity @s {Glowing: 1b, glow_color_override: <%0xff0000%>}
21-
summon minecraft:text_display ~ ~ ~ {Tags:['<%TAGS.GLOBAL_RIG()%>', '<%TAGS.OUTDATED_RIG_TEXT_DISPLAY()%>', '<%TAGS.NEW()%>'], text:'<%TELLRAW.RIG_OUTDATED_TEXT_DISPLAY()%>', 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]}}
21+
summon minecraft:text_display ~ ~ ~ {Tags:['<%TAGS.GLOBAL_ENTITY()%>', '<%TAGS.OUTDATED_RIG_TEXT_DISPLAY()%>', '<%TAGS.NEW()%>'], text:'<%TELLRAW.RIG_OUTDATED_TEXT_DISPLAY()%>', 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]}}
2222
ride @e[type=minecraft:text_display,tag=<%TAGS.NEW()%>,limit=1,distance=..0.01] mount @s
2323
tag @e[type=minecraft:text_display,tag=<%TAGS.NEW()%>,limit=1,distance=..0.01] remove <%TAGS.NEW()%>
2424
}
@@ -102,7 +102,7 @@ dir <%export_namespace%> {
102102
$execute store success score #success <%OBJECTIVES.I()%> run data modify storage aj:temp args set value $(args)
103103

104104
summon minecraft:item_display ~ ~ ~ { \
105-
Tags:['<%TAGS.NEW()%>','<%TAGS.GLOBAL_RIG()%>','<%TAGS.GLOBAL_ROOT()%>','<%TAGS.PROJECT_ROOT(export_namespace)%>'], \
105+
Tags:['<%TAGS.NEW()%>','<%TAGS.GLOBAL_ENTITY()%>','<%TAGS.GLOBAL_ROOT()%>','<%TAGS.PROJECT_ROOT(export_namespace)%>'], \
106106
teleport_duration: 0, \
107107
interpolation_duration: <%interpolation_duration%>, \
108108
Passengers:<%root_entity_passengers%>, \
@@ -116,7 +116,7 @@ dir <%export_namespace%> {
116116

117117
REPEAT (Object.values(rig.nodes).filter(v => v.type === 'locator')) as locator {
118118
IF (locator.config && locator.config.use_entity) {
119-
summon <%locator.config.entity_type%> ~ ~ ~ {Tags:['<%TAGS.NEW()%>', '<%TAGS.GLOBAL_LOCATOR()%>', '<%TAGS.PROJECT_LOCATOR(export_namespace)%>', '<%TAGS.LOCAL_LOCATOR(export_namespace, locator.name)%>']}
119+
summon <%locator.config.entity_type%> ~ ~ ~ {Tags:['<%TAGS.NEW()%>', '<%TAGS.GLOBAL_LOCATOR()%>', '<%TAGS.PROJECT_LOCATOR(export_namespace)%>', '<%TAGS.PROJECT_LOCATOR_NAMED(export_namespace, locator.name)%>']}
120120
execute as @e[type=<%locator.config.entity_type%>,tag=<%TAGS.NEW()%>,tag=<%TAGS.GLOBAL_LOCATOR()%>,limit=1,distance=..0.01] run {
121121
tag @s remove <%TAGS.NEW()%>
122122

@@ -138,7 +138,7 @@ dir <%export_namespace%> {
138138
}
139139

140140
REPEAT (Object.values(rig.nodes).filter(v => v.type === 'camera')) as camera {
141-
summon item_display ~ ~ ~ {Tags:['<%TAGS.NEW()%>', '<%TAGS.GLOBAL_CAMERA()%>', '<%TAGS.PROJECT_CAMERA(export_namespace)%>', '<%TAGS.LOCAL_CAMERA(export_namespace, camera.name)%>'], teleport_duration: 2}
141+
summon item_display ~ ~ ~ {Tags:['<%TAGS.NEW()%>', '<%TAGS.GLOBAL_CAMERA()%>', '<%TAGS.PROJECT_CAMERA(export_namespace)%>', '<%TAGS.PROJECT_CAMERA(export_namespace, camera.name)%>'], teleport_duration: 2}
142142
execute as @e[type=item_display,tag=<%TAGS.NEW()%>,tag=<%TAGS.GLOBAL_CAMERA()%>,limit=1,distance=..0.01] run {
143143
tag @s remove <%TAGS.NEW()%>
144144

@@ -154,7 +154,7 @@ dir <%export_namespace%> {
154154
}
155155

156156
REPEAT (Object.values(rig.nodes).filter(v => ['bone', 'text_display', 'item_display', 'block_display'].includes(v.type))) as bone {
157-
execute on vehicle on passengers if entity @s[tag=<%TAGS.LOCAL_BONE(export_namespace, bone.name)%>] run \
157+
execute on vehicle on passengers if entity @s[tag=<%TAGS.PROJECT_NODE_NAMED(export_namespace, bone.name)%>] run \
158158
function *global/internal/gu/convert_uuid_array_to_string with entity @s
159159
data modify entity @s data.bones.<%bone.type + '_' + bone.name%> set from storage aj:uuid main.out
160160
}
@@ -204,16 +204,6 @@ dir <%export_namespace%> {
204204
}
205205
}
206206

207-
IF (Object.keys(rig.variants).length > 1) {
208-
dir summon {
209-
REPEAT (Object.values(rig.variants)) as variant {
210-
function <%variant.name%> {
211-
function *<%export_namespace%>/summon {args:{variant: '<%variant.name%>'}}
212-
}
213-
}
214-
}
215-
}
216-
217207
IF (has_entity_locators) {
218208
function as_own_locator_entities {
219209
#ARGS: {command: string}
@@ -224,7 +214,7 @@ dir <%export_namespace%> {
224214
}
225215
$data modify storage aj:temp command set value '$(command)'
226216
execute on passengers if entity @s[tag=<%TAGS.GLOBAL_DATA()%>] run {
227-
REPEAT (Object.values(rig.nodes).filter(v => v.type === 'locator')) as locator {
217+
REPEAT (Object.values(rig.nodes).filter(v => v.type === 'locator' && v.config?.use_entity)) as locator {
228218
data modify storage aj:temp uuid set from entity @s data.locators.<%locator.name%>.uuid
229219
block zzz/execute { with storage aj:temp
230220
$execute as $(uuid) run $(command)

src/systems/datapackCompiler/1.20.5/animation.mcb

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ dir <%export_namespace%> {
3232
}
3333
data modify entity @s data.rigHash set value '<%rigHash%>'
3434
execute on passengers run data merge entity @s {Glowing: 1b, glow_color_override: <%0xff0000%>}
35-
summon minecraft:text_display ~ ~ ~ {Tags:['<%TAGS.GLOBAL_RIG()%>', '<%TAGS.OUTDATED_RIG_TEXT_DISPLAY()%>', '<%TAGS.NEW()%>'], text:'<%TELLRAW.RIG_OUTDATED_TEXT_DISPLAY()%>', 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]}}
35+
summon minecraft:text_display ~ ~ ~ {Tags:['<%TAGS.GLOBAL_ENTITY()%>', '<%TAGS.OUTDATED_RIG_TEXT_DISPLAY()%>', '<%TAGS.NEW()%>'], text:'<%TELLRAW.RIG_OUTDATED_TEXT_DISPLAY()%>', 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]}}
3636
ride @e[type=minecraft:text_display,tag=<%TAGS.NEW()%>,limit=1,distance=..0.01] mount @s
3737
tag @e[type=minecraft:text_display,tag=<%TAGS.NEW()%>,limit=1,distance=..0.01] remove <%TAGS.NEW()%>
3838
}
@@ -243,7 +243,7 @@ dir <%export_namespace%> {
243243
#ARGS: {frame: int}
244244
REPEAT (Object.values(animation.modified_nodes).sort(nodeSorter)) as node {
245245
IF (['bone', 'text_display', 'item_display', 'block_display'].includes(node.type)) {
246-
$execute on passengers run data modify entity @s[tag=<%TAGS.LOCAL_BONE(export_namespace, node.safe_name)%>] {} merge from \
246+
$execute on passengers run data modify entity @s[tag=<%TAGS.PROJECT_NODE_NAMED(export_namespace, node.safe_name)%>] {} merge from \
247247
storage aj.<%export_namespace%>:animations <%animation.safe_name%>.$(frame).<%node.type + '_' + node.safe_name%>
248248
} ELSE IF (['locator', 'camera'].includes(node.type)) {
249249
$execute on passengers if entity @s[tag=<%TAGS.GLOBAL_DATA()%>] run data modify entity @s data.<%node.type + 's.' + node.safe_name%> merge from \
@@ -261,7 +261,7 @@ dir <%export_namespace%> {
261261
#ARGS: {frame: int}
262262
REPEAT (Object.values(animation.modified_nodes).sort(nodeSorter)) as node {
263263
IF (['bone', 'text_display', 'item_display', 'block_display'].includes(node.type)) {
264-
$execute on passengers if entity @s[tag=<%TAGS.LOCAL_BONE(export_namespace, node.safe_name)%>] run data modify entity @s {} merge from \
264+
$execute on passengers if entity @s[tag=<%TAGS.PROJECT_NODE_NAMED(export_namespace, node.safe_name)%>] run data modify entity @s {} merge from \
265265
storage aj.<%export_namespace%>:animations <%animation.safe_name%>.$(frame).<%node.type + '_' + node.safe_name%>
266266
} ELSE IF (['locator', 'camera'].includes(node.type)) {
267267
$execute on passengers if entity @s[tag=<%TAGS.GLOBAL_DATA()%>] run data modify entity @s data.<%node.type + 's.' + node.safe_name%> merge from \
@@ -415,7 +415,7 @@ dir <%export_namespace%> {
415415
$execute store success score #success <%OBJECTIVES.I()%> run data modify storage aj:temp args set value $(args)
416416

417417
summon minecraft:item_display ~ ~ ~ { \
418-
Tags:['<%TAGS.NEW()%>','<%TAGS.GLOBAL_RIG()%>','<%TAGS.GLOBAL_ROOT()%>','<%TAGS.PROJECT_ROOT(export_namespace)%>'], \
418+
Tags:['<%TAGS.NEW()%>','<%TAGS.GLOBAL_ENTITY()%>','<%TAGS.GLOBAL_ROOT()%>','<%TAGS.PROJECT_ROOT(export_namespace)%>'], \
419419
teleport_duration: 0, \
420420
interpolation_duration: <%interpolation_duration%>, \
421421
Passengers:<%root_entity_passengers%>, \
@@ -429,7 +429,7 @@ dir <%export_namespace%> {
429429

430430
REPEAT (Object.values(rig.nodes).filter(v => v.type === 'locator')) as locator {
431431
IF (locator.config && locator.config.use_entity) {
432-
summon <%locator.config.entity_type%> ~ ~ ~ {Tags:['<%TAGS.NEW()%>', '<%TAGS.GLOBAL_LOCATOR()%>', '<%TAGS.PROJECT_LOCATOR(export_namespace)%>', '<%TAGS.LOCAL_LOCATOR(export_namespace, locator.name)%>']}
432+
summon <%locator.config.entity_type%> ~ ~ ~ {Tags:['<%TAGS.NEW()%>', '<%TAGS.GLOBAL_LOCATOR()%>', '<%TAGS.PROJECT_LOCATOR(export_namespace)%>', '<%TAGS.PROJECT_LOCATOR_NAMED(export_namespace, locator.name)%>']}
433433
execute as @e[type=<%locator.config.entity_type%>,tag=<%TAGS.NEW()%>,tag=<%TAGS.GLOBAL_LOCATOR()%>,limit=1,distance=..0.01] run {
434434
tag @s remove <%TAGS.NEW()%>
435435

@@ -445,7 +445,7 @@ dir <%export_namespace%> {
445445
}
446446

447447
REPEAT (Object.values(rig.nodes).filter(v => v.type === 'camera')) as camera {
448-
summon item_display ~ ~ ~ {Tags:['<%TAGS.NEW()%>', '<%TAGS.GLOBAL_CAMERA()%>', '<%TAGS.PROJECT_CAMERA(export_namespace)%>', '<%TAGS.LOCAL_CAMERA(export_namespace, camera.name)%>'], teleport_duration: 2}
448+
summon item_display ~ ~ ~ {Tags:['<%TAGS.NEW()%>', '<%TAGS.GLOBAL_CAMERA()%>', '<%TAGS.PROJECT_CAMERA(export_namespace)%>', '<%TAGS.PROJECT_CAMERA(export_namespace, camera.name)%>'], teleport_duration: 2}
449449
execute as @e[type=item_display,tag=<%TAGS.NEW()%>,tag=<%TAGS.GLOBAL_CAMERA()%>,limit=1,distance=..0.01] run {
450450
tag @s remove <%TAGS.NEW()%>
451451

@@ -455,7 +455,7 @@ dir <%export_namespace%> {
455455
}
456456

457457
REPEAT (Object.values(rig.nodes).filter(v => ['bone', 'text_display', 'item_display', 'block_display'].includes(v.type))) as bone {
458-
execute on vehicle on passengers if entity @s[tag=<%TAGS.LOCAL_BONE(export_namespace, bone.name)%>] run \
458+
execute on vehicle on passengers if entity @s[tag=<%TAGS.PROJECT_NODE_NAMED(export_namespace, bone.name)%>] run \
459459
function *global/internal/gu/convert_uuid_array_to_string with entity @s
460460
data modify entity @s data.bones.<%bone.type + '_' + bone.name%> set from storage aj:uuid main.out
461461
}
@@ -535,16 +535,6 @@ dir <%export_namespace%> {
535535
}
536536
}
537537

538-
IF (Object.keys(rig.variants).length > 1) {
539-
dir summon {
540-
REPEAT (Object.values(rig.variants)) as variant {
541-
function <%variant.name%> {
542-
function *<%export_namespace%>/summon {args:{variant: '<%variant.name%>'}}
543-
}
544-
}
545-
}
546-
}
547-
548538
IF (has_entity_locators) {
549539
function as_own_locator_entities {
550540
#ARGS: {command: string}

0 commit comments

Comments
 (0)