mirror of
https://github.com/essentials/Essentials.git
synced 2025-08-14 02:24:16 +02:00
Show how far away each player is.
This commit is contained in:
@@ -48,14 +48,14 @@ public class Commandnear extends EssentialsCommand
|
|||||||
final Location playerLoc = player.getLocation();
|
final Location playerLoc = player.getLocation();
|
||||||
if (playerLoc.getWorld() != world) { continue; }
|
if (playerLoc.getWorld() != world) { continue; }
|
||||||
|
|
||||||
final double delta = playerLoc.distanceSquared(loc);
|
final long delta = (long)playerLoc.distanceSquared(loc);
|
||||||
if (delta < radius)
|
if (delta < radius)
|
||||||
{
|
{
|
||||||
if (output.length() > 0)
|
if (output.length() > 0)
|
||||||
{
|
{
|
||||||
output.append(", ");
|
output.append(", ");
|
||||||
}
|
}
|
||||||
output.append(player.getDisplayName()).append("&f(&4").append(delta).append("m&f)");
|
output.append(player.getDisplayName()).append("§f(§4").append(Math.sqrt(delta)).append("m§f)");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user