mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-05 09:26:06 +00:00
Removed PlayerAPI
This commit is contained in:
@ -73,16 +73,10 @@ class TeleportCommand extends VanillaCommand{
|
||||
Command::broadcastCommandMessage($sender, "Set ".$target->getName()."'s spawnpoint to ".$pos->x.", ".$pos->y.", ".$pos->z);
|
||||
return true;
|
||||
}elseif($target->getLevel() !== null){
|
||||
$pos = count($args) === 4 ? 2:1;
|
||||
if($sender instanceof Player){
|
||||
$x = $this->getRelativeDouble($sender->x, $sender, $args[$pos++]);
|
||||
$y = $this->getRelativeDouble($sender->y, $sender, $args[$pos++], 0, 128);
|
||||
$z = $this->getRelativeDouble($sender->z, $sender, $args[$pos]);
|
||||
}else{
|
||||
$x = $this->getDouble($sender, $args[$pos++]);
|
||||
$y = $this->getDouble($sender, $args[$pos++], 0, 128);
|
||||
$z = $this->getDouble($sender, $args[$pos]);
|
||||
}
|
||||
$pos = count($args) === 4 ? 1:0;
|
||||
$x = $this->getRelativeDouble($target->x, $sender, $args[$pos++]);
|
||||
$y = $this->getRelativeDouble($target->y, $sender, $args[$pos++], 0, 128);
|
||||
$z = $this->getRelativeDouble($target->z, $sender, $args[$pos]);
|
||||
$target->teleport(new Vector3($x, $y, $z));
|
||||
Command::broadcastCommandMessage($sender, "Teleported ".$target->getName()." to ".round($x, 2).", ".round($y, 2).", ".round($z, 2));
|
||||
return true;
|
||||
|
Reference in New Issue
Block a user