/** * @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)); }
public function sendTip($message) { $pk = new TextPacket(); $pk->type = TextPacket::TYPE_TIP; $pk->message = $message; $this->dataPacket($pk->setChannel(Network::CHANNEL_TEXT)); }
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); } }