diff --git a/src/pocketmine/Player.php b/src/pocketmine/Player.php index 4fc4c1d04..977334ab7 100644 --- a/src/pocketmine/Player.php +++ b/src/pocketmine/Player.php @@ -1852,6 +1852,9 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade break; case ProtocolInfo::MOVE_PLAYER_PACKET: + if($this->teleportPosition !== null){ + break; + } $newPos = new Vector3($packet->x, $packet->y - $this->getEyeHeight(), $packet->z); @@ -1861,8 +1864,8 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade $this->forceMovement = new Vector3($this->x, $this->y, $this->z); } - if($this->teleportPosition !== null or ($this->forceMovement instanceof Vector3 and (($dist = $newPos->distanceSquared($this->forceMovement)) > 0.1 or $revert))){ - $this->sendPosition($this->teleportPosition === null ? $this->forceMovement : $this->teleportPosition, $packet->yaw, $packet->pitch); + if($this->forceMovement instanceof Vector3 and (($dist = $newPos->distanceSquared($this->forceMovement)) > 0.1 or $revert)){ + $this->sendPosition($this->forceMovement, $packet->yaw, $packet->pitch); }else{ $packet->yaw %= 360; $packet->pitch %= 360;