👌 appease leijurv

This commit is contained in:
Brady 2023-06-12 16:50:02 -05:00
parent 7da802a238
commit 5bdd5b0c0d
No known key found for this signature in database
GPG Key ID: 73A788379A197567
11 changed files with 95 additions and 50 deletions

View File

@ -68,13 +68,17 @@ public class GoalBlock implements Goal, IGoalRenderPos {
@Override @Override
public boolean equals(Object o) { public boolean equals(Object o) {
if (this == o) return true; if (this == o) {
if (o == null || getClass() != o.getClass()) return false; return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
GoalBlock goal = (GoalBlock) o; GoalBlock goal = (GoalBlock) o;
if (x != goal.x) return false; return x == goal.x
if (y != goal.y) return false; && y != goal.y
return z == goal.z; && z == goal.z;
} }
@Override @Override

View File

@ -69,8 +69,12 @@ public class GoalComposite implements Goal {
@Override @Override
public boolean equals(Object o) { public boolean equals(Object o) {
if (this == o) return true; if (this == o) {
if (o == null || getClass() != o.getClass()) return false; return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
GoalComposite goal = (GoalComposite) o; GoalComposite goal = (GoalComposite) o;
return Arrays.equals(goals, goal.goals); return Arrays.equals(goals, goal.goals);

View File

@ -62,13 +62,17 @@ public class GoalGetToBlock implements Goal, IGoalRenderPos {
@Override @Override
public boolean equals(Object o) { public boolean equals(Object o) {
if (this == o) return true; if (this == o) {
if (o == null || getClass() != o.getClass()) return false; return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
GoalGetToBlock goal = (GoalGetToBlock) o; GoalGetToBlock goal = (GoalGetToBlock) o;
if (x != goal.x) return false; return x == goal.x
if (y != goal.y) return false; && y == goal.y
return z == goal.z; && z == goal.z;
} }
@Override @Override

View File

@ -54,8 +54,12 @@ public class GoalInverted implements Goal {
@Override @Override
public boolean equals(Object o) { public boolean equals(Object o) {
if (this == o) return true; if (this == o) {
if (o == null || getClass() != o.getClass()) return false; return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
GoalInverted goal = (GoalInverted) o; GoalInverted goal = (GoalInverted) o;
return Objects.equals(origin, goal.origin); return Objects.equals(origin, goal.origin);

View File

@ -88,14 +88,18 @@ public class GoalNear implements Goal, IGoalRenderPos {
@Override @Override
public boolean equals(Object o) { public boolean equals(Object o) {
if (this == o) return true; if (this == o) {
if (o == null || getClass() != o.getClass()) return false; return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
GoalNear goal = (GoalNear) o; GoalNear goal = (GoalNear) o;
if (x != goal.x) return false; return x == goal.x
if (y != goal.y) return false; && y == goal.y
if (z != goal.z) return false; && z == goal.z
return rangeSq == goal.rangeSq; && rangeSq == goal.rangeSq;
} }
@Override @Override

View File

@ -127,13 +127,17 @@ public class GoalRunAway implements Goal {
@Override @Override
public boolean equals(Object o) { public boolean equals(Object o) {
if (this == o) return true; if (this == o) {
if (o == null || getClass() != o.getClass()) return false; return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
GoalRunAway goal = (GoalRunAway) o; GoalRunAway goal = (GoalRunAway) o;
if (distanceSq != goal.distanceSq) return false; return distanceSq == goal.distanceSq
if (!Arrays.equals(from, goal.from)) return false; && Arrays.equals(from, goal.from)
return Objects.equals(maintainY, goal.maintainY); && Objects.equals(maintainY, goal.maintainY);
} }
@Override @Override

View File

@ -71,15 +71,19 @@ public class GoalStrictDirection implements Goal {
@Override @Override
public boolean equals(Object o) { public boolean equals(Object o) {
if (this == o) return true; if (this == o) {
if (o == null || getClass() != o.getClass()) return false; return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
GoalStrictDirection goal = (GoalStrictDirection) o; GoalStrictDirection goal = (GoalStrictDirection) o;
if (x != goal.x) return false; return x == goal.x
if (y != goal.y) return false; && y != goal.y
if (z != goal.z) return false; && z == goal.z
if (dx != goal.dx) return false; && dx == goal.dx
return dz == goal.dz; && dz == goal.dz;
} }
@Override @Override

View File

@ -74,13 +74,17 @@ public class GoalTwoBlocks implements Goal, IGoalRenderPos {
@Override @Override
public boolean equals(Object o) { public boolean equals(Object o) {
if (this == o) return true; if (this == o) {
if (o == null || getClass() != o.getClass()) return false; return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
GoalTwoBlocks goal = (GoalTwoBlocks) o; GoalTwoBlocks goal = (GoalTwoBlocks) o;
if (x != goal.x) return false; return x == goal.x
if (y != goal.y) return false; && y == goal.y
return z == goal.z; && z == goal.z;
} }
@Override @Override

View File

@ -66,12 +66,15 @@ public class GoalXZ implements Goal {
@Override @Override
public boolean equals(Object o) { public boolean equals(Object o) {
if (this == o) return true; if (this == o) {
if (o == null || getClass() != o.getClass()) return false; return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
GoalXZ goal = (GoalXZ) o; GoalXZ goal = (GoalXZ) o;
if (x != goal.x) return false; return x == goal.x && z == goal.z;
return z == goal.z;
} }
@Override @Override

View File

@ -60,8 +60,12 @@ public class GoalYLevel implements Goal, ActionCosts {
@Override @Override
public boolean equals(Object o) { public boolean equals(Object o) {
if (this == o) return true; if (this == o) {
if (o == null || getClass() != o.getClass()) return false; return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
GoalYLevel goal = (GoalYLevel) o; GoalYLevel goal = (GoalYLevel) o;
return level == goal.level; return level == goal.level;

View File

@ -763,12 +763,16 @@ public final class BuilderProcess extends BaritoneProcessHelper implements IBuil
@Override @Override
public boolean equals(Object o) { public boolean equals(Object o) {
if (this == o) return true; if (this == o) {
if (o == null || getClass() != o.getClass()) return false; return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
JankyGoalComposite goal = (JankyGoalComposite) o; JankyGoalComposite goal = (JankyGoalComposite) o;
if (!Objects.equals(primary, goal.primary)) return false; return Objects.equals(primary, goal.primary)
return Objects.equals(fallback, goal.fallback); && Objects.equals(fallback, goal.fallback);
} }
@Override @Override
@ -870,11 +874,13 @@ public final class BuilderProcess extends BaritoneProcessHelper implements IBuil
@Override @Override
public boolean equals(Object o) { public boolean equals(Object o) {
if (!super.equals(o)) return false; if (!super.equals(o)) {
return false;
}
GoalAdjacent goal = (GoalAdjacent) o; GoalAdjacent goal = (GoalAdjacent) o;
if (allowSameLevel != goal.allowSameLevel) return false; return allowSameLevel == goal.allowSameLevel
return Objects.equals(no, goal.no); && Objects.equals(no, goal.no);
} }
@Override @Override