Fix null console spam

This commit is contained in:
ceze88 2021-10-20 18:55:08 +02:00
parent 52c5dad1b3
commit bb79caf8d3

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.
while (true) {
if (index >= event.getSource().getSize()) {
return;
}
ItemStack item = event.getSource().getItem(index++);
if (item == null)
if (item == null) {
continue;
if (index >= event.getSource().getSize())
return;
}
if (isFilteredItem.apply(item)) {
Utils.hopperMove(event.getSource(), item, hopperAmount, event.getDestination());
@ -67,7 +69,6 @@ public class HopperListener implements Listener {
}
}
}
}
}