diff options
author | KHobbits <rob@khobbits.co.uk> | 2013-05-26 17:58:04 +0100 |
---|---|---|
committer | KHobbits <rob@khobbits.co.uk> | 2013-05-26 17:58:04 +0100 |
commit | ac46caa33fc0728f60a6692762ba9ef44c338930 (patch) | |
tree | 8579e89fdb18b0cd4b73021af900b25a7051e216 /Essentials/src/com/earth2me/essentials/commands/Commandbanip.java | |
parent | 48db31083f945141ca767346b60bae45d0575064 (diff) | |
download | Essentials-ac46caa33fc0728f60a6692762ba9ef44c338930.tar Essentials-ac46caa33fc0728f60a6692762ba9ef44c338930.tar.gz Essentials-ac46caa33fc0728f60a6692762ba9ef44c338930.tar.lz Essentials-ac46caa33fc0728f60a6692762ba9ef44c338930.tar.xz Essentials-ac46caa33fc0728f60a6692762ba9ef44c338930.zip |
Reduce duplicated broadcast code.
Diffstat (limited to 'Essentials/src/com/earth2me/essentials/commands/Commandbanip.java')
-rw-r--r-- | Essentials/src/com/earth2me/essentials/commands/Commandbanip.java | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandbanip.java b/Essentials/src/com/earth2me/essentials/commands/Commandbanip.java index ca0751a51..2d34175d1 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandbanip.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandbanip.java @@ -43,14 +43,7 @@ public class Commandbanip extends EssentialsCommand ess.getServer().banIP(ipAddress); server.getLogger().log(Level.INFO, _("playerBanIpAddress", senderName, ipAddress)); - - for (Player onlinePlayer : server.getOnlinePlayers()) - { - final User onlineUser = ess.getUser(onlinePlayer); - if (onlinePlayer == sender || onlineUser.isAuthorized("essentials.ban.notify")) - { - onlinePlayer.sendMessage(_("playerBanIpAddress", senderName, ipAddress)); - } - } + + ess.broadcastMessage(sender, "essentials.ban.notify", _("playerBanIpAddress", senderName, ipAddress)); } } |