From aa44729b9826155c8aa1ac7bddca4a268bf7bbfc Mon Sep 17 00:00:00 2001 From: SkytAsul Date: Thu, 6 Apr 2023 19:01:31 +0200 Subject: [PATCH] :bug: Fixed issues with comparisons and description --- .../skytasul/quests/api/comparison/ItemComparisonMap.java | 6 ++++-- .../java/fr/skytasul/quests/options/OptionDescription.java | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/fr/skytasul/quests/api/comparison/ItemComparisonMap.java b/core/src/main/java/fr/skytasul/quests/api/comparison/ItemComparisonMap.java index 2f36721c..ac6d81b4 100644 --- a/core/src/main/java/fr/skytasul/quests/api/comparison/ItemComparisonMap.java +++ b/core/src/main/java/fr/skytasul/quests/api/comparison/ItemComparisonMap.java @@ -110,8 +110,10 @@ public boolean isSimilar(ItemStack item1, ItemStack item2) { Boolean result = null; if (comparison.isMetaNeeded()) { - if (meta1 != meta2) continue; - if (!meta1) result = true; + if (meta1 != meta2) + result = false; + else if (!meta1) + result = true; } if (result == null) result = comparison.isSimilar(item1, item2); diff --git a/core/src/main/java/fr/skytasul/quests/options/OptionDescription.java b/core/src/main/java/fr/skytasul/quests/options/OptionDescription.java index 6c060062..229611d5 100644 --- a/core/src/main/java/fr/skytasul/quests/options/OptionDescription.java +++ b/core/src/main/java/fr/skytasul/quests/options/OptionDescription.java @@ -21,7 +21,9 @@ public class OptionDescription extends QuestOptionString implements QuestDescrip @Override public void setValue(String value) { super.setValue(value); - cachedDescription = null; + + if (cachedDescription != null) // not in constructor + cachedDescription.invalidateAll(); } @Override