Crash caused by StackOverflowError when trading too many items at once
This report is based on MC-34943
The bug
When you have a villager trading an item for an item with the Count of 0 and you Shift-click on the trade when you have a empty inventory, Minecraft crashes.
How to reproduce
- Use the following command
/summon Villager ~ ~1 ~ {Health:0.1f,Offers:{Recipes:[{buy:{id:"stone",Count:0b},sell:{id:"dirt",Count:1b},maxUses:2147483647,uses:0}]}} - Empty your inventory
- Give yourself one stone block
- Place the stone block in the trading window and Shift-click the offered item (dirt)