From 20c7e5107798348502a21547d6fe93f5ae8d2dbd Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Sun, 19 Feb 2017 17:35:23 +0000 Subject: [PATCH] Allow 0.01 of a block diff Fixes loss of precision when handling player movements causing some position issues. --- src/pocketmine/Player.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pocketmine/Player.php b/src/pocketmine/Player.php index ecee9ce8e4..c800231b3d 100644 --- a/src/pocketmine/Player.php +++ b/src/pocketmine/Player.php @@ -1922,7 +1922,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade case ProtocolInfo::MOVE_PLAYER_PACKET: $newPos = new Vector3($packet->x, $packet->y - $this->getEyeHeight(), $packet->z); - if($newPos->distanceSquared($this) < 0.01 and ($packet->yaw % 360) === $this->yaw and ($packet->pitch % 360) === $this->pitch){ //player hasn't moved, just client spamming packets + if($newPos->distanceSquared($this) < 0.0001 and ($packet->yaw % 360) === $this->yaw and ($packet->pitch % 360) === $this->pitch){ //player hasn't moved, just client spamming packets break; }