From 7fa48ac3c484839796d56250a0e2438f9d3bdda6 Mon Sep 17 00:00:00 2001 From: filoghost Date: Sat, 15 Aug 2020 17:29:56 +0200 Subject: [PATCH] Fix icon caching --- .../chestcommands/icon/BaseConfigurableIcon.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/plugin/src/main/java/me/filoghost/chestcommands/icon/BaseConfigurableIcon.java b/plugin/src/main/java/me/filoghost/chestcommands/icon/BaseConfigurableIcon.java index 390110a..6cd9b95 100644 --- a/plugin/src/main/java/me/filoghost/chestcommands/icon/BaseConfigurableIcon.java +++ b/plugin/src/main/java/me/filoghost/chestcommands/icon/BaseConfigurableIcon.java @@ -58,13 +58,17 @@ public abstract class BaseConfigurableIcon implements Icon { } protected boolean shouldCacheRendering() { - if (placeholdersEnabled) { + if (placeholdersEnabled && hasDynamicPlaceholders()) { return false; + } else { + return true; } + } - return (name == null || !name.hasDynamicPlaceholders()) - && (lore == null || !lore.hasDynamicPlaceholders()) - && (skullOwner == null || !skullOwner.hasDynamicPlaceholders()); + private boolean hasDynamicPlaceholders() { + return (name != null && name.hasDynamicPlaceholders()) + || (lore != null && lore.hasDynamicPlaceholders()) + || (skullOwner != null && skullOwner.hasDynamicPlaceholders()); } public void setMaterial(Material material) {