mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-22 04:29:43 +00:00
Optional teleport yaw & pitch
This commit is contained in:
parent
3f820d18d2
commit
8a9e6426ca
1 changed files with 7 additions and 1 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue