GlowstoneMC/Glowstone — pull request #549 by m3rcuriel (2014-11-15 19:27:05+00:00)
Title: Fixed problems with adding air to player inventory

The PR fixes #104, although the massive error could not be reproduced on a clean master. This PR rewrites the addItem code to make it cleaner and more structured.

Essentially, air has a max stack size of 0, so when added using the old algorithm it would fill every single open spot with air. When this was loaded from NBT, all the air occupied index 0, replacing the 0th element. Instead, air not only occupies solely the first spot, but addItems now mimics craftbukkit functionality in stacking, and replaces air with null.