Skip to content

Fix bookshelf item loss with use-vanilla-hopper - #884

Open
wling-art wants to merge 4 commits into
Winds-Studio:ver/26.2from
wling-art:fix/vanilla-hopper-bookshelf-loss
Open

Fix bookshelf item loss with use-vanilla-hopper#884
wling-art wants to merge 4 commits into
Winds-Studio:ver/26.2from
wling-art:fix/vanilla-hopper-bookshelf-loss

Conversation

@wling-art

Copy link
Copy Markdown
Member

hopperPull 在转移成功后会无条件把剩余数量回写源容器,补丁逻辑假设 removeItem() 返回的是独立拷贝(普通容器确实如此),但雕文书架的 removeItem 直接返回槽位里原来那个对象引用而不做拷贝,导致回写时改的其实是已经插入漏斗里的那个同一对象。最终漏斗和书架指向同一个 count=0 的幽灵 ItemStack,两边都变空,书凭空消失。

Fix #883

Comment thread leaf-server/minecraft-patches/features/0305-Leaves-Vanilla-hopper.patch Outdated
@HaHaWTH HaHaWTH added the type: fix Pull request for fixing bug label Aug 18, 2026

@HaHaWTH HaHaWTH 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.

这里的comment可以去掉 或者只留// copy if reference equal

@HaHaWTH HaHaWTH 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.

mb, 看错了一个地方 你没加那个reference比较 removeItem也会修改itemstack的

@wling-art
wling-art requested a review from HaHaWTH August 20, 2026 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: fix Pull request for fixing bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

开启 use-vanilla-hopper 配置项后的相关问题

2 participants