Don't send the message if the length is 0

This commit is contained in:
libraryaddict 2014-01-26 13:23:53 +13:00
parent 06f2f4e4b2
commit b85e26321b

View File

@ -71,7 +71,7 @@ public class DisguiseListener implements Listener {
if (disguises.length > 0) { if (disguises.length > 0) {
DisguiseAPI.undisguiseToAll(event.getEntity()); DisguiseAPI.undisguiseToAll(event.getEntity());
for (Disguise disguise : disguises) { for (Disguise disguise : disguises) {
if (DisguiseUtilities.isDisguiseInUse(disguise)) { if (DisguiseUtilities.isDisguiseInUse(disguise) && DisguiseConfig.getDisguiseBlownMessage().length() > 0) {
((Player) event.getEntity()).sendMessage(DisguiseConfig.getDisguiseBlownMessage()); ((Player) event.getEntity()).sendMessage(DisguiseConfig.getDisguiseBlownMessage());
break; break;
} }
@ -83,9 +83,10 @@ public class DisguiseListener implements Listener {
@EventHandler @EventHandler
public void onJoin(PlayerJoinEvent event) { public void onJoin(PlayerJoinEvent event) {
Player p = event.getPlayer(); Player p = event.getPlayer();
if (latestVersion != null && p.hasPermission(updateNotifyPermission)) if (latestVersion != null && p.hasPermission(updateNotifyPermission)) {
p.sendMessage(String.format(updateMessage, currentVersion, latestVersion)); p.sendMessage(String.format(updateMessage, currentVersion, latestVersion));
} }
}
@EventHandler @EventHandler
public void onQuit(PlayerQuitEvent event) { public void onQuit(PlayerQuitEvent event) {