mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-13 13:25:16 +00:00
Optional teleport yaw & pitch
This commit is contained in:
parent
3f820d18d2
commit
8a9e6426ca
@ -484,8 +484,14 @@ class Player{
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function teleport(Vector3 $pos, $yaw = 0, $pitch = 0){
|
public function teleport(Vector3 $pos, $yaw = false, $pitch = false){
|
||||||
if($this->entity instanceof Entity){
|
if($this->entity instanceof Entity){
|
||||||
|
if($yaw === false){
|
||||||
|
$yaw = $this->entity->yaw;
|
||||||
|
}
|
||||||
|
if($pitch === false){
|
||||||
|
$pitch = $this->entity->yaw;
|
||||||
|
}
|
||||||
$this->entity->fallY = false;
|
$this->entity->fallY = false;
|
||||||
$this->entity->fallStart = false;
|
$this->entity->fallStart = false;
|
||||||
$this->entity->setPosition($pos->x, $pos->y, $pos->z, $yaw, $pitch);
|
$this->entity->setPosition($pos->x, $pos->y, $pos->z, $yaw, $pitch);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user