emilyploszaj / emi

A featureful and accessible item and recipe viewer
MIT License
220 stars 46 forks source link

`EmiApi::getHoveredStack` returns empty data on recipe views #509

Open TheRealWormbo opened 2 months ago

TheRealWormbo commented 2 months ago

While on the recipe screen, the API method getHoveredStack(boolean) seems to only ever return a non-empty result when pointing at an item in the item list or favorite items list. Whenever pointing at an item slot in any kind of recipe display panel (in the tab header, in the workstation list at the bottom, or any displayed item in a recipe panel, e.g. inputs or outputs of a crafting recipe), the method returns an object that has an empty stack and no recipe context.

Considering those two categories of displayed items behave very similar in terms of mouse interactions, shouldn't they also behave in a similar way for this API call?

(Context: Tested on 1.20.1 with EMI 1.1.4, trying to implement Corporea request compatibility for EMI in Botania - see https://github.com/VazkiiMods/Botania/issues/4200)

emilyploszaj commented 2 months ago

This endpoint was originally intended to be a way to access sidebar stacks but it may be reasonable to add this functionality to expose slot widget contents as well.