Skip to content

Commit 11f81d5

Browse files
committed
🛠️ Fixed #303
1 parent ade7351 commit 11f81d5

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/components/variantConfigDialog.svelte

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@
100100
label={translate('dialog.variant_config.variant_display_name')}
101101
bind:value={displayName}
102102
tooltip={translate('dialog.variant_config.variant_display_name.description')}
103+
defaultValue={'New Variant'}
103104
/>
104105

105106
{#key $name}
@@ -109,12 +110,14 @@
109110
bind:value={name}
110111
tooltip={translate('dialog.variant_config.variant_name.description')}
111112
disabled
113+
defaultValue={'new_variant'}
112114
/>
113115
{:else}
114116
<LineInput
115117
label={translate('dialog.variant_config.variant_name')}
116118
bind:value={name}
117119
tooltip={translate('dialog.variant_config.variant_name.description')}
120+
defaultValue={'new_variant'}
118121
/>
119122
{/if}
120123
{/key}
@@ -123,6 +126,7 @@
123126
label={translate('dialog.variant_config.generate_name_from_display_name')}
124127
bind:checked={generateNameFromDisplayName}
125128
tooltip={translate('dialog.variant_config.generate_name_from_display_name.description')}
129+
defaultValue={true}
126130
/>
127131

128132
<div class="uuid">

src/systems/datapackCompiler/animation.mcb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,9 @@ dir <%export_namespace%> {
232232
tag @s add <%TAGS.ANIMATION_PLAYING(export_namespace, animation.safe_name)%>
233233
scoreboard players set @s <%OBJECTIVES.FRAME(animation.safe_name)%> 0
234234
tag @s add <%TAGS.TRANSFORMS_ONLY()%>
235+
say pre
235236
execute at @s run function ./zzz/set_frame {frame: 0}
237+
say post
236238
tag @s remove <%TAGS.TRANSFORMS_ONLY()%>
237239
}
238240
function stop {
@@ -309,14 +311,14 @@ dir <%export_namespace%> {
309311
execute if score @s <%OBJECTIVES.TWEEN_DURATION()%> matches 1.. run return 1
310312
execute if score @s <%OBJECTIVES.TWEEN_DURATION()%> matches 0 on passengers run data modify entity @s interpolation_duration set value <%interpolation_duration%>
311313
# Animation logic
312-
execute store result storage aj:temp frame int 1 run scoreboard players get @s <%OBJECTIVES.FRAME(animation.safe_name)%>
313314
IF (animation.loop_mode === 'loop' && animation.loop_delay === 0) {
314315
# Makes sure commands in the last frame of the animation is run.
315316
execute if score @s <%OBJECTIVES.FRAME(animation.safe_name)%> matches -1 run {
316317
function ./apply_frame {frame: <%animation.duration-1%>}
317318
scoreboard players add @s <%OBJECTIVES.FRAME(animation.safe_name)%> 1
318319
}
319320
}
321+
execute store result storage aj:temp frame int 1 run scoreboard players get @s <%OBJECTIVES.FRAME(animation.safe_name)%>
320322
function ./apply_frame with storage aj:temp
321323
IF (animation.loop_mode === 'loop') {
322324
execute if score @s <%OBJECTIVES.FRAME(animation.safe_name)%> matches <%animation.duration-2 + animation.loop_delay%>.. run return run {
@@ -572,7 +574,9 @@ dir <%export_namespace%> {
572574
}
573575
# Attempt to apply the animation frame, if it fails, print an error.
574576
execute store success score #success <%OBJECTIVES.I()%> run { with storage aj:temp args
577+
tag @s add <%TAGS.TRANSFORMS_ONLY()%>
575578
$execute store success score #success <%OBJECTIVES.I()%> run function *<%export_namespace%>/animations/$(animation)/set_frame with storage aj:temp args
579+
tag @s remove <%TAGS.TRANSFORMS_ONLY()%>
576580
execute if score #success <%OBJECTIVES.I()%> matches 1 run return 1
577581
return fail
578582
}

0 commit comments

Comments
 (0)