mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-23 00:55:57 +00:00
Added whisper
This commit is contained in:
parent
da23568546
commit
208884422d
@ -2989,6 +2989,14 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
||||
$pk->message = $message;
|
||||
$this->dataPacket($pk);
|
||||
}
|
||||
|
||||
public function whisper($from, $message){
|
||||
$pk = new TextPacket();
|
||||
$pk->type = TextPacket::TYPE_WHISPER;
|
||||
$pk->source = $from instanceof Player ? $from->getDisplayName() : $from;
|
||||
$pk->message = $message;
|
||||
$this->dataPacket($pk);
|
||||
}
|
||||
|
||||
/**
|
||||
* Note for plugin developers: use kick() with the isAdmin
|
||||
|
@ -45,6 +45,7 @@ class TextPacket extends DataPacket{
|
||||
switch($this->type){
|
||||
case self::TYPE_POPUP:
|
||||
case self::TYPE_CHAT:
|
||||
case self::TYPE_WHISPER:
|
||||
$this->source = $this->getString();
|
||||
case self::TYPE_RAW:
|
||||
case self::TYPE_TIP:
|
||||
@ -67,6 +68,7 @@ class TextPacket extends DataPacket{
|
||||
switch($this->type){
|
||||
case self::TYPE_POPUP:
|
||||
case self::TYPE_CHAT:
|
||||
case self::TYPE_WHISPER:
|
||||
$this->putString($this->source);
|
||||
case self::TYPE_RAW:
|
||||
case self::TYPE_TIP:
|
||||
|
Loading…
x
Reference in New Issue
Block a user