summaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authorsk89q <the.sk89q@gmail.com>2011-01-15 13:40:15 -0800
committersk89q <the.sk89q@gmail.com>2011-01-15 13:40:35 -0800
commitf6d4979aa28b5bf03722d838a58e2915edb394b1 (patch)
tree7500bd7e3e12569941936d25f5c0498b91eaf3dc /src/main
parent4d1c1fe5ed3b5b58797d95f53705cefa27ad5fba (diff)
downloadcraftbukkit-f6d4979aa28b5bf03722d838a58e2915edb394b1.tar
craftbukkit-f6d4979aa28b5bf03722d838a58e2915edb394b1.tar.gz
craftbukkit-f6d4979aa28b5bf03722d838a58e2915edb394b1.tar.lz
craftbukkit-f6d4979aa28b5bf03722d838a58e2915edb394b1.tar.xz
craftbukkit-f6d4979aa28b5bf03722d838a58e2915edb394b1.zip
Added Server.broadcastMessage().
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/bukkit/craftbukkit/CraftServer.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 9b94c1fb..048feb89 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -78,6 +78,16 @@ public final class CraftServer implements Server {
return null;
}
+
+ public int broadcastMessage(String message) {
+ Player[] players = getOnlinePlayers();
+
+ for (Player player : players) {
+ player.sendMessage(message);
+ }
+
+ return players.length;
+ }
public Player getPlayer(final EntityPlayerMP entity) {
return entity.a.getPlayer();