From 8ea889942ab5b39706ab853ac756b76cc0bb0b5a Mon Sep 17 00:00:00 2001 From: Auxilor Date: Sun, 22 Nov 2020 12:02:03 +0000 Subject: [PATCH] Fixed effects --- .../ecoenchants/effects/EffectsEnchantment.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/Extensions/Effects/src/main/java/com/willfp/ecoenchants/effects/EffectsEnchantment.java b/Extensions/Effects/src/main/java/com/willfp/ecoenchants/effects/EffectsEnchantment.java index f0d29739..7b759db9 100644 --- a/Extensions/Effects/src/main/java/com/willfp/ecoenchants/effects/EffectsEnchantment.java +++ b/Extensions/Effects/src/main/java/com/willfp/ecoenchants/effects/EffectsEnchantment.java @@ -23,17 +23,16 @@ public abstract class EffectsEnchantment extends EcoEnchant { final Player player = event.getPlayer(); Bukkit.getScheduler().runTaskLater(EcoEnchantsPlugin.getInstance(), () -> { - if (EnchantChecks.getArmorPoints(player, this) > 0) { - if (player.hasPotionEffect(this.getPotionEffect())) { - if (player.getPotionEffect(this.getPotionEffect()).getDuration() >= 1639) { - player.removePotionEffect(this.getPotionEffect()); - } + if (player.hasPotionEffect(this.getPotionEffect())) { + if (player.getPotionEffect(this.getPotionEffect()).getDuration() >= 1639) { + player.removePotionEffect(this.getPotionEffect()); } } int level = EnchantChecks.getArmorPoints(player, this); - - player.addPotionEffect(new PotionEffect(this.getPotionEffect(), 0x6fffffff, level-1, false, false, true)); + if(level > 0) { + player.addPotionEffect(new PotionEffect(this.getPotionEffect(), 0x6fffffff, level - 1, false, false, true)); + } }, 1); } }