Merge pull request #328 from slipcor/empty-inventory

Always check for both null stacks and "air stacks" (ItemStack ID 0) when checking for empty inventories. Fixes #302
This commit is contained in:
garbagemule
2016-12-17 01:43:46 +01:00
committed by GitHub
@@ -108,15 +108,14 @@ public class InventoryManager
ItemStack[] inventory = p.getInventory().getContents();
ItemStack[] armor = p.getInventory().getArmorContents();
// For inventory, check for null
// Check for null or id 0, or AIR
for (ItemStack stack : inventory) {
if (stack != null)
if (stack != null && stack.getTypeId() != 0)
return false;
}
// For armor, check for id 0, or AIR
for (ItemStack stack : armor) {
if (stack.getTypeId() != 0)
if (stack != null && stack.getTypeId() != 0)
return false;
}