fix registering custom channels too late (a few ms diff)
This commit is contained in:
parent
a12c61bc6c
commit
bc2972fe99
2 changed files with 8 additions and 22 deletions
|
|
@ -7,18 +7,15 @@ import { registerIdeChannels } from './core/ideChannels'
|
|||
export default () => {
|
||||
customEvents.on('mineflayerBotCreated', async () => {
|
||||
if (!options.customChannels) return
|
||||
await new Promise(resolve => {
|
||||
bot.once('login', () => {
|
||||
resolve(true)
|
||||
})
|
||||
bot.once('login', () => {
|
||||
registerBlockModelsChannel()
|
||||
registerMediaChannels()
|
||||
registerSectionAnimationChannels()
|
||||
registeredJeiChannel()
|
||||
registerBlockInteractionsCustomizationChannel()
|
||||
registerWaypointChannels()
|
||||
registerIdeChannels()
|
||||
})
|
||||
registerBlockModelsChannel()
|
||||
registerMediaChannels()
|
||||
registerSectionAnimationChannels()
|
||||
registeredJeiChannel()
|
||||
registerBlockInteractionsCustomizationChannel()
|
||||
registerWaypointChannels()
|
||||
registerIdeChannels()
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -486,17 +486,6 @@ const downloadAndUseResourcePack = async (url: string, progressReporter: Progres
|
|||
}
|
||||
}
|
||||
|
||||
const waitForGameEvent = async () => {
|
||||
if (miscUiState.gameLoaded) return
|
||||
await new Promise<void>(resolve => {
|
||||
const listener = () => resolve()
|
||||
customEvents.once('gameLoaded', listener)
|
||||
watchUnloadForCleanup(() => {
|
||||
customEvents.removeListener('gameLoaded', listener)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
export const onAppLoad = () => {
|
||||
customEvents.on('mineflayerBotCreated', () => {
|
||||
// todo also handle resourcePack
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue