getSpawn() public method

public getSpawn ( ) : Vector3
return pocketmine\math\Vector3
Example #1
0
 /**
  * Returns true if the spawn is part of the spawn
  *
  * @param int $X
  * @param int $Z
  *
  * @return bool
  */
 public function isSpawnChunk($X, $Z)
 {
     $spawnX = $this->provider->getSpawn()->getX() >> 4;
     $spawnZ = $this->provider->getSpawn()->getZ() >> 4;
     return abs($X - $spawnX) <= 1 and abs($Z - $spawnZ) <= 1;
 }
Example #2
0
 /**
  * Returns the raw spawnpoint
  *
  * @return Position
  */
 public function getSpawn()
 {
     return Position::fromObject($this->provider->getSpawn(), $this);
 }