Allow 0.01 of a block diff

Fixes loss of precision when handling player movements causing some position issues.
This commit is contained in:
Dylan K. Taylor 2017-02-19 17:35:23 +00:00
parent 89216c3bd4
commit 20c7e51077

View File

@ -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;
}