Fixed issues with subtitles not working correctly, close #823 (#825)

This commit is contained in:
Dylan K. Taylor 2017-04-14 10:42:23 +01:00 committed by GitHub
commit 40775f5d86

View File

@ -3415,10 +3415,10 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
*/
public function addTitle(string $title, string $subtitle = "", int $fadeIn = -1, int $stay = -1, int $fadeOut = -1){
$this->setTitleDuration($fadeIn, $stay, $fadeOut);
$this->sendTitleText($title, SetTitlePacket::TYPE_SET_TITLE);
if($subtitle !== ""){
$this->sendTitleText($subtitle, SetTitlePacket::TYPE_SET_SUBTITLE);
}
$this->sendTitleText($title, SetTitlePacket::TYPE_SET_TITLE);
}
/**