9
0
mirror of https://github.com/VolmitSoftware/Iris.git synced 2025-12-27 11:09:06 +00:00

Merge pull request #671 from CocoTheOwner/betterFind

Improve finding by allowing minimal distance & randomization
This commit is contained in:
Dan
2021-11-11 17:54:25 -05:00
committed by GitHub
5 changed files with 43 additions and 28 deletions

View File

@@ -80,7 +80,7 @@ public class Position2 {
}
public double distance(Position2 center) {
return Math.pow(center.getX() - x, 2) + Math.pow(center.getZ() - z, 2);
return Math.sqrt(Math.pow(center.getX() - x, 2) + Math.pow(center.getZ() - z, 2));
}
public Position2 add(int x, int z) {