Fixed equals() without hashCode().

This commit is contained in:
sk89q 2014-04-04 14:40:51 -07:00
parent 478ce3f627
commit b9c1dc6231
2 changed files with 18 additions and 0 deletions

View File

@ -58,4 +58,17 @@ public class BlockWorldVector2D extends WorldVector2D {
&& (int) other.getZ() == (int) this.z;
}
@Override
public int hashCode() {
int result = super.hashCode();
long temp;
result = 31 * result + world.hashCode();
temp = Double.doubleToLongBits(x);
result = 31 * result + (int) (temp ^ (temp >>> 32));
temp = Double.doubleToLongBits(z);
result = 31 * result + (int) (temp ^ (temp >>> 32));
return result;
}
}

View File

@ -212,4 +212,9 @@ public class Snapshot implements Comparable<Snapshot> {
}
return false;
}
@Override
public int hashCode() {
return file.hashCode();
}
}