diff --git a/src/inventoryWindows.ts b/src/inventoryWindows.ts index 6a5ab0d6..f6737a12 100644 --- a/src/inventoryWindows.ts +++ b/src/inventoryWindows.ts @@ -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 diff --git a/src/optionsStorage.ts b/src/optionsStorage.ts index 1c5c999e..ef397238 100644 --- a/src/optionsStorage.ts +++ b/src/optionsStorage.ts @@ -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,