31 public function __construct(
36 public function getName() :
string{
40 public function getFirstPlayed() : ?DateTimeImmutable{
41 return ($this->namedtag !==
null && ($firstPlayedTag = $this->namedtag->getTag(Player::TAG_FIRST_PLAYED)) instanceof
LongTag) ?
new DateTimeImmutable(
'@' . $firstPlayedTag->getValue() / 1000) :
null;
44 public function getLastPlayed() : ?DateTimeImmutable{
45 return ($this->namedtag !==
null && ($lastPlayedTag = $this->namedtag->getTag(Player::TAG_LAST_PLAYED)) instanceof
LongTag) ?
new DateTimeImmutable(
'@' . $lastPlayedTag->getValue() / 1000) :
null;
48 public function hasPlayedBefore() :
bool{
49 return $this->namedtag !==
null;