aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-11-05 13:13:36 +0100
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-11-05 13:13:36 +0100
commit8dd26f8883de2cc5997d891f7067360ff7ac5db8 (patch)
tree8498de34f5a1ec6da09d675cf6d1cfb07b55ba3e /src/main/java/at
parente137bf8d451e41ffab921080d065ebd7707644ad (diff)
downloadskyhanni-8dd26f8883de2cc5997d891f7067360ff7ac5db8.tar.gz
skyhanni-8dd26f8883de2cc5997d891f7067360ff7ac5db8.tar.bz2
skyhanni-8dd26f8883de2cc5997d891f7067360ff7ac5db8.zip
Added a workaround for NEU Profile Viewer bug where the ItemTooltipEvent gets called for two items when hovering over the border between two items.
Diffstat (limited to 'src/main/java/at')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValue.kt15
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