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'
4646import { exportProject } from './systems/exporter'
4747import { openBlueprintLoadingDialog } from './interface/blueprintLoadingPopup'
4848import { 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'
7550
7651// @ts -ignore
7752globalThis . 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'
12import './addLocatorActionMod'
23import './animationControllerMod'
34import './animationPropertiesAction'
You can’t perform that action at this time.
0 commit comments