aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-11-07 19:00:35 +0100
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-11-07 19:00:35 +0100
commitbfd0e31ebb6d841b222369baf54f7955d13e85e9 (patch)
treedfa61ba2b8c36673b934da9343528316dc19f915
parent66659a7c56a8366ead36af522593019a35c251d3 (diff)
downloadskyhanni-bfd0e31ebb6d841b222369baf54f7955d13e85e9.tar.gz
skyhanni-bfd0e31ebb6d841b222369baf54f7955d13e85e9.tar.bz2
skyhanni-bfd0e31ebb6d841b222369baf54f7955d13e85e9.zip
Fixed compatibility problems with ChatTriggers that caused flickering in the Estimated Item Value while Inside the NEU Profile Viewer.
-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
}