diff --git a/api/src/main/java/net/md_5/bungee/api/CommandSender.java b/api/src/main/java/net/md_5/bungee/api/CommandSender.java index 3596e52f..0a51b57f 100644 --- a/api/src/main/java/net/md_5/bungee/api/CommandSender.java +++ b/api/src/main/java/net/md_5/bungee/api/CommandSender.java @@ -19,6 +19,14 @@ public interface CommandSender */ public void sendMessage(String message); + /** + * Send several messages to this sender. Each message will be sent + * separately. + * + * @param messages the messages to send + */ + public void sendMessages(String... messages); + /** * Get all groups this user is part of. This returns an unmodifiable * collection. diff --git a/proxy/src/main/java/net/md_5/bungee/UserConnection.java b/proxy/src/main/java/net/md_5/bungee/UserConnection.java index 1869ac59..a4aa91c7 100644 --- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java @@ -183,6 +183,15 @@ public final class UserConnection implements ProxiedPlayer ch.write( new Packet3Chat( message ) ); } + @Override + public void sendMessages(String... messages) + { + for ( String message : messages ) + { + sendMessage( message ); + } + } + @Override public void sendData(String channel, byte[] data) { diff --git a/proxy/src/main/java/net/md_5/bungee/command/ConsoleCommandSender.java b/proxy/src/main/java/net/md_5/bungee/command/ConsoleCommandSender.java index ba87f607..10991c0c 100644 --- a/proxy/src/main/java/net/md_5/bungee/command/ConsoleCommandSender.java +++ b/proxy/src/main/java/net/md_5/bungee/command/ConsoleCommandSender.java @@ -25,6 +25,15 @@ public class ConsoleCommandSender implements CommandSender System.out.println( ChatColor.stripColor( message ) ); } + @Override + public void sendMessages(String... messages) + { + for ( String message : messages ) + { + sendMessage( message ); + } + } + @Override public String getName() {