From d572ced1b801a3e04f8b13abcbea093c81e381c5 Mon Sep 17 00:00:00 2001 From: Auxilor Date: Fri, 22 Oct 2021 18:59:04 +0100 Subject: [PATCH] Fixed removing stat modifiers not working --- .../main/kotlin/com/willfp/ecoskills/StatModifierMethods.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/StatModifierMethods.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/StatModifierMethods.kt index 65a9545..3713ffe 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/StatModifierMethods.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/StatModifierMethods.kt @@ -59,6 +59,8 @@ fun ItemStack.removeStatModifier(modifier: ItemStatModifier) { modifiers.remove(modifier.key) + meta.persistentDataContainer.applyModifiers(modifiers) + this.itemMeta = meta } @@ -125,6 +127,8 @@ fun Player.removeStatModifier(modifier: StatModifier) { val modifiers = getModifiersTag(this) modifiers.remove(modifier.key) + this.persistentDataContainer.applyModifiers(modifiers) + for (stat in Stats.values()) { stat.updateStatLevel(this) }