More efficient distance calculation

This commit is contained in:
pop4959 2019-02-26 19:54:19 -08:00
parent 0432546746
commit 74b0e71015

View File

@ -106,7 +106,7 @@ public class Commandnear extends EssentialsCommand {
output.append(", "); output.append(", ");
} }
User nearbyPlayer = nearbyPlayers.poll(); User nearbyPlayer = nearbyPlayers.poll();
output.append(nearbyPlayer.getDisplayName()).append("§f(§4").append((long) Math.sqrt(nearbyPlayer.getLocation().distanceSquared(loc))).append("m§f)"); output.append(nearbyPlayer.getDisplayName()).append("§f(§4").append((long) nearbyPlayer.getLocation().distance(loc)).append("m§f)");
} }
return output.length() > 1 ? output.toString() : tl("none"); return output.length() > 1 ? output.toString() : tl("none");