From bfd0e31ebb6d841b222369baf54f7955d13e85e9 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Tue, 7 Nov 2023 19:00:35 +0100 Subject: Fixed compatibility problems with ChatTriggers that caused flickering in the Estimated Item Value while Inside the NEU Profile Viewer. --- .../skyhanni/features/misc/items/EstimatedItemValue.kt | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'src/main') 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 } -- cgit