Skip to content

Commit 0d87f04

Browse files
committed
🐛 Fix outdated rig function failing due to incorrect root tag
1 parent 37414fe commit 0d87f04

File tree

12 files changed

+125
-125
lines changed

12 files changed

+125
-125
lines changed

src/systems/datapackCompiler/1.20.4/animation.mcb

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ dir root {
139139

140140
IF (!auto_update_rig_orientation) {
141141
function move {
142-
debug assert executed_as_root_entity
142+
debug assert executed_as_root_entity <%TAGS.PROJECT_ROOT(export_namespace)%>
143143

144144
tp @s ~ ~ ~ ~ ~
145145

@@ -161,7 +161,7 @@ dir animations {
161161
REPEAT (animations) as animation {
162162
dir <%animation.storage_name%> {
163163
function play {
164-
debug assert executed_as_root_entity
164+
debug assert executed_as_root_entity <%TAGS.PROJECT_ROOT(export_namespace)%>
165165

166166
function *<%export_namespace%>/animations/pause_all
167167

@@ -173,7 +173,7 @@ dir animations {
173173
}
174174

175175
function stop {
176-
debug assert executed_as_root_entity
176+
debug assert executed_as_root_entity <%TAGS.PROJECT_ROOT(export_namespace)%>
177177

178178
function *<%export_namespace%>/animations/pause_all
179179

@@ -184,19 +184,19 @@ dir animations {
184184
}
185185

186186
function pause {
187-
debug assert executed_as_root_entity
187+
debug assert executed_as_root_entity <%TAGS.PROJECT_ROOT(export_namespace)%>
188188

189189
tag @s remove <%TAGS.ANIMATION_PLAYING(export_namespace, animation.storage_name)%>
190190
}
191191

192192
function resume {
193-
debug assert executed_as_root_entity
193+
debug assert executed_as_root_entity <%TAGS.PROJECT_ROOT(export_namespace)%>
194194

195195
tag @s add <%TAGS.ANIMATION_PLAYING(export_namespace, animation.storage_name)%>
196196
}
197197

198198
function next_frame {
199-
debug assert executed_as_root_entity
199+
debug assert executed_as_root_entity <%TAGS.PROJECT_ROOT(export_namespace)%>
200200

201201
execute if score @s <%OBJECTIVES.FRAME(animation.storage_name)%> matches <%animation.duration%>.. run scoreboard players set @s <%OBJECTIVES.FRAME(animation.storage_name)%> 1
202202
data remove storage <%temp_storage%> args
@@ -208,7 +208,7 @@ dir animations {
208208
function set_frame {
209209
# Sets the frame without interpolation
210210
#ARGS: {frame: int}
211-
debug assert executed_as_root_entity
211+
debug assert executed_as_root_entity <%TAGS.PROJECT_ROOT(export_namespace)%>
212212

213213
data remove storage <%temp_storage%> args
214214
$execute store result storage <%temp_storage%> args.frame int 1 run scoreboard players set @s <%OBJECTIVES.FRAME(animation.storage_name)%> $(frame)
@@ -217,7 +217,7 @@ dir animations {
217217

218218
function apply_frame {
219219
#ARGS: {frame: int}
220-
debug assert executed_as_root_entity
220+
debug assert executed_as_root_entity <%TAGS.PROJECT_ROOT(export_namespace)%>
221221

222222
data remove storage <%temp_storage%> args
223223
$execute store result storage <%temp_storage%> args.frame int 1 run scoreboard players set @s <%OBJECTIVES.FRAME(animation.storage_name)%> $(frame)
@@ -227,7 +227,7 @@ dir animations {
227227
function tween {
228228
# Attempts to smoothly transition from the currently playing animation into this one.
229229
#ARGS: {duration: int, to_frame: int}
230-
debug assert executed_as_root_entity
230+
debug assert executed_as_root_entity <%TAGS.PROJECT_ROOT(export_namespace)%>
231231

232232
function *<%export_namespace%>/animations/pause_all
233233

@@ -478,7 +478,7 @@ dir animations {
478478
}
479479
function pause_all {
480480
# Pauses all animations
481-
debug assert executed_as_root_entity
481+
debug assert executed_as_root_entity <%TAGS.PROJECT_ROOT(export_namespace)%>
482482

483483
REPEAT (animations) as animation {
484484
tag @s remove <%TAGS.ANIMATION_PLAYING(export_namespace, animation.storage_name)%>
@@ -722,7 +722,7 @@ function summon {
722722
IF (has_entity_locators) {
723723
function as_locator {
724724
#ARGS: {name: string, command: string}
725-
debug assert executed_as_root_entity
725+
debug assert executed_as_root_entity <%TAGS.PROJECT_ROOT(export_namespace)%>
726726

727727
data remove storage <%temp_storage%> args
728728
$data modify storage <%temp_storage%> args merge value {name:'$(name)', command:'$(command)', uuid:'+MISSING_UUID+'}
@@ -759,7 +759,7 @@ IF (has_entity_locators) {
759759

760760
function as_all_locators {
761761
#ARGS: {command: string}
762-
debug assert executed_as_root_entity
762+
debug assert executed_as_root_entity <%TAGS.PROJECT_ROOT(export_namespace)%>
763763

764764
data remove storage <%temp_storage%> args
765765
$data modify storage <%temp_storage%> args merge value {command:'$(command)'}
@@ -782,7 +782,7 @@ IF (has_entity_locators) {
782782
IF (has_locators) {
783783
function at_locator {
784784
#ARGS: {name: string, command: string}
785-
debug assert executed_as_root_entity
785+
debug assert executed_as_root_entity <%TAGS.PROJECT_ROOT(export_namespace)%>
786786

787787
data remove storage <%temp_storage%> args
788788
$data modify storage <%temp_storage%> args merge value {name:'$(name)', command:'$(command)'}
@@ -824,7 +824,7 @@ IF (has_locators) {
824824

825825
function at_all_locators {
826826
#ARGS: {command: string}
827-
debug assert executed_as_root_entity
827+
debug assert executed_as_root_entity <%TAGS.PROJECT_ROOT(export_namespace)%>
828828

829829
data remove storage <%temp_storage%> args
830830
$data modify storage <%temp_storage%> args merge value {command:'$(command)'}
@@ -850,7 +850,7 @@ IF (has_locators) {
850850
IF (has_cameras) {
851851
function as_camera {
852852
#ARGS: {name: string, command: string}
853-
debug assert executed_as_root_entity
853+
debug assert executed_as_root_entity <%TAGS.PROJECT_ROOT(export_namespace)%>
854854

855855
data remove storage <%temp_storage%> args
856856
$data modify storage <%temp_storage%> args merge value {name:'$(name)', command:'$(command)', uuid:'+MISSING_UUID+'}
@@ -904,7 +904,7 @@ dir remove {
904904

905905
function this {
906906
# Removes the rig this function is executed as.
907-
debug assert executed_as_root_entity
907+
debug assert executed_as_root_entity <%TAGS.PROJECT_ROOT(export_namespace)%>
908908

909909
<%%
910910
if (on_remove_function) emit.mcb(on_remove_function)
@@ -944,7 +944,7 @@ dir remove {
944944

945945
dir this {
946946
function without_on_remove_function {
947-
debug assert executed_as_root_entity
947+
debug assert executed_as_root_entity <%TAGS.PROJECT_ROOT(export_namespace)%>
948948

949949
IF (has_entity_locators || has_cameras) {
950950
execute on passengers if entity @s[tag=<%TAGS.GLOBAL_DATA()%>] run block as_data {
@@ -975,7 +975,7 @@ IF (Object.keys(rig.variants).length > 1) {
975975
REPEAT (Object.values(rig.variants)) as variant {
976976
dir <%variant.name%> {
977977
function apply {
978-
debug assert executed_as_root_entity
978+
debug assert executed_as_root_entity <%TAGS.PROJECT_ROOT(export_namespace)%>
979979

980980
<%%
981981
global.filteredNodes = Object.values(rig.nodes).filter(
@@ -1093,7 +1093,7 @@ IF (has_locators || has_cameras) {
10931093

10941094
function apply_default_pose {
10951095
# Changes the pose of the rig to the the default pose with interpolation
1096-
debug assert executed_as_root_entity
1096+
debug assert executed_as_root_entity <%TAGS.PROJECT_ROOT(export_namespace)%>
10971097

10981098
IF (has_locators || has_cameras) {
10991099
function ./zzz/reset_floating_entities
@@ -1113,7 +1113,7 @@ function apply_default_pose {
11131113

11141114
function set_default_pose {
11151115
# Changes the pose of the rig to the the default pose without interpolation
1116-
debug assert executed_as_root_entity
1116+
debug assert executed_as_root_entity <%TAGS.PROJECT_ROOT(export_namespace)%>
11171117

11181118
IF (has_locators || has_cameras) {
11191119
function ./zzz/reset_floating_entities

src/systems/datapackCompiler/1.20.4/global.mcb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ dir global {
118118
# Removes locators and cameras owned by the rig, even if they're not included in the currently loaded export.
119119
function outdated_rig {
120120
# Assert that the function is being executed as a root entity.
121-
debug assert executed_as_root_entity
121+
debug assert executed_as_root_entity <%TAGS.GLOBAL_ROOT()%>
122122

123123
execute on passengers if entity @s[tag=<%TAGS.GLOBAL_DATA()%>] run block as_data {
124124
data remove storage <%temp_storage%> args

src/systems/datapackCompiler/1.20.4/global.mcbt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
template debug {
2-
with assert:literal executed_as_root_entity:literal {
2+
with assert:literal executed_as_root_entity:literal root_tag:literal {
33
IF (debug_mode) {
4-
execute unless entity @s[type=minecraft:item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \
4+
execute unless entity @s[type=minecraft:item_display,tag=<%root_tag%>] run return run \
55
tellraw @a <%TELLRAW.FUNCTION_NOT_EXECUTED_AS_ROOT_ERROR(context.functions.at(-1))%>
66
}
77
}

src/systems/datapackCompiler/1.20.4/static.mcb

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ dir root {
9898

9999
IF (!auto_update_rig_orientation) {
100100
function move {
101-
debug assert executed_as_root_entity
101+
debug assert executed_as_root_entity <%TAGS.PROJECT_ROOT(export_namespace)%>
102102

103103
tp @s ~ ~ ~ ~ ~
104104

@@ -303,7 +303,7 @@ function summon {
303303
IF (has_entity_locators) {
304304
function as_locator {
305305
#ARGS: {name: string, command: string}
306-
debug assert executed_as_root_entity
306+
debug assert executed_as_root_entity <%TAGS.PROJECT_ROOT(export_namespace)%>
307307

308308
data remove storage <%temp_storage%> args
309309
$data modify storage <%temp_storage%> args merge value {name:'$(name)', command:'$(command)', uuid:'+MISSING_UUID+'}
@@ -340,7 +340,7 @@ IF (has_entity_locators) {
340340

341341
function as_all_locators {
342342
#ARGS: {command: string}
343-
debug assert executed_as_root_entity
343+
debug assert executed_as_root_entity <%TAGS.PROJECT_ROOT(export_namespace)%>
344344

345345
data remove storage <%temp_storage%> args
346346
$data modify storage <%temp_storage%> args merge value {command:'$(command)'}
@@ -363,7 +363,7 @@ IF (has_entity_locators) {
363363
IF (has_locators) {
364364
function at_locator {
365365
#ARGS: {name: string, command: string}
366-
debug assert executed_as_root_entity
366+
debug assert executed_as_root_entity <%TAGS.PROJECT_ROOT(export_namespace)%>
367367

368368
data remove storage <%temp_storage%> args
369369
$data modify storage <%temp_storage%> args merge value {name:'$(name)', command:'$(command)'}
@@ -405,7 +405,7 @@ IF (has_locators) {
405405

406406
function at_all_locators {
407407
#ARGS: {command: string}
408-
debug assert executed_as_root_entity
408+
debug assert executed_as_root_entity <%TAGS.PROJECT_ROOT(export_namespace)%>
409409

410410
data remove storage <%temp_storage%> args
411411
$data modify storage <%temp_storage%> args merge value {command:'$(command)'}
@@ -431,7 +431,7 @@ IF (has_locators) {
431431
IF (has_cameras) {
432432
function as_camera {
433433
#ARGS: {name: string, command: string}
434-
debug assert executed_as_root_entity
434+
debug assert executed_as_root_entity <%TAGS.PROJECT_ROOT(export_namespace)%>
435435

436436
data remove storage <%temp_storage%> args
437437
$data modify storage <%temp_storage%> args merge value {name:'$(name)', command:'$(command)', uuid:'+MISSING_UUID+'}
@@ -485,7 +485,7 @@ dir remove {
485485

486486
function this {
487487
# Removes the rig this function is executed as.
488-
debug assert executed_as_root_entity
488+
debug assert executed_as_root_entity <%TAGS.PROJECT_ROOT(export_namespace)%>
489489

490490
<%%
491491
if (on_remove_function) emit.mcb(on_remove_function)
@@ -525,7 +525,7 @@ dir remove {
525525

526526
dir this {
527527
function without_on_remove_function {
528-
debug assert executed_as_root_entity
528+
debug assert executed_as_root_entity <%TAGS.PROJECT_ROOT(export_namespace)%>
529529

530530
IF (has_entity_locators || has_cameras) {
531531
execute on passengers if entity @s[tag=<%TAGS.GLOBAL_DATA()%>] run block as_data {
@@ -556,7 +556,7 @@ IF (Object.keys(rig.variants).length > 1) {
556556
REPEAT (Object.values(rig.variants)) as variant {
557557
dir <%variant.name%> {
558558
function apply {
559-
debug assert executed_as_root_entity
559+
debug assert executed_as_root_entity <%TAGS.PROJECT_ROOT(export_namespace)%>
560560

561561
<%%
562562
global.filteredNodes = Object.values(rig.nodes).filter(
@@ -674,7 +674,7 @@ IF (has_locators || has_cameras) {
674674

675675
function set_default_pose {
676676
# Changes the pose of the rig to the the default pose without interpolation
677-
debug assert executed_as_root_entity
677+
debug assert executed_as_root_entity <%TAGS.PROJECT_ROOT(export_namespace)%>
678678

679679
IF (has_locators || has_cameras) {
680680
function ./zzz/reset_floating_entities

0 commit comments

Comments
 (0)