mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-01-03 15:08:18 +01:00
More efficient distance calculation
This commit is contained in:
parent
0432546746
commit
74b0e71015
@ -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…
Reference in New Issue
Block a user