[Forge] Hooks to let 3rd mods integrate with this mod?
ephys opened this issue · 1 comments
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 ability to manipulate the inventory
- The size of the inventory (for the dynamically constructed GUI), i.e.
9x3
- Which shulker texture to use in CurioShulkerBoxRenderer
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:
- Attach a ITEM_HANDLER_CAPABILITY to the ItemStack
- Send an IMC message to this mod with:
- The ID of the shulker box item
- The ResourceLocation of the shulker box texture
- The GUI layout row count
- The GUI layout column count
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