mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-09 21:24:53 +00:00
Added "player.teleport"
This commit is contained in:
parent
2305322ed0
commit
4564765470
@ -599,13 +599,17 @@ class Player{
|
||||
if($pitch === false){
|
||||
$pitch = $this->entity->pitch;
|
||||
}
|
||||
if($this->server->api->dhandle("player.teleport", array("player" => $this, "target" => $pos)) === false){
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->lastCorrect = $pos;
|
||||
$this->entity->fallY = false;
|
||||
$this->entity->fallStart = false;
|
||||
$this->entity->setPosition($pos, $yaw, $pitch);
|
||||
$this->entity->resetSpeed();
|
||||
$this->entity->updateLast();
|
||||
$this->entity->calculateVelocity();
|
||||
$this->entity->calculateVelocity();
|
||||
if($pos instanceof Position and $pos->level !== $this->level){
|
||||
foreach($this->server->api->entity->getAll($this->level) as $e){
|
||||
if($e !== $this->entity){
|
||||
|
Loading…
x
Reference in New Issue
Block a user