Skip to content

Commit 4c66ee4

Browse files
committed
🛠️ Fixed some more loading issues
1 parent 3adee11 commit 4c66ee4

File tree

6 files changed

+180
-18
lines changed

6 files changed

+180
-18
lines changed

src/mods/blockbenchReadMod.ts

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,24 @@ createBlockbenchMod(
2626
for (const promise of Project.loadingPromises) {
2727
promises.push(
2828
new Promise<void>(r => {
29-
promise.finally(() => {
30-
PROGRESS.set(PROGRESS.get() + 1)
31-
r()
32-
})
29+
promise
30+
.catch((err: any) => console.error(err))
31+
.finally(() => {
32+
PROGRESS.set(PROGRESS.get() + 1)
33+
r()
34+
})
3335
})
3436
)
3537
}
36-
void Promise.all(promises).finally(() => {
37-
closeBlueprintLoadingDialog()
38-
r()
39-
})
38+
void Promise.all(promises)
39+
.catch(err => {
40+
console.error('Failed to load project')
41+
console.error(err)
42+
})
43+
.finally(() => {
44+
closeBlueprintLoadingDialog()
45+
r()
46+
})
4047
return
4148
}
4249
r()

src/outliner/textDisplay.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -385,12 +385,15 @@ export const PREVIEW_CONTROLLER = new NodePreviewController(TextDisplay, {
385385
// Minecraft's transparency is funky 😭
386386
Project!.nodes_3d[el.uuid].renderOrder = -1
387387

388-
void getVanillaFont().then(() => {
389-
el.ready = true
390-
el.preview_controller.updateTransform(el)
391-
el.preview_controller.updateGeometry(el)
392-
el.preview_controller.dispatchEvent('setup', { element: el })
393-
})
388+
void getVanillaFont()
389+
.then(() => {
390+
el.preview_controller.updateTransform(el)
391+
el.preview_controller.updateGeometry(el)
392+
el.preview_controller.dispatchEvent('setup', { element: el })
393+
})
394+
.finally(() => {
395+
el.ready = true
396+
})
394397
},
395398
updateGeometry(el: TextDisplay) {
396399
void el.updateText().then(() => {

src/outliner/vanillaBlockDisplay.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,6 @@ export const PREVIEW_CONTROLLER = new NodePreviewController(VanillaBlockDisplay,
245245
el.preview_controller.updateTransform(el)
246246
mesh.visible = el.visibility
247247
TickUpdates.selection = true
248-
249-
el.ready = true
250248
})
251249
.catch(err => {
252250
console.error(err)
@@ -259,6 +257,7 @@ export const PREVIEW_CONTROLLER = new NodePreviewController(VanillaBlockDisplay,
259257
if (el.error.get()) el.mesh.outline.material = ERROR_OUTLINE_MATERIAL
260258
else el.mesh.outline.material = Canvas.outlineMaterial
261259
}
260+
el.ready = true
262261
})
263262
},
264263
updateTransform(el: VanillaBlockDisplay) {

src/outliner/vanillaItemDisplay.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,14 +253,15 @@ export const PREVIEW_CONTROLLER = new NodePreviewController(VanillaItemDisplay,
253253
el.preview_controller.updateTransform(el)
254254
mesh.visible = el.visibility
255255
TickUpdates.selection = true
256-
257-
el.ready = true
258256
})
259257
.catch(err => {
260258
if (typeof err.message === 'string') {
261259
el.error.set(err.message as string)
262260
}
263261
})
262+
.finally(() => {
263+
el.ready = true
264+
})
264265
},
265266
updateTransform(el: VanillaItemDisplay) {
266267
ResizableOutlinerElement.prototype.preview_controller.updateTransform(el)
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
{
2+
"meta": {
3+
"format": "animated_java_blueprint",
4+
"format_version": "1.4.2",
5+
"uuid": "14bbe7e9-9624-4742-51d2-3520485edd25",
6+
"save_location": "D:\\github-repos\\animated-java\\animated-java\\test_blueprints\\block_display.ajblueprint",
7+
"last_used_export_namespace": "blueprint"
8+
},
9+
"blueprint_settings": {
10+
"export_namespace": "blueprint",
11+
"show_bounding_box": false,
12+
"auto_bounding_box": true,
13+
"bounding_box": [48, 48],
14+
"enable_plugin_mode": false,
15+
"resource_pack_export_mode": "raw",
16+
"data_pack_export_mode": "raw",
17+
"display_item": "minecraft:white_dye",
18+
"custom_model_data_offset": 0,
19+
"enable_advanced_resource_pack_settings": false,
20+
"enable_advanced_resource_pack_folders": false,
21+
"resource_pack": "",
22+
"display_item_path": "",
23+
"model_folder": "",
24+
"texture_folder": "",
25+
"enable_advanced_data_pack_settings": false,
26+
"data_pack": "",
27+
"summon_commands": "",
28+
"ticking_commands": "",
29+
"interpolation_duration": 1,
30+
"teleportation_duration": 1,
31+
"use_storage_for_animation": false,
32+
"baked_animations": true,
33+
"json_file": ""
34+
},
35+
"resolution": {
36+
"width": 16,
37+
"height": 16
38+
},
39+
"elements": [
40+
{
41+
"name": "block_display",
42+
"position": [-8, 0, -8],
43+
"rotation": [0, 0, 0],
44+
"scale": [1, 1, 1],
45+
"visibility": true,
46+
"item": "minecraft:diamond",
47+
"item_display": "none",
48+
"config": {},
49+
"block": "cobblestone_wall[west=true]",
50+
"text": "\"Hello World!\"",
51+
"lineWidth": 200,
52+
"backgroundColor": "#000000",
53+
"backgroundAlpha": 0.25,
54+
"align": "center",
55+
"shadow": false,
56+
"seeThrough": false,
57+
"uuid": "31411dd2-b8c3-79b4-8437-db3c8c27da55",
58+
"type": "animated_java:vanilla_block_display"
59+
}
60+
],
61+
"outliner": ["31411dd2-b8c3-79b4-8437-db3c8c27da55"],
62+
"textures": [],
63+
"variants": {
64+
"default": {
65+
"name": "default",
66+
"display_name": "Default",
67+
"uuid": "9bee1050-b4bc-99ab-e677-5d2e595d8917",
68+
"texture_map": {},
69+
"excluded_nodes": [],
70+
"is_default": true
71+
},
72+
"list": []
73+
},
74+
"animations": [],
75+
"animation_controllers": []
76+
}
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
{
2+
"meta": {
3+
"format": "animated_java_blueprint",
4+
"format_version": "1.4.2",
5+
"uuid": "9c405d82-0d4a-7363-6bc8-b954cecc4f8e",
6+
"save_location": "D:\\github-repos\\animated-java\\animated-java\\test_blueprints\\item_display.ajblueprint",
7+
"last_used_export_namespace": "blueprint"
8+
},
9+
"blueprint_settings": {
10+
"export_namespace": "blueprint",
11+
"show_bounding_box": false,
12+
"auto_bounding_box": true,
13+
"bounding_box": [48, 48],
14+
"enable_plugin_mode": false,
15+
"resource_pack_export_mode": "raw",
16+
"data_pack_export_mode": "raw",
17+
"display_item": "minecraft:white_dye",
18+
"custom_model_data_offset": 0,
19+
"enable_advanced_resource_pack_settings": false,
20+
"enable_advanced_resource_pack_folders": false,
21+
"resource_pack": "",
22+
"display_item_path": "",
23+
"model_folder": "",
24+
"texture_folder": "",
25+
"enable_advanced_data_pack_settings": false,
26+
"data_pack": "",
27+
"summon_commands": "",
28+
"ticking_commands": "",
29+
"interpolation_duration": 1,
30+
"teleportation_duration": 1,
31+
"use_storage_for_animation": false,
32+
"baked_animations": true,
33+
"json_file": ""
34+
},
35+
"resolution": {
36+
"width": 16,
37+
"height": 16
38+
},
39+
"elements": [
40+
{
41+
"name": "item_display",
42+
"position": [0, 7, 0],
43+
"rotation": [0, 0, 0],
44+
"scale": [1, 1, 1],
45+
"visibility": true,
46+
"item": "minecraft:diamond",
47+
"item_display": "none",
48+
"config": {},
49+
"block": "minecraft:stone",
50+
"text": "\"Hello World!\"",
51+
"lineWidth": 200,
52+
"backgroundColor": "#000000",
53+
"backgroundAlpha": 0.25,
54+
"align": "center",
55+
"shadow": false,
56+
"seeThrough": false,
57+
"uuid": "bd8e6c1b-5ac3-3fd0-c2aa-2bfd09e8cf0f",
58+
"type": "animated_java:vanilla_item_display"
59+
}
60+
],
61+
"outliner": ["bd8e6c1b-5ac3-3fd0-c2aa-2bfd09e8cf0f"],
62+
"textures": [],
63+
"variants": {
64+
"default": {
65+
"name": "default",
66+
"display_name": "Default",
67+
"uuid": "6ff1669a-9dd5-9e36-3e45-6cb6069ebb4b",
68+
"texture_map": {},
69+
"excluded_nodes": [],
70+
"is_default": true
71+
},
72+
"list": []
73+
},
74+
"animations": [],
75+
"animation_controllers": []
76+
}

0 commit comments

Comments
 (0)