Added types and changed to sendWhisper

This commit is contained in:
Kripth 2016-11-03 19:23:10 +01:00 committed by SOFe
parent 208884422d
commit ac37af3a46

View File

@ -2990,10 +2990,14 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
$this->dataPacket($pk); $this->dataPacket($pk);
} }
public function whisper($from, $message){ /**
* @param string|Player $sender
* @param string $message
*/
public function sendWhisper($sender, $message){
$pk = new TextPacket(); $pk = new TextPacket();
$pk->type = TextPacket::TYPE_WHISPER; $pk->type = TextPacket::TYPE_WHISPER;
$pk->source = $from instanceof Player ? $from->getDisplayName() : $from; $pk->source = $sender instanceof Player ? $sender->getDisplayName() : $sender;
$pk->message = $message; $pk->message = $message;
$this->dataPacket($pk); $this->dataPacket($pk);
} }