Closed KatTheFox closed 1 month ago
Oh, good point, I'll look into that tomorrow
No hurry whatsoever
Can you change the dedicated check for the Bottomless Bundle for a more generic one that can also handle vanilla Bundles, Shulker Boxes (and other modded stuff, maybe?).
I think the intended way to do that is with the Fabric API Lookup API; in this case, specifically ItemApiLookup.
I'm not sure if there's actually a standardized item storage API to lookup, however...
however...
1.20.6 Components in the corner be like:
I can at least allow it to draw from bundles. I'm not actually sure how shulkers store their items, since there's no documentation on the wiki (besides the new components which should of course make this way easier, however as of right now we're working with 1.20.1 so jank time it is), I'll do some testing. Bundles seem to just store their items in the 'items' nbt tag, which shouldn't be too hard to handle.
oh wow, nice. i was struggling to find a sensible way to do that
Botania, for example, does something similar using FAPI lookup, but there indeed does not seem to be a generic way to do this.
I made a basic mod that implements the Fabric Lookup API for finding Storage<ItemVariant>
instances from ItemStack
instances, which registers Bundles (untested) and Shulker Boxes (tested, working!) by default: https://github.com/unilock/ItemStorageProviderAPI
Notably, it supports extracting and inserting items to/from the inventory-bearing items.
Though I'm not sure it's worth finishing when it was already made obsolete in 1.20.5 :P
The implementation might be obsolete, but the idea is still sound. In a 1.20.5+ context: How can you ensure that a custom component provided by a mod actually provides some form of storage? It could be as simple as iterating over them and checking whether they have an interface, but as it is right now this is not something a vanilla ContainerComponent has. For item-exclusive storage people might stick to the Container component, after all, it supports up to 256 slots. But for mixed storages and custom component implementations, an API like this would still be useful
Looking good! Can you change the dedicated check for the Bottomless Bundle for a more generic one that can also handle vanilla Bundles, Shulker Boxes (and other modded stuff, maybe?).