add option to enable/disable jei even depending on gamemode
This commit is contained in:
parent
ad13ab83f2
commit
214828df0c
2 changed files with 20 additions and 10 deletions
|
|
@ -458,16 +458,25 @@ const openWindow = (type: string | undefined) => {
|
|||
}
|
||||
}
|
||||
|
||||
// if (bot.game.gameMode !== 'spectator') {
|
||||
lastWindow.pwindow.win.jeiSlotsPage = 0
|
||||
// todo workaround so inventory opens immediately (though it still lags)
|
||||
setTimeout(() => {
|
||||
upJei('')
|
||||
})
|
||||
miscUiState.displaySearchInput = true
|
||||
// } else {
|
||||
// lastWindow.pwindow.win.jeiSlots = []
|
||||
// }
|
||||
const isJeiEnabled = () => {
|
||||
if (typeof options.jeiEnabled === 'boolean') return options.jeiEnabled
|
||||
if (Array.isArray(options.jeiEnabled)) {
|
||||
return options.jeiEnabled.includes(bot.game?.gameMode as any)
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
if (isJeiEnabled()) {
|
||||
lastWindow.pwindow.win.jeiSlotsPage = 0
|
||||
// todo workaround so inventory opens immediately (though it still lags)
|
||||
setTimeout(() => {
|
||||
upJei('')
|
||||
})
|
||||
miscUiState.displaySearchInput = true
|
||||
} else {
|
||||
lastWindow.pwindow.win.jeiSlots = []
|
||||
miscUiState.displaySearchInput = false
|
||||
}
|
||||
|
||||
if (type === undefined) {
|
||||
// player inventory
|
||||
|
|
|
|||
|
|
@ -63,6 +63,7 @@ const defaultOptions = {
|
|||
preciseMouseInput: false,
|
||||
// todo ui setting, maybe enable by default?
|
||||
waitForChunksRender: 'sp-only' as 'sp-only' | boolean,
|
||||
jeiEnabled: true as boolean | Array<'creative' | 'survival' | 'adventure' | 'spectator'>,
|
||||
|
||||
// antiAliasing: false,
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue