mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 11:39:43 +00:00
Added player commands, better console API and implemented future player chat
This commit is contained in:
parent
72388fa3cb
commit
c2e55941d8
6 changed files with 186 additions and 131 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue