diff --git a/pathfinder-bukkit/src/main/java/de/cubbossa/pathfinder/navigation/BukkitNavigationModule.java b/pathfinder-bukkit/src/main/java/de/cubbossa/pathfinder/navigation/BukkitNavigationModule.java index f90e2cd7..0cfcc216 100644 --- a/pathfinder-bukkit/src/main/java/de/cubbossa/pathfinder/navigation/BukkitNavigationModule.java +++ b/pathfinder-bukkit/src/main/java/de/cubbossa/pathfinder/navigation/BukkitNavigationModule.java @@ -60,7 +60,7 @@ public void onMove(PlayerMoveEvent event) { PathPlayer pathPlayer = PathPlayer.wrap(p); AbstractNavigationModule.NavigationContext info = activePaths.get(pathPlayer.getUniqueId()); - if (info != null && pathPlayer.getLocation().distanceSquared(info.target().getLocation()) < Math.pow(info.dist(), info.dist())) { + if (info != null && pathPlayer.getLocation().distanceSquared(info.target().getLocation()) < Math.pow(info.dist(), 2)) { reach(info.playerId()); } }