When crafting something that gives more than one item as an result (e.g. diamond blocks to diamonds, stairs, slabs) and not all resulting items fit into the inventory, the overflow gets deleted.

Steps to reproduce

1. Prepare your inventory like this (Put the diamond blocks into the free spot, instead of the crafting field)



2. Make sure you are in survival (/gamemode 0)

3. Craft the 8 diamond blocks into diamonds.

4. The expected result would be 72 diamonds (8*9), but you only get 64 2014-11-19_20.24.48.png

Ways to fix

I mainly see two ways to fix this.

1. Check if there is enough space in the inventory before hand (This is probably a bit more work to implement as there is no such method, I think)

2. Drop the overflowing items.

While I personally prefer the first one, the second one should be easy to implement.

It is a one liner, but due to old copy paste code it would need to be change in several different spots (Villager, Player, Workbench, maybe also Furnace and Anvil).

So for a nice fix some more generic Inventory/Container code would be good.

Code analysis: https://bugs.mojang.com/browse/MC-1555?focusedCommentId=288028&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-288028

Fix note: https://twitter.com/_LadyAgnes/status/762734666042441730