Skip to content

Commit

Permalink
Improve dLocation.equals, fixes #876
Browse files Browse the repository at this point in the history
Theoretically corrects trouble with .getBlock() in weird locations.
  • Loading branch information
mcmonkey4eva committed Nov 12, 2014
1 parent b03eaf7 commit 75aca2e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main/java/net/aufdemrand/denizen/objects/dLocation.java
Expand Up @@ -274,7 +274,10 @@ public int hashCode() {
public boolean equals(Object o) {
if (o == null) return false;
if (!(o instanceof dLocation)) return false;
return getBlock().getLocation().equals(((dLocation) o).getBlock().getLocation());
dLocation other = (dLocation) o;
return Math.round(getX()) == Math.round(other.getX())
&& Math.round(getY()) == Math.round(other.getY())
&& Math.round(getZ()) == Math.round(other.getZ());
}

String prefix = "Location";
Expand Down

0 comments on commit 75aca2e

Please sign in to comment.