Alex's Mobs

Alex's Mobs

96M Downloads

Copy Item Bug in BlockCapsid

CooStack opened this issue · 1 comments

commented

I saw on Bilibili that BlockCapsid has an item copy bug, so I checked the source code.
It might be caused by the ItemStack.isSameItem method. When I looked into its implementation, I found that this method simply compares the Item instances of two stacks, without checking the NBT data.
As a result, items with NBT—such as backpacks or gift boxes from certain mods—can have their NBT duplicated, ultimately leading to copy item.

Image Image

thisItem == other.getItem()

Image
commented

Using ItemStack.isSameItemSameTags
performs more thorough checks.