Skip to content

Commit a24c116

Browse files
committed
🛠️ More MDFU Bugfixes
- Fixed pre1 upgrade setting format version to the current format version instead of `0.5.0`. - Fixed `project_settings` being named `blueprint_settings` too early in the upgrade process. - Fixed Variants using excludedBones internally still.
1 parent c7fbf14 commit a24c116

File tree

6 files changed

+16
-16
lines changed

6 files changed

+16
-16
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
"type": "module",
33
"name": "animated_java",
44
"title": "Animated Java",
5-
"version": "0.5.6",
6-
"display_version": "1.0.0-pre7",
5+
"version": "0.5.7",
6+
"display_version": "1.0.0-pre8",
77
"min_blockbench_version": "4.10.0",
88
"author": {
99
"name": "Titus Evans (SnaveSutit)",

src/interface/variantConfigDialog.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export function openVariantConfigDialog(variant: Variant) {
1212
const uuid = new Valuable(variant.uuid)
1313
const textureMap = variant.textureMap.copy()
1414
const generateNameFromDisplayName = new Valuable(variant.generateNameFromDisplayName)
15-
const excludedBones = new Valuable(variant.excludedBones)
15+
const excludedBones = new Valuable(variant.excludedNodes)
1616

1717
new SvelteDialog({
1818
id: `${PACKAGE.name}:variantConfig`,
@@ -35,7 +35,7 @@ export function openVariantConfigDialog(variant: Variant) {
3535
variant.uuid = uuid.get()
3636
variant.textureMap = textureMap
3737
variant.generateNameFromDisplayName = generateNameFromDisplayName.get()
38-
variant.excludedBones = excludedBones.get()
38+
variant.excludedNodes = excludedBones.get()
3939
events.UPDATE_VARIANT.dispatch(variant)
4040
variant.select()
4141
},

src/mods/variantPreviewCubeFaceMod.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ createBlockbenchMod(
1515
if (
1616
variant &&
1717
this.cube.parent instanceof Group &&
18-
!variant.excludedBones.find(
18+
!variant.excludedNodes.find(
1919
v => v.value === (this.cube.parent as Group).uuid
2020
) &&
2121
variant.textureMap.has(this.texture)

src/systems/modelDataFixerUpper.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -208,11 +208,11 @@ function updateModelTo1_0pre1(model: any) {
208208
const blueprint: IBlueprintFormatJSON = {
209209
meta: {
210210
format: 'animated_java_blueprint',
211-
format_version: PACKAGE.version,
211+
format_version: '0.5.0',
212212
uuid: model.meta.uuid || guid(),
213213
last_used_export_namespace: model.animated_java.settings.project_namespace,
214214
},
215-
blueprint_settings: {
215+
project_settings: {
216216
// Blueprint Settings
217217
show_bounding_box: defaultSettings.show_bounding_box,
218218
auto_bounding_box: defaultSettings.auto_bounding_box,
@@ -380,13 +380,13 @@ function updateModelTo1_0pre1(model: any) {
380380
// Move command keyframes into commands channel on a "root" locator.
381381
if (blueprint.animations) {
382382
for (const animation of blueprint.animations) {
383-
if (animation.animators.effects) {
383+
if (animation.animators?.effects) {
384384
for (const kf of animation.animators.effects.keyframes) {
385385
if (kf.channel === 'variants') kf.channel = 'variant'
386386
}
387387
}
388388
const keyframes: any[] = []
389-
const effects = animation.animators.effects
389+
const effects = animation.animators?.effects
390390
if (!effects || !effects.keyframes) continue
391391
for (const keyframe of effects.keyframes) {
392392
if (
@@ -439,10 +439,10 @@ function updateModelTo1_0pre1(model: any) {
439439
nbt.delete('Tags')
440440
if ([...nbt.keys()].length !== 0) commands.push('data merge entity @s ' + nbt.toString())
441441
if (tags) commands.push(...tags.map(t => `tag @s add ${t}`))
442-
blueprint.blueprint_settings!.summon_commands = commands.join('\n')
442+
// @ts-expect-error
443+
blueprint.project_settings!.summon_commands = commands.join('\n')
443444
}
444445

445-
console.log('Finished Blueprint:', blueprint)
446446
return blueprint
447447
}
448448

src/systems/rigRenderer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@ function renderVariantModels(variant: Variant, rig: IRenderedRig) {
561561

562562
for (const [uuid, bone] of Object.entries(rig.nodeMap)) {
563563
if (bone.type !== 'bone') continue
564-
if (variant.excludedBones.find(v => v.value === uuid)) continue
564+
if (variant.excludedNodes.find(v => v.value === uuid)) continue
565565
const textures: IRenderedModel['textures'] = {}
566566

567567
for (const [fromUUID, toUUID] of variant.textureMap.map.entries()) {

src/variants.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ export class Variant {
9292
public textureMap: TextureMap
9393
public isDefault = false
9494
public generateNameFromDisplayName = true
95-
public excludedBones: CollectionItem[] = []
95+
public excludedNodes: CollectionItem[] = []
9696

9797
constructor(displayName: string, isDefault = false) {
9898
this.displayName = Variant.makeDisplayNameUnique(this, displayName)
@@ -140,7 +140,7 @@ export class Variant {
140140
name: this.name,
141141
uuid: this.uuid,
142142
texture_map: Object.fromEntries(this.textureMap.map),
143-
excluded_nodes: this.excludedBones.map(item => item.value),
143+
excluded_nodes: this.excludedNodes.map(item => item.value),
144144
}
145145
}
146146

@@ -150,7 +150,7 @@ export class Variant {
150150
variant.isDefault = false
151151
variant.generateNameFromDisplayName = this.generateNameFromDisplayName
152152
variant.textureMap = this.textureMap.copy()
153-
variant.excludedBones = this.excludedBones.map(item => ({ ...item }))
153+
variant.excludedNodes = this.excludedNodes.map(item => ({ ...item }))
154154
variant.select()
155155
}
156156

@@ -160,7 +160,7 @@ export class Variant {
160160
for (const [key, value] of Object.entries(json.texture_map)) {
161161
variant.textureMap.add(key, value)
162162
}
163-
variant.excludedBones = json.excluded_nodes
163+
variant.excludedNodes = json.excluded_nodes
164164
.map(uuid => {
165165
const group = Group.all.find(group => group.uuid === uuid)
166166
return group ? { name: group.name, value: uuid } : undefined

0 commit comments

Comments
 (0)