@@ -70,17 +70,20 @@ dir root {
7070 IF (has_locators || has_cameras) {
7171 function <%blueprint_id%>/root/on_tick/transform_floating_entities
7272 }
73-
74- block { with storage <%temp_storage%> entry.data.uuids_by_name
75- REPEAT (Object.values(rig.nodes).filter(node => BONE_TYPES.includes(node.type))) as node {
76- $tp $(<%node.storage_name%>) ~ ~ ~ ~ ~
77- # Precise Rotation Workaround. Fixes MC-272913.
78- # Thanks @Triton365! (https://discord.com/channels/154777837382008833/157097006500806656/1402253905408163842)
79- $execute \
80- as $(<%node.storage_name%>) \
81- store success entity @s OnGround byte 1 \
82- store success score @s <%OBJECTIVES.I()%> \
83- unless score @s <%OBJECTIVES.I()%> matches 1
73+ IF (use_entity_stacking) {
74+ execute on passengers run rotate @s ~ ~
75+ } ELSE {
76+ block { with storage <%temp_storage%> entry.data.uuids_by_name
77+ REPEAT (Object.values(rig.nodes).filter(node => BONE_TYPES.includes(node.type))) as node {
78+ $tp $(<%node.storage_name%>) ~ ~ ~ ~ ~
79+ # Precise Rotation Workaround. Fixes MC-272913.
80+ # Thanks @Triton365! (https://discord.com/channels/154777837382008833/157097006500806656/1402253905408163842)
81+ $execute \
82+ as $(<%node.storage_name%>) \
83+ store success entity @s OnGround byte 1 \
84+ store success score @s <%OBJECTIVES.I()%> \
85+ unless score @s <%OBJECTIVES.I()%> matches 1
86+ }
8487 }
8588 }
8689 } ELSE IF (has_ticking_locators) {
@@ -176,17 +179,20 @@ IF (!auto_update_rig_orientation) {
176179 IF (has_locators || has_cameras) {
177180 function <%blueprint_id%>/root/on_tick/transform_floating_entities
178181 }
179-
180- block { with storage <%temp_storage%> entry.data.uuids_by_name
181- REPEAT (Object.values(rig.nodes).filter(node => BONE_TYPES.includes(node.type))) as node {
182- $tp $(<%node.storage_name%>) ~ ~ ~ ~ ~
183- # Precise Rotation Workaround. Fixes MC-272913.
184- # Thanks @Triton365! (https://discord.com/channels/154777837382008833/157097006500806656/1402253905408163842)
185- $execute \
186- as $(<%node.storage_name%>) \
187- store success entity @s OnGround byte 1 \
188- store success score @s <%OBJECTIVES.I()%> \
189- unless score @s <%OBJECTIVES.I()%> matches 1
182+ IF (use_entity_stacking) {
183+ execute at @s on passengers run rotate @s ~ ~
184+ } ELSE {
185+ block { with storage <%temp_storage%> entry.data.uuids_by_name
186+ REPEAT (Object.values(rig.nodes).filter(node => BONE_TYPES.includes(node.type))) as node {
187+ $tp $(<%node.storage_name%>) ~ ~ ~ ~ ~
188+ # Precise Rotation Workaround. Fixes MC-272913.
189+ # Thanks @Triton365! (https://discord.com/channels/154777837382008833/157097006500806656/1402253905408163842)
190+ $execute \
191+ as $(<%node.storage_name%>) \
192+ store success entity @s OnGround byte 1 \
193+ store success score @s <%OBJECTIVES.I()%> \
194+ unless score @s <%OBJECTIVES.I()%> matches 1
195+ }
190196 }
191197 }
192198 }
@@ -285,13 +291,17 @@ IF (has_animations) {
285291 $execute at @s run function ./zzz/apply_frame {frame: $(to_frame)}
286292 tag @s remove <%TAGS.TRANSFORMS_ONLY()%>
287293
288- data_manager prep read
289- block { with storage <%temp_storage%> entry.data.uuids_by_name
290- REPEAT (Object.values(rig.nodes).filter(node => BONE_TYPES.includes(node.type))) as node {
291- $execute \
292- as $(<%node.storage_name%>) \
293- store result entity @s interpolation_duration int 1 \
294- run scoreboard players get #this <%OBJECTIVES.I()%>
294+ IF (use_entity_stacking) {
295+ execute on passengers store result entity @s interpolation_duration int 1 run scoreboard players get #this <%OBJECTIVES.I()%>
296+ } ELSE {
297+ data_manager prep read
298+ block { with storage <%temp_storage%> entry.data.uuids_by_name
299+ REPEAT (Object.values(rig.nodes).filter(node => BONE_TYPES.includes(node.type))) as node {
300+ $execute \
301+ as $(<%node.storage_name%>) \
302+ store result entity @s interpolation_duration int 1 \
303+ run scoreboard players get #this <%OBJECTIVES.I()%>
304+ }
295305 }
296306 }
297307 }
@@ -301,12 +311,17 @@ IF (has_animations) {
301311 # Tweening logic
302312 scoreboard players remove @s <%OBJECTIVES.TWEEN_DURATION()%> 1
303313 execute if score @s <%OBJECTIVES.TWEEN_DURATION()%> matches 1.. run return 1
304- execute if score @s <%OBJECTIVES.TWEEN_DURATION()%> matches 0 run \
305- block { with storage <%temp_storage%> entry.data.uuids_by_name
306- REPEAT (Object.values(rig.nodes).filter(node => BONE_TYPES.includes(node.type))) as node {
307- $data modify entity $(<%node.storage_name%>) interpolation_duration set value <%interpolation_duration%>
314+ IF (use_entity_stacking) {
315+ execute if score @s <%OBJECTIVES.TWEEN_DURATION()%> matches 0 on passengers run \
316+ data modify entity @s interpolation_duration set value <%interpolation_duration%>
317+ } ELSE {
318+ execute if score @s <%OBJECTIVES.TWEEN_DURATION()%> matches 0 run \
319+ block { with storage <%temp_storage%> entry.data.uuids_by_name
320+ REPEAT (Object.values(rig.nodes).filter(node => BONE_TYPES.includes(node.type))) as node {
321+ $data modify entity $(<%node.storage_name%>) interpolation_duration set value <%interpolation_duration%>
322+ }
308323 }
309- }
324+ }
310325
311326 # Animation logic
312327 IF (animation.loop_mode === 'loop' && animation.loop_delay === 0) {
@@ -356,9 +371,13 @@ IF (has_animations) {
356371 function set_frame {
357372 #ARGS: {frame: int}
358373 $function ./apply_frame {frame: $(frame)}
359- block { with storage <%temp_storage%> entry.data.uuids_by_name
360- REPEAT (Object.values(rig.nodes).filter(node => BONE_TYPES.includes(node.type))) as node {
361- $data modify entity $(<%node.storage_name%>) start_interpolation set value -1
374+ IF (use_entity_stacking) {
375+ execute on passengers run data modify entity @s start_interpolation set value -1
376+ } ELSE {
377+ block { with storage <%temp_storage%> entry.data.uuids_by_name
378+ REPEAT (Object.values(rig.nodes).filter(node => BONE_TYPES.includes(node.type))) as node {
379+ $data modify entity $(<%node.storage_name%>) start_interpolation set value -1
380+ }
362381 }
363382 }
364383 return 1
@@ -398,9 +417,14 @@ IF (has_animations) {
398417
399418 $function ./frames/$(frame) with storage <%temp_storage%> entry.data.uuids_by_name
400419
401- block { with storage <%temp_storage%> entry.data.uuids_by_name
402- REPEAT (Object.values(rig.nodes).filter(node => BONE_TYPES.includes(node.type))) as node {
403- $data modify entity $(<%node.storage_name%>) start_interpolation set value -1
420+ IF (use_entity_stacking) {
421+ execute on passengers run \
422+ data modify entity @s start_interpolation set value -1
423+ } ELSE {
424+ block { with storage <%temp_storage%> entry.data.uuids_by_name
425+ REPEAT (Object.values(rig.nodes).filter(node => BONE_TYPES.includes(node.type))) as node {
426+ $data modify entity $(<%node.storage_name%>) start_interpolation set value -1
427+ }
404428 }
405429 }
406430
0 commit comments