mergeableCapacityFor

fun Iterable<ItemSlot>.mergeableCapacityFor(itemStack: ItemStack, blacklist: Collection<ItemSlot>? = null): Int

Exact total capacity of this iterable to store itemStack (empty slots count as ItemStack.maxStackSize, mergeable slots as their remaining space). Contract: the slot currently holding itemStack must NOT be part of this iterable, otherwise its own remaining capacity would be double-counted and the result overestimated.