public function maxPlainDistance($x = 0, $z = 0)
{
if ($x instanceof Vector3) {
return $this->maxPlainDistance($x->x, $x->z);
} elseif ($x instanceof Vector2) {
return $this->maxPlainDistance($x->x, $x->y);
} else {
return max(abs($this->x - $x), abs($this->z - $z));
}
}