Closed zly2006 closed 5 months ago
I'll use this in MiniHUD's inventory preview for piglins and players' inventories.
I know what this is referring to, since the "Entity" Inventory Overlay is pretty generic.
Let me know when these changes are finished.
Yes it has been finished.
One thing is noticeable:
if (hoveredStack != null)
{
stack = hoveredStack;
hoveredStack = null;
// Some mixin / side effects can happen here, so reset hoveredStack
drawContext.drawItemTooltip(mc.textRenderer, stack, (int) mouseX, (int) mouseY);
}
Here I used vanilla method to render tooltip, so other mods can mixin into it and display stuff such as shulker box preview, which might cause some problem in some situations. But ccurrently it works fine (with tweakeroo's shulker preview feature)
Previously, if the inventory is
SimpleInventory
, malilib thinks it is owned by a horse, that is inaccurate.In this PR, I also added support to piglin's inventory (using villager's type).
Also made the item renderer methods accepts mouseX and mouseY, for https://github.com/sakura-ryoko/minihud/pull/8