Smarter funnel extraction

- Funnels will no longer deadlock their extraction size if the first item of an inventory has a low max stack size but can't even be extracted because of filtering.
- fixes #2919
This commit is contained in:
Grimmauld 2022-05-19 21:18:21 +02:00
parent 657f42c67a
commit f8180ee91d

View file

@ -229,7 +229,7 @@ public class ItemHelper {
for (int slot = 0; slot < inv.getSlots(); slot++) {
if (extracting.isEmpty()) {
ItemStack stackInSlot = inv.getStackInSlot(slot);
if (stackInSlot.isEmpty())
if (stackInSlot.isEmpty() || !test.test(stackInSlot))
continue;
int maxExtractionCountForItem = amountFunction.apply(stackInSlot);
if (maxExtractionCountForItem == 0)