address github issue #302 (joining with empty inventory)

This commit is contained in:
slipcor
2016-12-15 20:08:00 +01:00
parent 3b88b889d6
commit cbac56e199
@@ -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;
}