mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-02-14 13:13:24 +00:00
Allow the 'userIsNotAway' and 'userIsAway' translation messages to be empty.
This commit is contained in:
parent
4967279b8c
commit
d674e65c11
2 changed files with 19 additions and 6 deletions
|
@ -70,8 +70,8 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
|
|||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private boolean isAuthorizedCheck(final String node)
|
||||
|
||||
private boolean isAuthorizedCheck(final String node)
|
||||
{
|
||||
|
||||
if (base instanceof OfflinePlayer)
|
||||
|
@ -538,7 +538,11 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
|
|||
if (broadcast && !isHidden())
|
||||
{
|
||||
setDisplayNick();
|
||||
ess.broadcastMessage(this, _("userIsNotAway", getDisplayName()));
|
||||
final String msg = _("userIsNotAway", getDisplayName());
|
||||
if (!msg.isEmpty())
|
||||
{
|
||||
ess.broadcastMessage(this, msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
lastActivity = System.currentTimeMillis();
|
||||
|
@ -571,7 +575,11 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
|
|||
if (!isHidden())
|
||||
{
|
||||
setDisplayNick();
|
||||
ess.broadcastMessage(this, _("userIsAway", getDisplayName()));
|
||||
final String msg = _("userIsAway", getDisplayName());
|
||||
if (!msg.isEmpty())
|
||||
{
|
||||
ess.broadcastMessage(this, msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,12 +32,13 @@ public class Commandafk extends EssentialsCommand
|
|||
private void toggleAfk(User user)
|
||||
{
|
||||
user.setDisplayNick();
|
||||
String msg = "";
|
||||
if (!user.toggleAfk())
|
||||
{
|
||||
//user.sendMessage(_("markedAsNotAway"));
|
||||
if (!user.isHidden())
|
||||
{
|
||||
ess.broadcastMessage(user, _("userIsNotAway", user.getDisplayName()));
|
||||
msg = _("userIsNotAway", user.getDisplayName());
|
||||
}
|
||||
user.updateActivity(false);
|
||||
}
|
||||
|
@ -46,8 +47,12 @@ public class Commandafk extends EssentialsCommand
|
|||
//user.sendMessage(_("markedAsAway"));
|
||||
if (!user.isHidden())
|
||||
{
|
||||
ess.broadcastMessage(user, _("userIsAway", user.getDisplayName()));
|
||||
msg = _("userIsAway", user.getDisplayName());
|
||||
}
|
||||
}
|
||||
if (!msg.isEmpty())
|
||||
{
|
||||
ess.broadcastMessage(user, msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue