コード例 #1
0
 /**
  * @param PlayerJoinEvent $event
  *
  * @priority MONITOR
  */
 public function onPlayerJoin(PlayerJoinEvent $event)
 {
     $pk = new TextPacket();
     $pk->type = TextPacket::TYPE_CHAT;
     $pk->source = "";
     $pk->message = TextFormat::BLACK . "BlockLauncher, enable scripts";
     $event->getPlayer()->dataPacket($pk->setChannel(Network::CHANNEL_TEXT));
 }
コード例 #2
0
ファイル: Player.php プロジェクト: richarrj/PocketMine-MP
 public function sendTip($message)
 {
     $pk = new TextPacket();
     $pk->type = TextPacket::TYPE_TIP;
     $pk->message = $message;
     $this->dataPacket($pk->setChannel(Network::CHANNEL_TEXT));
 }
コード例 #3
0
ファイル: TextUtil.php プロジェクト: robozeri/SG
 public static function sendRawText(Player $player, $message, $viewers = null)
 {
     $packet = new TextPacket();
     $packet->type = TextPacket::TYPE_RAW;
     $packet->message = $message;
     $packet->setChannel(Network::CHANNEL_TEXT);
     $player->dataPacket($packet);
     if ($viewers != null) {
         $player->getServer()->broadcastPacket($viewers, $packet);
     }
 }