diff --git a/src/pocketmine/Player.php b/src/pocketmine/Player.php index 6f2a8ce74..a23f9dbdc 100644 --- a/src/pocketmine/Player.php +++ b/src/pocketmine/Player.php @@ -1653,13 +1653,6 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{ $deltaAngle = abs($this->lastYaw - $to->yaw) + abs($this->lastPitch - $to->pitch); if($delta > 0.0001 or $deltaAngle > 1.0){ - $this->lastX = $to->x; - $this->lastY = $to->y; - $this->lastZ = $to->z; - - $this->lastYaw = $to->yaw; - $this->lastPitch = $to->pitch; - $ev = new PlayerMoveEvent($this, $from, $to); $ev->call(); @@ -1674,6 +1667,12 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{ return; } + $this->lastX = $to->x; + $this->lastY = $to->y; + $this->lastZ = $to->z; + + $this->lastYaw = $to->yaw; + $this->lastPitch = $to->pitch; $this->broadcastMovement(); $distance = sqrt((($from->x - $to->x) ** 2) + (($from->z - $to->z) ** 2)); @@ -1696,13 +1695,6 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{ } protected function revertMovement(Location $from) : void{ - $this->lastX = $from->x; - $this->lastY = $from->y; - $this->lastZ = $from->z; - - $this->lastYaw = $from->yaw; - $this->lastPitch = $from->pitch; - $this->setPosition($from); $this->sendPosition($from, $from->yaw, $from->pitch, MovePlayerPacket::MODE_RESET); }