Fix local message when no players are in the area

Allow any translation key to be silenced by blanking it in locale file
This commit is contained in:
KHobbits 2013-07-13 18:46:26 +01:00
parent cd51d718ba
commit fc63f63de6
3 changed files with 10 additions and 7 deletions

View File

@ -246,11 +246,7 @@ public class EssentialsPlayerListener implements Listener
final List<String> mail = user.getMails(); final List<String> mail = user.getMails();
if (mail.isEmpty()) if (mail.isEmpty())
{ {
final String msg = _("noNewMail"); user.sendMessage(_("noNewMail"));
if (!msg.isEmpty())
{
user.sendMessage(msg);
}
} }
else else
{ {

View File

@ -783,4 +783,11 @@ public class User extends UserData implements Comparable<User>, IReplyTo, net.es
{ {
this.recipeSee = recipeSee; this.recipeSee = recipeSee;
} }
@Override
public void sendMessage(String message) {
if (!message.isEmpty()) {
base.sendMessage(message);
}
}
} }

View File

@ -130,13 +130,13 @@ public class EssentialsChatPlayerListenerNormal extends EssentialsChatPlayer
{ {
spyList.add(onlinePlayer); spyList.add(onlinePlayer);
} }
outList.remove(onlinePlayer); it.remove();
} }
} }
} }
if (outList.size() < 2) { if (outList.size() < 2) {
event.getPlayer().sendMessage(_("localNoOne")); user.sendMessage(_("localNoOne"));
} }
LocalChatSpyEvent spyEvent = new LocalChatSpyEvent(event.isAsynchronous(), event.getPlayer(), event.getFormat(), event.getMessage(), spyList); LocalChatSpyEvent spyEvent = new LocalChatSpyEvent(event.isAsynchronous(), event.getPlayer(), event.getFormat(), event.getMessage(), spyList);