Skip to content

Commit

Permalink
Added travel using an elytra feature, the RepairToolTask and some edi…
Browse files Browse the repository at this point in the history
…ts around that

gaucho-matrero#194
  • Loading branch information
omnivoyant authored Jun 24, 2022
1 parent f95cb79 commit c997e24
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/main/java/adris/altoclef/chains/MobDefenseChain.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ private float getPriorityInner(AltoClef mod) {
return Float.NEGATIVE_INFINITY;
}

if (!mod.getModSettings().isMobDefense()) {
if (!mod.getModSettings().isMobDefense() || mod.getBehaviour().isDefenseDisabled()) {
return Float.NEGATIVE_INFINITY;
}

Expand Down Expand Up @@ -392,10 +392,10 @@ private boolean isProjectileClose(AltoClef mod) {

//Debug.logMessage("EXPECTED HIT OFFSET: " + delta + " ( " + projectile.gravity + ")");

double horizontalDistanceSq = delta.x * delta.x + delta.z * delta.z;
double verticalDistance = Math.abs(delta.y);
double horizontalDistance = Math.sqrt(delta.x * delta.x + delta.z * delta.z);
double verticalDistance = delta.y;

if (horizontalDistanceSq < ARROW_KEEP_DISTANCE_HORIZONTAL*ARROW_KEEP_DISTANCE_HORIZONTAL && verticalDistance < ARROW_KEEP_DISTANCE_VERTICAL)
if (horizontalDistance < ARROW_KEEP_DISTANCE_HORIZONTAL && verticalDistance < ARROW_KEEP_DISTANCE_VERTICAL)
return true;
}
} catch (ConcurrentModificationException e) {
Expand Down Expand Up @@ -496,4 +496,4 @@ protected void onTaskFinish(AltoClef mod) {
public String getName() {
return "Mob Defense";
}
}
}

0 comments on commit c997e24

Please sign in to comment.