summaryrefslogtreecommitdiffstats
path: root/Essentials/src/com/earth2me/essentials/commands/Commandbanip.java
diff options
context:
space:
mode:
authorKHobbits <rob@khobbits.co.uk>2013-05-26 17:58:04 +0100
committerKHobbits <rob@khobbits.co.uk>2013-05-26 17:58:04 +0100
commitac46caa33fc0728f60a6692762ba9ef44c338930 (patch)
tree8579e89fdb18b0cd4b73021af900b25a7051e216 /Essentials/src/com/earth2me/essentials/commands/Commandbanip.java
parent48db31083f945141ca767346b60bae45d0575064 (diff)
downloadEssentials-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.java11
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));
}
}