package org.cyclops.integratedtunnels.core;

import net.minecraft.item.ItemStack;

import javax.annotation.Nonnull;
import java.util.function.Predicate;

/**
 * A predicate for matching ItemStacks.
 * @author rubensworks
 */
public abstract class ItemStackPredicate implements Predicate<ItemStack> {

    private final ItemStack itemStack;
    private final int matchFlags;
    private final boolean blacklist;

    public ItemStackPredicate(@Nonnull ItemStack itemStack, int matchFlags, boolean blacklist) {
        this.itemStack = itemStack;
        this.matchFlags = matchFlags;
        this.blacklist = blacklist;
    }

    public ItemStackPredicate(boolean blacklist) {
        this(ItemStack.EMPTY, -1, blacklist);
    }

    @Nonnull
    public ItemStack getItemStack() {
        return itemStack;
    }

    public int getMatchFlags() {
        return matchFlags;
    }

    public boolean hasMatchFlags() {
        return getMatchFlags() >= 0;
    }

    public boolean isBlacklist() {
        return blacklist;
    }
}

@@ -946,16 +946,45 @@
 s() %3E= 0
+ && !getItemStack().isEmpty()
 ;%0A    %7D%0A

Fix item transfer happening on all items when an empty filter was given