fix(inventory): restore InventoryManager flow to match original jar

Vineflower decompiled the original into one large performInventoryAction
plus a few oddities (dead `shouldSkip` guard, dead keyJump/keyShift reads,
unused locals). The previous rewrite split the offhand handling into
several helpers, which inverted the if/else if chain and silently
changed which branch wins when multiple offhand modes match.

Re-align with the original control flow:
- onPacket: drop the `shouldSkip = false; if (shouldSkip) return;` dead
  guard; collapse the ClickPacket/ClosePacket cancel under an explicit
  externalContainerOpen short-circuit so external chests/furnaces fall
  through untouched.
- onMotion: early-return for the no-pending-packets branch and strip the
  side-effect-free keyJump/keyShift reads.
- performInventoryAction: re-merge the split handle* helpers into the
  flat if / else if chain the original jar uses.
- isUsefulItem: flatten back into the per-item return ladder.
- Drop unused imports (Screen, Iterator, ChestMenu) and add the missing
  ChatUtil import that the packet trace lines need.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Shirona1337
2026-05-24 16:47:53 +08:00
parent c6c20877ff
commit a9e3a9af0a
File diff suppressed because it is too large Load Diff