From f8fb102bf05ea70374c85325d85678e8e1739408 Mon Sep 17 00:00:00 2001 From: Aizistral Date: Fri, 11 Nov 2022 22:31:22 +0100 Subject: Caching isn't always good Fixes #287 --- .../java/com/aizistral/nochatreports/gui/AdvancedTooltip.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/main/java/com') diff --git a/src/main/java/com/aizistral/nochatreports/gui/AdvancedTooltip.java b/src/main/java/com/aizistral/nochatreports/gui/AdvancedTooltip.java index 20261c4..d4c7189 100644 --- a/src/main/java/com/aizistral/nochatreports/gui/AdvancedTooltip.java +++ b/src/main/java/com/aizistral/nochatreports/gui/AdvancedTooltip.java @@ -63,10 +63,13 @@ public class AdvancedTooltip extends Tooltip { @Override public List toCharSequence(Minecraft minecraft) { - if (this.cachedTooltip == null) { - this.cachedTooltip = splitTooltip(minecraft, this.getMessage(), this.maxWidth); - } - return this.cachedTooltip; + if (this.supplier == null) { + if (this.cachedTooltip == null) { + this.cachedTooltip = splitTooltip(minecraft, this.getMessage(), this.maxWidth); + } + return this.cachedTooltip; + } else + return splitTooltip(minecraft, this.getMessage(), this.maxWidth); } public boolean hasCustomRender() { -- cgit v1.2.3