From feb46fd31a7d71b36ca9bcede18c03a98da4f62d Mon Sep 17 00:00:00 2001 From: Auxilor Date: Sun, 21 Nov 2021 13:09:25 +0000 Subject: [PATCH] Fixed PermanentPotionEffect --- .../effects/effects/EffectPermanentPotionEffect.kt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/eco-api/src/main/kotlin/com/willfp/libreforge/effects/effects/EffectPermanentPotionEffect.kt b/eco-api/src/main/kotlin/com/willfp/libreforge/effects/effects/EffectPermanentPotionEffect.kt index 7beb8cd11..941869ddd 100644 --- a/eco-api/src/main/kotlin/com/willfp/libreforge/effects/effects/EffectPermanentPotionEffect.kt +++ b/eco-api/src/main/kotlin/com/willfp/libreforge/effects/effects/EffectPermanentPotionEffect.kt @@ -33,6 +33,8 @@ class EffectPermanentPotionEffect : Effect("permanent_potion_effect") { as? MutableMap ?: mutableMapOf() meta[this.getUUID(player.getEffectAmount(this))] = effectType + + player.setMetadata(metaKey, plugin.metadataValueFactory.create(meta)) } override fun handleDisable(player: Player) { @@ -47,6 +49,9 @@ class EffectPermanentPotionEffect : Effect("permanent_potion_effect") { return } + meta.remove(this.getUUID(player.getEffectAmount(this))) + player.setMetadata(metaKey, plugin.metadataValueFactory.create(meta)) + player.removePotionEffect(toRemove) }