Added popup notices!

This commit is contained in:
Shoghi Cervantes 2015-03-20 17:56:07 +01:00
parent 58253be0a0
commit 652987110a
2 changed files with 10 additions and 0 deletions

View File

@ -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

View File

@ -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;