public function setPosition(Vector3 $pos)
{
if ($this->closed) {
return false;
}
if ($pos instanceof Position and $pos->level !== null and $pos->level !== $this->level) {
if ($this->switchLevel($pos->getLevel()) === false) {
return false;
}
}
$this->x = $pos->x;
$this->y = $pos->y;
$this->z = $pos->z;
$radius = $this->width / 2;
$this->boundingBox->setBounds($pos->x - $radius, $pos->y, $pos->z - $radius, $pos->x + $radius, $pos->y + $this->height, $pos->z + $radius);
$this->checkChunks();
return true;
}