Polling items from Carrier not working

So, looking at this code in particular I see a couple of flags.

Optional<ItemStack> istack = (i == null ? f.peek() : f.query(QueryOperationTypes.ITEM_TYPE.(i)).peek());
if (istack.isPresent())
  istack = from.query(QueryOperationTypes.ITEM_STACK_IGNORE_QUANTITY.of(istack.get())).poll();

First, remember that a query doesn’t necessarily return the value of the query - an OutputSlot - if there are multiple results. I’ve talked about this before in this reply, so I’ll simply link it rather than rewriting it.

Next, I’m seeing multiple layers of query logic that follow different rules. If you haven’t already, I would start by verifying that you are receiving an OutputSlot back from the first query. Additionally, because this is a furnace (remember, context is key) there should only be a single OutputSlot anyways, so it should be the direct result of the query.

Right now, the largest thing I see is that there doesn’t seem to be any reason for you to peek the inventory for an ItemStack and then query for the same ItemStack yet with a different quantity - you would get the same functionally from polling the query to begin with. What is this section of code intended to do?

That being said, it’s entirely possible that one of the queries is doing something incorrectly and that’s causing this issue. However, your code is highly coupled and convoluted with a lot of things going on - can you replicate this in a simple test plugin that includes log outputs for each query and the resulting ItemStacks?