File tree Expand file tree Collapse file tree 3 files changed +53
-26
lines changed Expand file tree Collapse file tree 3 files changed +53
-26
lines changed Original file line number Diff line number Diff line change @@ -46,32 +46,7 @@ import { BLOCKSTATE_REGISTRY } from './systems/minecraft/blockstateManager'
46
46
import { exportProject } from './systems/exporter'
47
47
import { openBlueprintLoadingDialog } from './interface/blueprintLoadingPopup'
48
48
import { openInstallPopup } from './interface/installedPopup'
49
-
50
- // Show loading popup
51
- void showLoadingPopup ( ) . then ( async ( ) => {
52
- if ( ! window . navigator . onLine ) {
53
- showOfflineError ( )
54
- // return
55
- }
56
- events . NETWORK_CONNECTED . dispatch ( )
57
-
58
- await Promise . all ( [
59
- new Promise < void > ( resolve => events . MINECRAFT_ASSETS_LOADED . subscribe ( ( ) => resolve ( ) ) ) ,
60
- new Promise < void > ( resolve => events . MINECRAFT_REGISTRY_LOADED . subscribe ( ( ) => resolve ( ) ) ) ,
61
- new Promise < void > ( resolve => events . MINECRAFT_FONTS_LOADED . subscribe ( ( ) => resolve ( ) ) ) ,
62
- new Promise < void > ( resolve => events . BLOCKSTATE_REGISTRY_LOADED . subscribe ( ( ) => resolve ( ) ) ) ,
63
- ] )
64
- . then ( ( ) => {
65
- hideLoadingPopup ( )
66
- } )
67
- . catch ( error => {
68
- console . error ( error )
69
- Blockbench . showToastNotification ( {
70
- text : 'Animated Java failed to load! Please restart Blockbench' ,
71
- color : 'var(--color-error)' ,
72
- } )
73
- } )
74
- } )
49
+ import { createBlockbenchMod } from './util/moddingTools'
75
50
76
51
// @ts -ignore
77
52
globalThis . AnimatedJava = {
Original file line number Diff line number Diff line change
1
+ import { PACKAGE } from '../constants'
2
+ import {
3
+ hideLoadingPopup ,
4
+ showLoadingPopup ,
5
+ showOfflineError ,
6
+ } from '../interface/animatedJavaLoadingPopup'
7
+ import { events } from '../util/events'
8
+ import { createBlockbenchMod } from '../util/moddingTools'
9
+
10
+ createBlockbenchMod (
11
+ `${ PACKAGE . name } :assetLoading` ,
12
+ undefined ,
13
+ ( ) => {
14
+ // Show loading popup
15
+ void showLoadingPopup ( ) . then ( async ( ) => {
16
+ if ( ! window . navigator . onLine ) {
17
+ showOfflineError ( )
18
+ // return
19
+ }
20
+ events . NETWORK_CONNECTED . dispatch ( )
21
+
22
+ await Promise . all ( [
23
+ new Promise < void > ( resolve =>
24
+ events . MINECRAFT_ASSETS_LOADED . subscribe ( ( ) => resolve ( ) )
25
+ ) ,
26
+ new Promise < void > ( resolve =>
27
+ events . MINECRAFT_REGISTRY_LOADED . subscribe ( ( ) => resolve ( ) )
28
+ ) ,
29
+ new Promise < void > ( resolve =>
30
+ events . MINECRAFT_FONTS_LOADED . subscribe ( ( ) => resolve ( ) )
31
+ ) ,
32
+ new Promise < void > ( resolve =>
33
+ events . BLOCKSTATE_REGISTRY_LOADED . subscribe ( ( ) => resolve ( ) )
34
+ ) ,
35
+ ] )
36
+ . then ( ( ) => {
37
+ hideLoadingPopup ( )
38
+ } )
39
+ . catch ( error => {
40
+ console . error ( error )
41
+ Blockbench . showToastNotification ( {
42
+ text : 'Animated Java failed to load! Please restart Blockbench' ,
43
+ color : 'var(--color-error)' ,
44
+ } )
45
+ } )
46
+ } )
47
+ } ,
48
+ ( ) => {
49
+ //
50
+ }
51
+ )
Original file line number Diff line number Diff line change
1
+ import './assetSetupMod'
1
2
import './addLocatorActionMod'
2
3
import './animationControllerMod'
3
4
import './animationPropertiesAction'
You can’t perform that action at this time.
0 commit comments