Implement hashCode for goals
This commit is contained in:
@@ -775,6 +775,14 @@ public final class BuilderProcess extends BaritoneProcessHelper implements IBuil
|
||||
&& Objects.equals(fallback, goal.fallback);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int hash = -1701079641;
|
||||
hash = hash * 1196141026 + primary.hashCode();
|
||||
hash = hash * -80327868 + fallback.hashCode();
|
||||
return hash;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "JankyComposite Primary: " + primary + " Fallback: " + fallback;
|
||||
@@ -806,6 +814,11 @@ public final class BuilderProcess extends BaritoneProcessHelper implements IBuil
|
||||
SettingsUtil.maybeCensor(z)
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return super.hashCode() * 1636324008;
|
||||
}
|
||||
}
|
||||
|
||||
private Goal placementGoal(BlockPos pos, BuilderCalculationContext bcc) {
|
||||
@@ -883,6 +896,14 @@ public final class BuilderProcess extends BaritoneProcessHelper implements IBuil
|
||||
&& Objects.equals(no, goal.no);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int hash = 806368046;
|
||||
hash = hash * 1730799370 + (int) BetterBlockPos.longHash(no.getX(), no.getY(), no.getZ());
|
||||
hash = hash * 260592149 + (allowSameLevel ? -1314802005 : 1565710265);
|
||||
return hash;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.format(
|
||||
@@ -906,6 +927,11 @@ public final class BuilderProcess extends BaritoneProcessHelper implements IBuil
|
||||
return this.y * 100 + super.heuristic(x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return super.hashCode() * 1910811835;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.format(
|
||||
|
||||
@@ -325,6 +325,11 @@ public final class MineProcess extends BaritoneProcessHelper implements IMinePro
|
||||
return super.equals(o);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return super.hashCode() * 393857768;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.format(
|
||||
|
||||
Reference in New Issue
Block a user