mirror of
https://github.com/essentials/Essentials.git
synced 2025-08-12 09:35:26 +02:00
@@ -23,12 +23,6 @@ public class Commandnear extends EssentialsCommand
|
|||||||
User otherUser = null;
|
User otherUser = null;
|
||||||
|
|
||||||
if (args.length > 0)
|
if (args.length > 0)
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
otherUser = getPlayer(server, args, 0);
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -36,7 +30,12 @@ public class Commandnear extends EssentialsCommand
|
|||||||
}
|
}
|
||||||
catch (NumberFormatException e)
|
catch (NumberFormatException e)
|
||||||
{
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
otherUser = getPlayer(server, args, 0);
|
||||||
}
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (args.length > 1 && otherUser != null)
|
if (args.length > 1 && otherUser != null)
|
||||||
@@ -49,6 +48,7 @@ public class Commandnear extends EssentialsCommand
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (otherUser == null || user.isAuthorized("essentials.near.others"))
|
if (otherUser == null || user.isAuthorized("essentials.near.others"))
|
||||||
{
|
{
|
||||||
user.sendMessage(_("nearbyPlayers", getLocal(server, otherUser == null ? user : otherUser, radius)));
|
user.sendMessage(_("nearbyPlayers", getLocal(server, otherUser == null ? user : otherUser, radius)));
|
||||||
@@ -62,16 +62,11 @@ public class Commandnear extends EssentialsCommand
|
|||||||
@Override
|
@Override
|
||||||
protected void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
|
protected void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
|
||||||
{
|
{
|
||||||
|
if (args.length == 0)
|
||||||
User otherUser = null;
|
|
||||||
if (args.length > 0)
|
|
||||||
{
|
|
||||||
otherUser = getPlayer(server, args, 0);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
throw new NotEnoughArgumentsException();
|
throw new NotEnoughArgumentsException();
|
||||||
}
|
}
|
||||||
|
final User otherUser = getPlayer(server, args, 0);
|
||||||
long radius = 200;
|
long radius = 200;
|
||||||
if (args.length > 1)
|
if (args.length > 1)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user