Iterating over items
Fuyukai opened this issue ยท 7 comments
Less of an issue, more of a request - it would be nice if it was possible to iterate over the stacks in FixedItemInvView. It's achievable with a loop over a range and getItemStack but it would be useful to have an iterator built-in - doubly so for iterating over getSubInv.
I'm not really sure about making FixedItemInvView
implement Iterable
directly, however I would be happy to add two methods: default Iterable<ItemStack> stackIterable() {}
and default Iterable<? extends SingleItemSlotView> slotIterable() {}
- would those be enough?
(I don't want to implement Iterable directly because it's probably more useful to iterate over modifiable slots rather than just the contained ItemStack's directly - however making FixedItemInvView
implement Iterable<? extends SingleItemSlotView>
isn't permitted, so hopefully two methods would work better?)
Ok, I'll add them to 0.4.15.
(While you're asking, is there anything else you'd like added? It seems a bit silly for me to have pushed 0.4.14 and 0.4.15 in quick succession :P )
I'm actually using the 0.5 branch, unfortunately (I probably should've mentioned that initially!) Otherwise, everything in the library seems to be exactly what I need from what I've done so far.
Oh ok. (I haven't formally released that yet so I don't mind spamming pre-releases quite as much)