fixed populating filters sometimes inserting more than one item into the filter

Closes #38
This commit is contained in:
Ell 2020-10-14 18:34:38 +02:00
parent bb06cb34eb
commit 60dd405f5d

View file

@ -92,14 +92,14 @@ public class ItemFilter extends ItemStackHandler {
ItemStack copy = stack.copy(); ItemStack copy = stack.copy();
copy.setCount(1); copy.setCount(1);
// try inserting into ourselves and any filter increase modifiers // try inserting into ourselves and any filter increase modifiers
for (ItemStackHandler filter : filters) { for (ItemFilter filter : filters) {
if (ItemHandlerHelper.insertItem(filter, copy, false).isEmpty()) if (ItemHandlerHelper.insertItem(filter, copy, false).isEmpty()) {
filter.save();
break; break;
}
} }
} }
} }
for (ItemFilter filter : filters)
filter.save();
} }
} }