Add ProxiedPlayer.chat, see #146

This commit is contained in:
md_5 2013-03-12 11:38:11 +11:00
parent 3b90737273
commit 59efec128d
2 changed files with 14 additions and 0 deletions

View File

@ -62,4 +62,11 @@ public interface ProxiedPlayer extends Connection, CommandSender
* @return the pending connection that this player used
*/
public PendingConnection getPendingConnection();
/**
* Make this player chat (say something), to the server he is currently on.
*
* @param message the message to say
*/
public void chat(String message);
}

View File

@ -160,6 +160,13 @@ public final class UserConnection implements ProxiedPlayer
}
}
@Override
public void chat(String message)
{
Preconditions.checkState( server != null, "Not connected to server" );
server.getCh().write( new Packet3Chat( message ) );
}
@Override
public void sendMessage(String message)
{