mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 00:33:59 +00:00
Fixed teleport commands for disconnected players
This commit is contained in:
parent
7c33c4f75a
commit
5970927e8a
@ -167,7 +167,7 @@ class PlayerAPI{
|
||||
|
||||
public function teleport($name, $target){
|
||||
$target = $this->get($target);
|
||||
if($target !== false){
|
||||
if(($target instanceof Player) and ($target->entity instanceof Entity)){
|
||||
return $this->tppos($name, $target->entity->x, $target->entity->y, $target->entity->z);
|
||||
}
|
||||
return false;
|
||||
@ -175,7 +175,7 @@ class PlayerAPI{
|
||||
|
||||
public function tppos($name, $x, $y, $z){
|
||||
$player = $this->get($name);
|
||||
if($player !== false){
|
||||
if(($player instanceof Player) and ($player->entity instanceof Entity)){
|
||||
$player->entity->setPosition($x, $y, $z, 0, 0);
|
||||
$player->fallY = false;
|
||||
$player->fallStart = false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user