Spark profile confirmed 'restoreSophisticatedStorageItems' and its single-item
helpers as hot paths on the server main thread. The prior restore did:
for each backpack/shulker/disk in the player's inventory:
SELECT backpack_nbt FROM backpack_data WHERE uuid = ?
deserialize
apply
With a player carrying 3 backpacks + 2 shulkers + 4 RS2 disks this was
9 sequential blocking SELECTs on the main thread — adding ~9 round-trips
of MySQL latency to the restore window.
Adds two helpers:
ModsSupport.prefetchStorageContents(Collection<UUID>)
→ single SELECT with WHERE uuid IN (?,?,?,...) returning a
Map<UUID, CompoundTag>. Shares the parsing path (BNBT: prefix,
legacy Base64, snbt fallback) with restoreStorageContents so
any serialization quirk handled there is handled here.
ModsSupport.collectBackpackUuids(Player, includeEnderChest)
→ UUID-only scan without any DB work, used by the restore path
to build the prefetch list.
No behavior change yet — the helpers are wired in a follow-up commit
that plugs them into doPlayerJoin's apply phase.