address github issue #302 (joining with empty inventory)
This commit is contained in:
1 parent
3b88b889d6
commit
cbac56e199
1 file changed
+4
-5
@@ -108,15 +108,14 @@ public class InventoryManager
|
|||||||
ItemStack[] inventory = p.getInventory().getContents();
|
ItemStack[] inventory = p.getInventory().getContents();
|
||||||
ItemStack[] armor = p.getInventory().getArmorContents();
|
ItemStack[] armor = p.getInventory().getArmorContents();
|
||||||
|
|
||||||
// For inventory, check for null
|
// Check for null or id 0, or AIR
|
||||||
for (ItemStack stack : inventory) {
|
for (ItemStack stack : inventory) {
|
||||||
if (stack != null)
|
if (stack != null && stack.getTypeId() != 0)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// For armor, check for id 0, or AIR
|
|
||||||
for (ItemStack stack : armor) {
|
for (ItemStack stack : armor) {
|
||||||
if (stack.getTypeId() != 0)
|
if (stack != null && stack.getTypeId() != 0)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user