50 if(count($args) === 0){
51 if($sender instanceof
Player){
52 $location = $sender->getPosition();
53 $world = $location->getWorld();
54 $pos = $location->asVector3()->floor();
56 $sender->sendMessage(TextFormat::RED .
"You can only perform this command as a player");
60 }elseif(count($args) === 3){
61 if($sender instanceof
Player){
62 $base = $sender->getPosition();
63 $world = $base->getWorld();
65 $base =
new Vector3(0.0, 0.0, 0.0);
66 $world = $sender->getServer()->getWorldManager()->getDefaultWorld();
69 $this->getRelativeDouble($base->x, $sender, $args[0]),
70 $this->getRelativeDouble($base->y, $sender, $args[1], World::Y_MIN, World::Y_MAX),
71 $this->getRelativeDouble($base->z, $sender, $args[2]),
77 $world->setSpawnLocation($pos);
79 Command::broadcastCommandMessage($sender, KnownTranslationFactory::commands_setworldspawn_success((
string) $pos->x, (
string) $pos->y, (
string) $pos->z));