mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-05 19:37:17 +00:00
Allow 0.01 of a block diff
Fixes loss of precision when handling player movements causing some position issues.
This commit is contained in:
parent
89216c3bd4
commit
20c7e51077
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user