mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-16 11:58:00 +00:00
Moved SetTitlePacket usage to NetworkSession (#3186)
This commit is contained in:
@@ -64,6 +64,7 @@ use pocketmine\network\mcpe\protocol\ServerboundPacket;
|
||||
use pocketmine\network\mcpe\protocol\ServerToClientHandshakePacket;
|
||||
use pocketmine\network\mcpe\protocol\SetPlayerGameTypePacket;
|
||||
use pocketmine\network\mcpe\protocol\SetSpawnPositionPacket;
|
||||
use pocketmine\network\mcpe\protocol\SetTitlePacket;
|
||||
use pocketmine\network\mcpe\protocol\TextPacket;
|
||||
use pocketmine\network\mcpe\protocol\TransferPacket;
|
||||
use pocketmine\network\mcpe\protocol\types\command\CommandData;
|
||||
@@ -843,6 +844,30 @@ class NetworkSession{
|
||||
}
|
||||
}
|
||||
|
||||
public function onTitle(string $title) : void{
|
||||
$this->sendDataPacket(SetTitlePacket::title($title));
|
||||
}
|
||||
|
||||
public function onSubTitle(string $subtitle) : void{
|
||||
$this->sendDataPacket(SetTitlePacket::subtitle($subtitle));
|
||||
}
|
||||
|
||||
public function onActionBar(string $actionBar) : void{
|
||||
$this->sendDataPacket(SetTitlePacket::actionBarMessage($actionBar));
|
||||
}
|
||||
|
||||
public function onClearTitle() : void{
|
||||
$this->sendDataPacket(SetTitlePacket::clearTitle());
|
||||
}
|
||||
|
||||
public function onResetTitleOptions() : void{
|
||||
$this->sendDataPacket(SetTitlePacket::resetTitleOptions());
|
||||
}
|
||||
|
||||
public function onTitleDuration(int $fadeIn, int $stay, int $fadeOut) : void{
|
||||
$this->sendDataPacket(SetTitlePacket::setAnimationTimes($fadeIn, $stay, $fadeOut));
|
||||
}
|
||||
|
||||
public function tick() : bool{
|
||||
if($this->info === null){
|
||||
if(time() >= $this->connectTime + 10){
|
||||
|
Reference in New Issue
Block a user