Implement PR #212 - sendMessages() for CommandSenders
This commit is contained in:
parent
49f2f5f28b
commit
87fcef0658
@ -19,6 +19,14 @@ public interface CommandSender
|
|||||||
*/
|
*/
|
||||||
public void sendMessage(String message);
|
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
|
* Get all groups this user is part of. This returns an unmodifiable
|
||||||
* collection.
|
* collection.
|
||||||
|
@ -183,6 +183,15 @@ public final class UserConnection implements ProxiedPlayer
|
|||||||
ch.write( new Packet3Chat( message ) );
|
ch.write( new Packet3Chat( message ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void sendMessages(String... messages)
|
||||||
|
{
|
||||||
|
for ( String message : messages )
|
||||||
|
{
|
||||||
|
sendMessage( message );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void sendData(String channel, byte[] data)
|
public void sendData(String channel, byte[] data)
|
||||||
{
|
{
|
||||||
|
@ -25,6 +25,15 @@ public class ConsoleCommandSender implements CommandSender
|
|||||||
System.out.println( ChatColor.stripColor( message ) );
|
System.out.println( ChatColor.stripColor( message ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void sendMessages(String... messages)
|
||||||
|
{
|
||||||
|
for ( String message : messages )
|
||||||
|
{
|
||||||
|
sendMessage( message );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getName()
|
public String getName()
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user