Fixed kinetic applying incorrectly

This commit is contained in:
Auxilor
2020-10-10 14:15:49 +01:00
parent 65c369e153
commit a80a45786b

View File

@@ -3,6 +3,7 @@ package com.willfp.ecoenchants.enchantments.ecoenchants.normal;
import com.willfp.ecoenchants.enchantments.EcoEnchant;
import com.willfp.ecoenchants.enchantments.EcoEnchantBuilder;
import com.willfp.ecoenchants.enchantments.EcoEnchants;
import com.willfp.ecoenchants.util.Logger;
import org.bukkit.entity.LivingEntity;
import org.bukkit.event.entity.EntityDamageEvent;
public final class Kinetic extends EcoEnchant {
@@ -17,7 +18,7 @@ public final class Kinetic extends EcoEnchant {
@Override
public void onDamageWearingArmor(LivingEntity victim, int level, EntityDamageEvent event) {
if(event.getCause().equals(EntityDamageEvent.DamageCause.FLY_INTO_WALL)) return;
if(!event.getCause().equals(EntityDamageEvent.DamageCause.FLY_INTO_WALL)) return;
double reduction = this.getConfig().getDouble(EcoEnchants.CONFIG_LOCATION + "reduction-per-level");
double multiplier = 1 - ((reduction/100) * level);