Skip to content

fix(backpack): clear stale open state - #1228

Open
XUANHLGG wants to merge 1 commit into
SlimefunGuguProject:masterfrom
XUANHLGG:fix/backpack-stale-open
Open

XUANHLGG wants to merge 1 commit into
SlimefunGuguProject:masterfrom
XUANHLGG:fix/backpack-stale-open

Conversation

@XUANHLGG

Copy link
Copy Markdown

修复某些情况下背包的打开状态会被卡住且重进无法恢复的问题

@StarWishsama

Copy link
Copy Markdown
Member

@codex review it, and make sure related Paper API matches our minimal minecraft version requirement (1.18).

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: aa4e354d8c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@XUANHLGG
XUANHLGG force-pushed the fix/backpack-stale-open branch 2 times, most recently from fd71ca5 to 8951801 Compare August 29, 2026 10:49

@StarWishsama StarWishsama left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

如果你正在用 LLM 实现,不要做过多防御性编程、测试点到即止、最小化完成目标,善用项目中的 codegraph 等辅助框架

if (backpacks.containsKey(p.getUniqueId())) {
p.closeInventory();
UUID playerUuid = p.getUniqueId();
UUID requestToken = UUID.randomUUID();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

为什么要额外引入一个 session?正常处理一些未处理到的边界情况即可

public void onClick(InventoryClickEvent e) {
if (!openingPlayers.isEmpty()
&& openingPlayers.contains(e.getWhoClicked().getUniqueId())) {
if (e.getWhoClicked() instanceof Player player) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This event is called when a player clicks in an inventory.

@StarWishsama

Copy link
Copy Markdown
Member

合并分支目标改为 master, dev 分支已弃用

@XUANHLGG
XUANHLGG changed the base branch from dev to master August 31, 2026 10:19
@XUANHLGG
XUANHLGG force-pushed the fix/backpack-stale-open branch from 8951801 to b5a860e Compare August 31, 2026 10:20

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants