Implement hashCode for goals

This commit is contained in:
ZacSharp
2023-06-20 02:44:29 +02:00
parent 6c8f2698d6
commit 30278a1c52
13 changed files with 100 additions and 0 deletions

View File

@@ -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(

View File

@@ -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(