Villagers play the trade sound multiple times overlapping on shift-click
Resolved
Fixed
25
The bug
If you place a stack of emeralds in a one for one trade (for example), and shift click the result, the villager will make the trade sound 64 times in quick succession, all overlapping.
I would have expected a cool-down of at least the length of the sound (and only one on shift-click, as 64 in succession overlapping or not, would still be ridiculous).
Code analysis
Code analysis by @unknown can be found in this comment.
Please link to this comment in the description The following is based on a decompiled version of Minecraft 1.10 using MCP 9.30.
The problem is that using shift click acts as if you clicked a slot multiple times, calling net.minecraft.inventory.Container.slotClick(int, int, ClickType, EntityPlayer) repeatedly. This method might need a paramter like isRetry to indicate that shift was used and pass the value of this parameter to the method it calls.
It just hasn't been tested. I haven't had time to test every snapshot lately, because it's finals season. Is there some reason you'd expect pre-1 not to be affected? If so, I can try to find time to test it, but otherwise I'd assume it is.
You can also feel free to test it yourself, though it is a little less obvious now, as V&P villagers tend to do fewer trades in a row.
Confirmed.