mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-07-04 13:01:42 +00:00
Added option to hide player from /list /who ... login message.
This is for other plugins, that want to hide a player. Use IEssentials.getUser(Player p).setHidden(boolean)
This commit is contained in:
parent
e3a470e264
commit
be83383fd5
10 changed files with 107 additions and 9 deletions
|
@ -53,12 +53,18 @@ public abstract class EssentialsCommand implements IEssentialsCommand
|
|||
|
||||
for (Player p : matches)
|
||||
{
|
||||
if (p.getDisplayName().startsWith(args[pos]))
|
||||
final User u = ess.getUser(p);
|
||||
if (u.getDisplayName().startsWith(args[pos]) && (getOffline || !u.isHidden()))
|
||||
{
|
||||
return ess.getUser(p);
|
||||
return u;
|
||||
}
|
||||
}
|
||||
return ess.getUser(matches.get(0));
|
||||
final User u = ess.getUser(matches.get(0));
|
||||
if (!getOffline && u.isHidden())
|
||||
{
|
||||
throw new NoSuchFieldException(Util.i18n("playerNotFound"));
|
||||
}
|
||||
return u;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue