ItemEntityMixin#fillExistingStack is faulty, causing nbt merging when picking up stuff which can lead to dupe bugs
quat1024 opened this issue ยท 0 comments
This code (where shulker
is actually the itemstack in the player's inventory) gets called pretty much any time anyone picks up anything, see
I think the intention is to partially fill the player's inventory with the picked-up itemstack before allowing the hopper-box feature to absorb the rest, but line 76 assumes that all pairs of itemstacks that have the same item actually can stack with each other.
This means that items with nbt will always be coerced to whichever one is already in your inventory, e.g. if you rename a stick in an anvil, then drop and pick up a non-renamed stick, you will have two renamed sticks. If someone adds a mod that makes shulkerboxes stackable, they will be able to duplicate the items inside. This code led to a dupe bug in my mod which adds stackable container items. And other bad stuff.