mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-02-12 04:20:41 +00:00
parent
735f9ce212
commit
9ee78bdaec
1 changed files with 21 additions and 26 deletions
|
@ -26,29 +26,29 @@ public class Commandnear extends EssentialsCommand
|
|||
{
|
||||
try
|
||||
{
|
||||
otherUser = getPlayer(server, args, 0);
|
||||
radius = Long.parseLong(args[0]);
|
||||
}
|
||||
catch (Exception ex)
|
||||
catch (NumberFormatException e)
|
||||
{
|
||||
try
|
||||
{
|
||||
radius = Long.parseLong(args[0]);
|
||||
otherUser = getPlayer(server, args, 0);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
}
|
||||
}
|
||||
if (args.length > 1 && otherUser != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
radius = Long.parseLong(args[1]);
|
||||
}
|
||||
catch (NumberFormatException e)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
if (args.length > 1 && otherUser != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
radius = Long.parseLong(args[1]);
|
||||
}
|
||||
catch (NumberFormatException e)
|
||||
{
|
||||
}
|
||||
}
|
||||
if (otherUser == null || user.isAuthorized("essentials.near.others"))
|
||||
{
|
||||
user.sendMessage(_("nearbyPlayers", getLocal(server, otherUser == null ? user : otherUser, radius)));
|
||||
|
@ -62,16 +62,11 @@ public class Commandnear extends EssentialsCommand
|
|||
@Override
|
||||
protected void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
|
||||
{
|
||||
|
||||
User otherUser = null;
|
||||
if (args.length > 0)
|
||||
{
|
||||
otherUser = getPlayer(server, args, 0);
|
||||
}
|
||||
else
|
||||
if (args.length == 0)
|
||||
{
|
||||
throw new NotEnoughArgumentsException();
|
||||
}
|
||||
final User otherUser = getPlayer(server, args, 0);
|
||||
long radius = 200;
|
||||
if (args.length > 1)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue