diff options
Diffstat (limited to 'src/main/java/at/hannibal2')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValue.kt | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValue.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValue.kt index 05b61aa65..c5b87eb20 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValue.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValue.kt @@ -59,10 +59,23 @@ object EstimatedItemValue { if (Minecraft.getMinecraft().currentScreen is GuiProfileViewer) { updateItem(event.itemStack) - tryRendering() + if (!blockNextFrame && renderedItems < 2) { + tryRendering() + } + renderedItems++ } } + // Workaround for NEU Profile Viewer bug where the ItemTooltipEvent gets called for two items when hovering over the border between two items. + private var renderedItems = 0 + private var blockNextFrame = false + + @SubscribeEvent + fun onRenderOverlayGui(event: GuiRenderEvent.GuiOverlayRenderEvent) { + blockNextFrame = renderedItems > 1 + renderedItems = 0 + } + private fun tryRendering() { currentlyShowing = checkCurrentlyVisible() if (!currentlyShowing) return |