Removed PlayerAPI

This commit is contained in:
Shoghi Cervantes
2014-04-02 19:07:29 +02:00
parent c81266d1da
commit 379b70eca7
3 changed files with 56 additions and 351 deletions

View File

@ -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;