mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2024-08-12 14:06:29 +00:00
Make /realname throw an error if no matches were found
This commit is contained in:
parent
24cdc37987
commit
5611acf12c
|
@ -24,6 +24,7 @@ public class Commandrealname extends EssentialsCommand
|
|||
throw new NotEnoughArgumentsException();
|
||||
}
|
||||
final String whois = args[0].toLowerCase(Locale.ENGLISH);
|
||||
boolean foundUser = false;
|
||||
for (Player onlinePlayer : server.getOnlinePlayers())
|
||||
{
|
||||
final User u = ess.getUser(onlinePlayer);
|
||||
|
@ -39,7 +40,12 @@ public class Commandrealname extends EssentialsCommand
|
|||
{
|
||||
continue;
|
||||
}
|
||||
foundUser = true;
|
||||
sender.sendMessage(u.getDisplayName() + " " + _("is") + " " + u.getName());
|
||||
}
|
||||
if (!foundUser)
|
||||
{
|
||||
throw new NoSuchFieldException(_("playerNotFound"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue