ItemSwapper icon indicating copy to clipboard operation
ItemSwapper copied to clipboard

Support for item slots from Accessories API

Open pajicadvance opened this issue 9 months ago • 3 comments

Is your feature request related to a problem?

Hello, I'm the developer of Accessorify, a mod that allows equipping certain vanilla items into accessory slots added by Accessories API to add additional functionality to them. I've been working on making vanilla shulker boxes equippable in the accessory slots. I was wondering if it would be possible to allow ItemSwapper to be able to read shulker boxes from those slots and swap/refill items from them.

Describe the solution you'd like

Ideally ItemSwapper would have built-in support for reading item contents from shulker boxes equipped in the accessory slots.

Describe alternatives you've considered

I have tried adding compatibility from my side by mixing into ItemSwapper, but the underlying code is fragile and appears to be hardcoded for the player inventory, so this approach is neither safe or maintainable.

Additional context

No response

pajicadvance avatar Feb 11 '25 16:02 pajicadvance

For now, modded slots/containers are out of scope for the mod. As you did notice, it's mainly targeting the vanilla system as it wasn't part of the consideration during the creation process. In the future, this needs a rework with a clean api and some reworked packets.

tr7zw avatar Feb 11 '25 16:02 tr7zw

I guess to add to that, initially the idea was to use an "inventorySlot" with negative ids to target "other" slots ( https://github.com/tr7zw/ItemSwapper/blob/main/src/main/java/dev/tr7zw/itemswapper/packets/SwapItemPayload.java#L14 ), but that is a really bad design in hindsight. I think the simplest fix is to expand it to have a resource key for the adapter, and then let other mods register adapters that can provide/swap/refill/stash itemstacks from whatever source it might be.

tr7zw avatar Feb 11 '25 16:02 tr7zw

That would be totally fine honestly, at least as a server admin, I am adding items to the accessory slots so adding one more tag to them would be fairly simple to do. Plus, IS would not pick items that are not meant to be swapped from accessories.

adaliszk avatar May 29 '25 15:05 adaliszk