Ignore invalid inventory slots. Fixes BUKKIT-3737

Remapped by Srg2Source from Bukkit/CraftBukkit@91d3c5ea5a5324aa971179df315dc859aaa513fc