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