Skip to content

Commit 5c04323

Browse files
committed
🛠️ Fix #198
1 parent 40e682f commit 5c04323

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

src/systems/exporter.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { PROGRESS_DESCRIPTION, openExportProgressDialog } from '../interface/exp
55
import { openUnexpectedErrorDialog } from '../interface/unexpectedErrorDialog'
66
import { resolveEnvVariables } from '../util/misc'
77
import { translate } from '../util/translation'
8+
import { Variant } from '../variants'
89
import { hashAnimations, renderProjectAnimations } from './animationRenderer'
910
import { compileDataPack } from './datapackCompiler'
1011
import { exportJSON } from './jsonExporter'
@@ -18,6 +19,8 @@ async function actuallyExportProject(forceSave = true) {
1819
const dialog = openExportProgressDialog()
1920
// Wait for the dialog to open
2021
await new Promise(resolve => requestAnimationFrame(resolve))
22+
const selectedVariant = Variant.selected
23+
Variant.getDefault().select()
2124
try {
2225
console.time('Exporting project took')
2326

@@ -112,11 +115,9 @@ async function actuallyExportProject(forceSave = true) {
112115
console.timeEnd('Exporting project took')
113116

114117
if (forceSave) saveBlueprint()
115-
dialog.close(0)
116118
Blockbench.showQuickMessage('Project exported successfully!', 2000)
117119
} catch (e: any) {
118120
console.error(e)
119-
dialog.close(0)
120121
if (e instanceof IntentionalExportError) {
121122
Blockbench.showMessageBox({
122123
title: translate('misc.failed_to_export.title'),
@@ -126,6 +127,9 @@ async function actuallyExportProject(forceSave = true) {
126127
return
127128
}
128129
openUnexpectedErrorDialog(e as Error)
130+
} finally {
131+
selectedVariant?.select()
132+
dialog.close(0)
129133
}
130134
}
131135

test_blueprints/armor_stand.ajblueprint

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"show_bounding_box": false,
1212
"auto_bounding_box": true,
1313
"bounding_box": [95, 32],
14-
"enable_plugin_mode": true,
14+
"enable_plugin_mode": false,
1515
"resource_pack_export_mode": "raw",
1616
"data_pack_export_mode": "raw",
1717
"display_item": "minecraft:white_dye",
@@ -1593,9 +1593,9 @@
15931593
],
15941594
"variants": {
15951595
"default": {
1596-
"display_name": "default",
1596+
"display_name": "Default",
15971597
"name": "default",
1598-
"uuid": "f78e10c0-a4a3-aa2f-43ac-753facebd709",
1598+
"uuid": "99583e4c-1e3a-b03f-a802-1b5212a6eedb",
15991599
"texture_map": {},
16001600
"excluded_nodes": []
16011601
},

0 commit comments

Comments
 (0)