Skip to content
This repository has been archived by the owner on Aug 31, 2019. It is now read-only.

Commit

Permalink
Fix firstEmpty
Browse files Browse the repository at this point in the history
  • Loading branch information
cswhite2000 committed May 4, 2017
1 parent 6111a01 commit 2c6bfd5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CraftBukkit/Reduce-ItemStack-copying.patch
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java
- }
- }
- return -1;
+ return ListUtils.indexOf(storage(), Objects::isNull);
+ return ListUtils.indexOf(storage(), item -> item == null || Material.AIR.equals(item.getType()));
}

public int firstPartial(int materialId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ private int first(ItemStack item, boolean withAmount) {
}

public int firstEmpty() {
return ListUtils.indexOf(storage(), Objects::isNull);
return ListUtils.indexOf(storage(), item -> item == null || Material.AIR.equals(item.getType()));
}

public int firstPartial(int materialId) {
Expand Down

0 comments on commit 2c6bfd5

Please sign in to comment.