I'm not sure how to define "first" in your solution, but at the very least it could select a random non-empty when pulling and a random non-full when pushing. Currently if you stack tons of hopper minecarts on top of a hopper, by chance it can simply stop pulling items for a second even if one of the carts has items.
Confirmed in 1.19.3.
I'm not sure how to define "first" in your solution, but at the very least it could select a random non-empty when pulling and a random non-full when pushing. Currently if you stack tons of hopper minecarts on top of a hopper, by chance it can simply stop pulling items for a second even if one of the carts has items.