diff --git a/src/pocketmine/Player.php b/src/pocketmine/Player.php index aabaddd330..5f2ea1e18e 100644 --- a/src/pocketmine/Player.php +++ b/src/pocketmine/Player.php @@ -2415,6 +2415,13 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{ $pk->parameters = $parameters; $this->dataPacket($pk); } + + public function sendPopup($message){ + $pk = new TextPacket(); + $pk->type = TextPacket::TYPE_POPUP; + $pk->message = $message; + $this->dataPacket($pk); + } /** * @param string $message Message to be broadcasted diff --git a/src/pocketmine/network/protocol/TextPacket.php b/src/pocketmine/network/protocol/TextPacket.php index 98cf11db14..aac213fd2f 100644 --- a/src/pocketmine/network/protocol/TextPacket.php +++ b/src/pocketmine/network/protocol/TextPacket.php @@ -31,6 +31,7 @@ class TextPacket extends DataPacket{ const TYPE_RAW = 0; const TYPE_CHAT = 1; const TYPE_TRANSLATION = 2; + const TYPE_POPUP = 3; public $type; public $source; @@ -47,6 +48,7 @@ class TextPacket extends DataPacket{ case self::TYPE_CHAT: $this->source = $this->getString(); case self::TYPE_RAW: + case self::TYPE_POPUP: $this->message = $this->getString(); break; @@ -66,6 +68,7 @@ class TextPacket extends DataPacket{ case self::TYPE_CHAT: $this->putString($this->source); case self::TYPE_RAW: + case self::TYPE_POPUP: $this->putString($this->message); break;