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