mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-08-05 03:53:41 +00:00
More efficient distance calculation
This commit is contained in:
parent
0432546746
commit
74b0e71015
1 changed files with 1 additions and 1 deletions
|
@ -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");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue