Skip to content

Commit

Permalink
don't explode if somebody adds air to an inventory
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Sep 6, 2021
1 parent 910bc07 commit 5a5e580
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -862,7 +862,7 @@ public InventoryTag add(int slot, ItemStack... items) {
}
for (int i = 0; i < items.length; i++) {
ItemStack item = items[i];
if (item == null) {
if (item == null || item.getType().isAir()) {
continue;
}
int amount = item.getAmount();
Expand Down Expand Up @@ -919,7 +919,7 @@ public List<ItemStack> addWithLeftovers(int slot, boolean keepMaxStackSize, Item
List<ItemStack> leftovers = new ArrayList<>();
for (int i = 0; i < items.length; i++) {
ItemStack item = items[i];
if (item == null) {
if (item == null || item.getType().isAir()) {
continue;
}
int amount = item.getAmount();
Expand Down

0 comments on commit 5a5e580

Please sign in to comment.