mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-08-06 12:33:03 +00:00
Update offline user check.
Add ban reason to /seen
This commit is contained in:
parent
8dcd591beb
commit
e11525ab64
10 changed files with 21 additions and 27 deletions
|
@ -23,20 +23,20 @@ public class Commandseen extends EssentialsCommand
|
|||
}
|
||||
try
|
||||
{
|
||||
User u = getPlayer(server, args, 0);
|
||||
sender.sendMessage(_("seenOnline", u.getDisplayName(), Util.formatDateDiff(u.getLastLogin())));
|
||||
User user = getPlayer(server, args, 0);
|
||||
sender.sendMessage(_("seenOnline", user.getDisplayName(), Util.formatDateDiff(user.getLastLogin())));
|
||||
}
|
||||
catch (NoSuchFieldException e)
|
||||
{
|
||||
User u = ess.getOfflineUser(args[0]);
|
||||
if (u == null)
|
||||
User user = ess.getOfflineUser(args[0]);
|
||||
if (user == null)
|
||||
{
|
||||
throw new Exception(_("playerNotFound"));
|
||||
}
|
||||
sender.sendMessage(_("seenOffline", u.getDisplayName(), Util.formatDateDiff(u.getLastLogout())));
|
||||
if (u.isBanned())
|
||||
sender.sendMessage(_("seenOffline", user.getDisplayName(), Util.formatDateDiff(user.getLastLogout())));
|
||||
if (user.isBanned())
|
||||
{
|
||||
sender.sendMessage(_("whoisBanned", _("true")));
|
||||
sender.sendMessage(_("whoisBanned", user.getBanReason()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue