illusivesoulworks / shulkerboxslot

Minecraft Mod: Adds accessory support for Shulker Boxes for easier access and management.
https://www.curseforge.com/minecraft/mc-mods/curious-shulker-boxes
Other
5 stars 8 forks source link

[Forge] Hooks to let 3rd mods integrate with this mod? #20

Open ephys opened 2 years ago

ephys commented 2 years ago

Please describe the new feature or change.

I'd like to be able to add support for CuriousShulkerBoxes in 3rd party mods.

Basic Version

The easiest way to do this would be to accept IMC messages that include a list of item IDs & a function. When the player presses the "open shulker box" key, and the item in the backpack slot is one of the items in the item ID list, the function is called instead of the rest of CPacketOpenShulkerBox#handle.

We'd still need to reimplement everything (backpack rendering, opening the GUI, synchronizing the inventories) but it would at least be possible to add support.

Advanced version

Alternatively this could be done similarly to how Quark handles shulker box preview & item insertion (I think): Using the ITEM_HANDLER_CAPABILITY capability.

To add support for a new shulker box, you basically need 3 things:

The ITEM_HANDLER_CAPABILITY capability solves the first point. The other two elements could be done through IMC.

With this, all a mod has to do to integrate with this one is to:

Please describe why you want this feature.

I'm working on https://github.com/ephys/mc-netherite-shulkers and I would like to integrate with this mod

TheIllusiveC4 commented 2 years ago

Interesting proposal. I like the advanced version, but it could take a while for me to get to it.