[trunk] empty fields in Inventory now return null instead of Material.AIR

git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1157 e251c2fe-e539-e718-e476-b85c1f46cddb
This commit is contained in:
snowleo 2011-04-08 11:45:14 +00:00
parent 22f9b76d77
commit 70e72d7744
1 changed files with 3 additions and 0 deletions

View File

@ -19,6 +19,9 @@ public class InventoryWorkaround {
ItemStack[] inventory = ci.getContents();
for (int i = start; i < inventory.length; i++) {
ItemStack cItem = inventory[i];
if (cItem == null) {
continue;
}
if (item.getTypeId() == cItem.getTypeId() && (!forceAmount || item.getAmount() == cItem.getAmount()) && (!forceDurability || cItem.getDurability() == item.getDurability())) {
return i;
}