Exemplo n.º 1
0
 /**
  * Create new player using uuid (string)
  * @param $uuidString
  * @return MinecraftPlayer
  */
 public static function fromUUIDString($uuidString)
 {
     $uuid = UUID::fromString($uuidString);
     $profile = new Profile();
     $profile->setUuid($uuid);
     return new self($profile);
 }
Exemplo n.º 2
0
 /**
  * Gets whitelist object
  * @return Whitelist
  */
 public function getWhitelist()
 {
     if (!is_null($this->whitelist)) {
         return $this->whitelist;
     }
     $whitelist = new Whitelist();
     foreach ($this->players as $playerArray) {
         $profile = new Profile();
         $profile->setUuid(UUID::fromString($playerArray['uuid']));
         $profile->setUserName($playerArray['name']);
         $whitelist->addPlayer(new MinecraftPlayer($profile));
     }
     $this->whitelist = $whitelist;
     return $whitelist;
 }