Skip to content

Commit

Permalink
Move logic and simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
Intybyte committed Dec 14, 2024
1 parent 0994b32 commit ffb174d
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit ffb174d

Please sign in to comment.