aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValue.kt15
1 files changed, 9 insertions, 6 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 c5b87eb20..b0eab9926 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
@@ -58,21 +58,24 @@ object EstimatedItemValue {
if (!config.enabled) return
if (Minecraft.getMinecraft().currentScreen is GuiProfileViewer) {
- updateItem(event.itemStack)
- if (!blockNextFrame && renderedItems < 2) {
- tryRendering()
+ if (renderedItems == 0) {
+ updateItem(event.itemStack)
}
+ tryRendering()
renderedItems++
}
}
- // Workaround for NEU Profile Viewer bug where the ItemTooltipEvent gets called for two items when hovering over the border between two items.
+ /**
+ * Workaround for NEU Profile Viewer bug where the ItemTooltipEvent gets called for two items when hovering
+ * over the border between two items.
+ * Also fixes complications with ChatTriggers where they call the stack.getToolTips() method that causes the
+ * ItemTooltipEvent to getting triggered multiple times per frame.
+ */
private var renderedItems = 0
- private var blockNextFrame = false
@SubscribeEvent
fun onRenderOverlayGui(event: GuiRenderEvent.GuiOverlayRenderEvent) {
- blockNextFrame = renderedItems > 1
renderedItems = 0
}