mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-08 19:02:59 +00:00
Added player commands, better console API and implemented future player chat
This commit is contained in:
@ -39,14 +39,18 @@ class ChatAPI{
|
||||
$this->send(false, $message);
|
||||
}
|
||||
|
||||
public function sendTo($owner, $text, $username){
|
||||
$this->send($owner, $text, array($username));
|
||||
public function sendTo($owner, $text, $player){
|
||||
$this->send($owner, $text, array($player));
|
||||
}
|
||||
|
||||
public function send($owner, $text, $whitelist = false, $blacklist = false){
|
||||
$message = "";
|
||||
if($owner !== false){
|
||||
$message = "<".$owner."> ";
|
||||
if($owner instanceof Player){
|
||||
$message = "<".$owner->username."> ";
|
||||
}else{
|
||||
$message = "<".$owner."> ";
|
||||
}
|
||||
}
|
||||
$message .= $text;
|
||||
console("[CHAT] ".$message);
|
||||
|
Reference in New Issue
Block a user