From f6d4979aa28b5bf03722d838a58e2915edb394b1 Mon Sep 17 00:00:00 2001 From: sk89q Date: Sat, 15 Jan 2011 13:40:15 -0800 Subject: [PATCH] Added Server.broadcastMessage(). --- src/main/java/org/bukkit/craftbukkit/CraftServer.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java index 9b94c1fbbb..048feb8945 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();