Skip to content

Commit

Permalink
fixup for shift support
Browse files Browse the repository at this point in the history
  • Loading branch information
zardoy committed Jun 15, 2024
1 parent c89aeba commit 5409f6f
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/inventoryWindows.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ import BeaconGui from 'minecraft-assets/minecraft-assets/data/1.17.1/gui/contain
import WidgetsGui from 'minecraft-assets/minecraft-assets/data/1.17.1/gui/widgets.png'

import Dirt from 'minecraft-assets/minecraft-assets/data/1.17.1/blocks/dirt.png'
import { subscribeKey } from 'valtio/utils'
import MinecraftData, { RecipeItem } from 'minecraft-data'
import { getVersion } from 'prismarine-viewer/viewer/lib/version'
import { RecipeItem } from 'minecraft-data'
import { versionToNumber } from 'prismarine-viewer/viewer/prepare/utils'
import itemsPng from 'prismarine-viewer/public/textures/items.png'
import itemsLegacyPng from 'prismarine-viewer/public/textures/items-legacy.png'
Expand Down Expand Up @@ -351,6 +349,13 @@ const mapSlots = (slots: Array<RenderSlot | Item | null>) => {
try {
const slotCustomProps = renderSlot(slot)
Object.assign(slot, { ...slotCustomProps, displayName: ('nbt' in slot ? getItemName(slot) : undefined) ?? slot.displayName })
//@ts-expect-error
slot.toJSON = () => {
// Allow to serialize slot to JSON as minecraft-inventory-gui creates icon property as cache (recursively)
//@ts-expect-error
const { icon, ...rest } = slot
return rest
}
} catch (err) {
inGameError(err)
}
Expand Down

0 comments on commit 5409f6f

Please sign in to comment.