Gegy / whats-that-slot

Utility that highlights which items can be placed in an item slot while holding down Left-Alt.
https://www.curseforge.com/minecraft/mc-mods/whats-that-slot
GNU Lesser General Public License v3.0
14 stars 2 forks source link

Support for JEI/REI querying on result slots #3

Closed Gegy closed 2 years ago

Gegy commented 2 years ago

The slots we're displaying are not real slots, so mods such as JEI and REI are unable to detect that they are displaying an item. Ideally, we can somehow let these mods know that we're displaying a slot that can be queried by them for showing recipe usages.

Gegy commented 2 years ago

Looks like both JEI and REI have support for registering hooks for this purpose: REI: https://github.com/shedaniel/RoughlyEnoughItems/blob/6524d9a4aa1fb83e097f4754f1d82b7044cef5cb/api/src/main/java/me/shedaniel/rei/api/client/registry/screen/ScreenRegistry.java#L79-L84

JEI: https://github.com/mezz/JustEnoughItems/blob/566c4a7ffba1556b39ba37a146ff6696a422e9c1/src/api/java/mezz/jei/api/gui/handlers/IGuiContainerHandler.java#L29-L43