Merge pull request #57 from ceze88/bugfix

Fix null console spam
This commit is contained in:
James Peters 2021-12-18 13:25:26 +00:00 committed by GitHub
commit f109d4cee0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -53,13 +53,15 @@ public class HopperListener implements Listener {
// Loop over the inventory until next item is found, if no item found return. // Loop over the inventory until next item is found, if no item found return.
while (true) { while (true) {
if (index >= event.getSource().getSize()) {
return;
}
ItemStack item = event.getSource().getItem(index++); ItemStack item = event.getSource().getItem(index++);
if (item == null) if (item == null) {
continue; continue;
}
if (index >= event.getSource().getSize())
return;
if (isFilteredItem.apply(item)) { if (isFilteredItem.apply(item)) {
Utils.hopperMove(event.getSource(), item, hopperAmount, event.getDestination()); Utils.hopperMove(event.getSource(), item, hopperAmount, event.getDestination());
@ -67,7 +69,6 @@ public class HopperListener implements Listener {
} }
} }
} }
} }
} }