Fixed firstEmpty() by making it search for the first null instead of Material.AIR.

This commit is contained in:
EvilSeph 2011-04-07 13:06:55 -04:00
parent 4525d16842
commit e2480e1347

View File

@ -173,7 +173,13 @@ public class CraftInventory implements org.bukkit.inventory.Inventory {
}
public int firstEmpty() {
return first(Material.AIR);
ItemStack[] inventory = getContents();
for (int i = 0; i < inventory.length; i++) {
if (inventory[i] == null) {
return i;
}
}
return -1;
}
public int firstPartial(int materialId) {