From b130fc43e4c93a99d12168e245f5f35203da00fc Mon Sep 17 00:00:00 2001 From: Kesuaheli Date: Fri, 25 Jul 2025 17:32:23 +0200 Subject: [PATCH] fix: added window title --- src/inventoryWindows.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/inventoryWindows.ts b/src/inventoryWindows.ts index 1e17db145..bc7dcbafe 100644 --- a/src/inventoryWindows.ts +++ b/src/inventoryWindows.ts @@ -9,6 +9,7 @@ import PItem, { Item } from 'prismarine-item' import { versionToNumber } from 'renderer/viewer/common/utils' import { getRenamedData } from 'flying-squid/dist/blockRenames' import PrismarineChatLoader from 'prismarine-chat' +import * as nbt from 'prismarine-nbt' import { BlockModel } from 'mc-assets' import { renderSlot } from 'renderer/viewer/three/renderSlot' import Generic95 from '../assets/generic_95.png' @@ -59,9 +60,9 @@ export const onGameLoad = () => { bot.on('windowOpen', (win) => { const implementedWindow = implementedContainersGuiMap[mapWindowType(win.type as string, win.inventoryStart)] if (implementedWindow) { - openWindow(implementedWindow) + openWindow(implementedWindow, nbt.simplify(win.title as any)) } else if (options.unimplementedContainers) { - openWindow('ChestWin') + openWindow('ChestWin', nbt.simplify(win.title as any)) } else { // todo format displayClientChat(`[client error] cannot open unimplemented window ${win.id} (${win.type}). Slots: ${win.slots.map(item => getItemName(item)).filter(Boolean).join(', ')}`) @@ -354,7 +355,7 @@ const upWindowItemsLocal = () => { } let skipClosePacketSending = false -const openWindow = (type: string | undefined) => { +const openWindow = (type: string | undefined, title: string | any = undefined) => { // if (activeModalStack.some(x => x.reactType?.includes?.('player_win:'))) { if (activeModalStack.length) { // game is not in foreground, don't close current modal if (type) { @@ -384,7 +385,6 @@ const openWindow = (type: string | undefined) => { const inv = openItemsCanvas(type) inv.canvasManager.children[0].mobileHelpers = miscUiState.currentTouch window.inventory = inv - const title = bot.currentWindow?.title const PrismarineChat = PrismarineChatLoader(bot.version) try { inv.canvasManager.children[0].customTitleText = title ?