mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-01-12 11:21:28 +01: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 New Issue
Block a user