From ffb174d40548825b7e4ee20f9ef083c18dc4e877 Mon Sep 17 00:00:00 2001 From: Intybyte Date: Sat, 14 Dec 2024 12:51:35 +0100 Subject: [PATCH] Move logic and simplify --- .../aurelium/auraskills/bukkit/source/DamageLeveler.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/bukkit/src/main/java/dev/aurelium/auraskills/bukkit/source/DamageLeveler.java b/bukkit/src/main/java/dev/aurelium/auraskills/bukkit/source/DamageLeveler.java index d876ebe76..f06ce4b9d 100644 --- a/bukkit/src/main/java/dev/aurelium/auraskills/bukkit/source/DamageLeveler.java +++ b/bukkit/src/main/java/dev/aurelium/auraskills/bukkit/source/DamageLeveler.java @@ -63,7 +63,6 @@ public void onDamage(EntityDamageEvent event) { // Check shield blocking option if (skill.equals(Skills.DEFENSE) && !Skills.DEFENSE.optionBoolean("allow_shield_blocking", false) - && player.isBlocking() && isShieldingSuccessful(entityEvent.getDamager(), player)) { return; } @@ -205,14 +204,13 @@ private boolean projectileSourceMatches(ProjectileSource projectileSource, Strin private boolean isShieldingSuccessful(Entity source, Player subject) { - boolean flag = false; if (source instanceof AbstractArrow entityarrow) { if (entityarrow.getPierceLevel() > 0) { - flag = true; + return false; } } - if (flag) { + if (!subject.isBlocking()) { return false; }