Skip to content

Commit

Permalink
Fixed PermanentPotionEffect
Browse files Browse the repository at this point in the history
  • Loading branch information
WillFP committed Nov 21, 2021
1 parent ed44fa6 commit feb46fd
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ class EffectPermanentPotionEffect : Effect("permanent_potion_effect") {
as? MutableMap<UUID, PotionEffectType> ?: mutableMapOf()

meta[this.getUUID(player.getEffectAmount(this))] = effectType

player.setMetadata(metaKey, plugin.metadataValueFactory.create(meta))
}

override fun handleDisable(player: Player) {
Expand All @@ -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)
}

Expand Down

0 comments on commit feb46fd

Please sign in to comment.