diff --git a/src/pocketmine/Player.php b/src/pocketmine/Player.php index 86c7541c0..a46a62594 100644 --- a/src/pocketmine/Player.php +++ b/src/pocketmine/Player.php @@ -1232,11 +1232,11 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{ if($this->onGround){ $this->inAirTicks = 0; }else{ - if($this->inAirTicks > 20 and $this->isSurvival() and !$this->isSleeping() and $this->spawned and !$this->server->getAllowFlight()){ + if($this->inAirTicks > 20 and $this->isSurvival() and !$this->isSleeping() and $this->spawned){ $expectedVelocity = (-$this->gravity) / $this->drag - ((-$this->gravity) / $this->drag) * exp(-$this->drag * ($this->inAirTicks - 2)); $diff = ($this->speed->y - $expectedVelocity) ** 2; - if($diff > 0.6 and $expectedVelocity < $this->speed->y){ + if($diff > 0.6 and $expectedVelocity < $this->speed->y and !$this->server->getAllowFlight()){ $this->kick("Flying is not enabled on this server"); } return false; @@ -1541,6 +1541,13 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{ if($this->spawned === false or $this->dead === true){ break; } + $packet->yaw %= 360; + $packet->pitch %= 360; + + if($packet->yaw < 0){ + $packet->yaw += 360; + } + $this->setRotation($packet->yaw, $this->pitch); break; case ProtocolInfo::MOVE_PLAYER_PACKET: diff --git a/src/pocketmine/utils/Utils.php b/src/pocketmine/utils/Utils.php index 2499e1820..f3ed25249 100644 --- a/src/pocketmine/utils/Utils.php +++ b/src/pocketmine/utils/Utils.php @@ -243,7 +243,6 @@ class Utils{ (string) memory_get_usage() . "." . memory_get_peak_usage(), php_uname(), phpversion(), - extension_loaded("gmp") ? gmp_strval(gmp_random(4)) : microtime(), zend_version(), (string) getmypid(), (string) getmyuid(),