mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-08 02:42:58 +00:00
PlayerAPI teleport commands now return a correct name
This commit is contained in:
@ -218,17 +218,19 @@ class PlayerAPI{
|
|||||||
return $output;
|
return $output;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function teleport($name, $target){
|
public function teleport(&$name, &$target){
|
||||||
$target = $this->get($target);
|
$player = $this->get($target);
|
||||||
if(($target instanceof Player) and ($target->entity instanceof Entity)){
|
if(($player instanceof Player) and ($player->entity instanceof Entity)){
|
||||||
return $this->tppos($name, $target->entity->x, $target->entity->y, $target->entity->z);
|
$target = $player->username;
|
||||||
|
return $this->tppos($name, $player->entity->x, $player->entity->y, $player->entity->z);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function tppos($name, $x, $y, $z){
|
public function tppos(&$name, $x, $y, $z){
|
||||||
$player = $this->get($name);
|
$player = $this->get($name);
|
||||||
if(($player instanceof Player) and ($player->entity instanceof Entity)){
|
if(($player instanceof Player) and ($player->entity instanceof Entity)){
|
||||||
|
$name = $player->username;
|
||||||
$player->teleport(new Vector3($x, $y, $z));
|
$player->teleport(new Vector3($x, $y, $z));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user