Skip to content

Commit 8a1c317

Browse files
committed
🔀 Merge #419: 🔖 v1.7.3
2 parents 7812bb3 + b9b123e commit 8a1c317

File tree

4 files changed

+489
-6
lines changed

4 files changed

+489
-6
lines changed

src/components/keyframePanels/variantKeyframePanel.svelte

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@
77
const keyframeValue = new Valuable<string>(getKeyframeVariant(selectedKeyframe) as string)
88
let selectContainer: HTMLDivElement
99
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+
1017
keyframeValue.subscribe(value => {
1118
setKeyframeVariant(selectedKeyframe, value)
1219
})

src/systems/datapackCompiler/1.21.5/animation.mcb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ dir <%export_namespace%> {
548548
type=<%locator.config.entity_type%>, \
549549
tag=<%TAGS.NEW()%>, \
550550
tag=<%TAGS.PROJECT_LOCATOR_NAMED(export_namespace, locator.storage_name)%>, \
551-
distance=..<%locator.max_distance + 1%> \
551+
distance=..<%Math.ceil(locator.max_distance)%> \
552552
] \
553553
run block as_locator/<%locator.path_name%> {
554554
# run block ../as_locator/<%locator.path_name%> {
@@ -582,9 +582,10 @@ dir <%export_namespace%> {
582582
type=minecraft:item_display, \
583583
tag=<%TAGS.NEW()%>, \
584584
tag=<%TAGS.PROJECT_CAMERA_NAMED(export_namespace, camera.storage_name)%>, \
585-
distance=..<%camera.max_distance + 1%> \
585+
distance=..<%Math.ceil(camera.max_distance)%> \
586586
] \
587-
run block ../as_camera/<%camera.path_name%> {
587+
run block as_camera/<%camera.path_name%> {
588+
# run block ../as_camera/<%camera.path_name%> {
588589
tag @s remove <%TAGS.NEW()%>
589590
function *global/internal/gu/convert_uuid_array_to_string
590591
tp @s \

src/variants.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { IBlueprintVariantJSON } from './blueprintFormat'
2+
import { getKeyframeVariant, setKeyframeVariant } from './mods/customKeyframesMod'
23
import { events } from './util/events'
34
import { sanitizePathName } from './util/minecraftUtil'
45

@@ -116,6 +117,17 @@ export class Variant {
116117
// Cannot delete default variant
117118
if (this.isDefault) return
118119

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+
119131
const index = Variant.all.indexOf(this)
120132
if (index > -1) {
121133
Variant.all.splice(index, 1)

0 commit comments

Comments
 (0)