File tree Expand file tree Collapse file tree 4 files changed +489
-6
lines changed
components/keyframePanels
systems/datapackCompiler/1.21.5
test-packs/1.21.5/blueprints Expand file tree Collapse file tree 4 files changed +489
-6
lines changed Original file line number Diff line number Diff line change 7
7
const keyframeValue = new Valuable <string >(getKeyframeVariant (selectedKeyframe ) as string )
8
8
let selectContainer: HTMLDivElement
9
9
10
+ if (! Variant .all .find (v => v .uuid === keyframeValue .get ())) {
11
+ console .warn (' Keyframe variant not found. Resetting to default.' )
12
+ const uuid = Variant .getDefault ().uuid
13
+ setKeyframeVariant (selectedKeyframe , uuid )
14
+ keyframeValue .set (uuid )
15
+ }
16
+
10
17
keyframeValue .subscribe (value => {
11
18
setKeyframeVariant (selectedKeyframe , value )
12
19
})
Original file line number Diff line number Diff line change @@ -548,7 +548,7 @@ dir <%export_namespace%> {
548
548
type=<%locator.config.entity_type%>, \
549
549
tag=<%TAGS.NEW()%>, \
550
550
tag=<%TAGS.PROJECT_LOCATOR_NAMED(export_namespace, locator.storage_name)%>, \
551
- distance=..<%locator.max_distance + 1 %> \
551
+ distance=..<%Math.ceil( locator.max_distance) %> \
552
552
] \
553
553
run block as_locator/<%locator.path_name%> {
554
554
# run block ../as_locator/<%locator.path_name%> {
@@ -582,9 +582,10 @@ dir <%export_namespace%> {
582
582
type=minecraft:item_display, \
583
583
tag=<%TAGS.NEW()%>, \
584
584
tag=<%TAGS.PROJECT_CAMERA_NAMED(export_namespace, camera.storage_name)%>, \
585
- distance=..<%camera.max_distance + 1 %> \
585
+ distance=..<%Math.ceil( camera.max_distance) %> \
586
586
] \
587
- run block ../as_camera/<%camera.path_name%> {
587
+ run block as_camera/<%camera.path_name%> {
588
+ # run block ../as_camera/<%camera.path_name%> {
588
589
tag @s remove <%TAGS.NEW()%>
589
590
function *global/internal/gu/convert_uuid_array_to_string
590
591
tp @s \
Original file line number Diff line number Diff line change 1
1
import { IBlueprintVariantJSON } from './blueprintFormat'
2
+ import { getKeyframeVariant , setKeyframeVariant } from './mods/customKeyframesMod'
2
3
import { events } from './util/events'
3
4
import { sanitizePathName } from './util/minecraftUtil'
4
5
@@ -116,6 +117,17 @@ export class Variant {
116
117
// Cannot delete default variant
117
118
if ( this . isDefault ) return
118
119
120
+ for ( const animation of Blockbench . Animation . all ) {
121
+ for ( const animator of Object . values ( animation . animators ) ) {
122
+ for ( const keyframe of animator . keyframes ) {
123
+ const uuid = getKeyframeVariant ( keyframe )
124
+ if ( uuid != undefined && this . uuid === uuid ) {
125
+ setKeyframeVariant ( keyframe , Variant . getDefault ( ) . uuid )
126
+ }
127
+ }
128
+ }
129
+ }
130
+
119
131
const index = Variant . all . indexOf ( this )
120
132
if ( index > - 1 ) {
121
133
Variant . all . splice ( index , 1 )
You can’t perform that action at this time.
0 commit comments