InGamePacketHandler: fix regression in movement handling since 82c8fa696a

fixes #4291
fixes #4398
This commit is contained in:
Dylan K. Taylor
2021-09-10 16:52:27 +01:00
parent 4111d92b98
commit 7701e1ff98

View File

@ -177,7 +177,7 @@ class InGamePacketHandler extends PacketHandler{
$this->player->setRotation($yaw, $pitch);
$curPos = $this->player->getLocation();
$newPos = $packet->position->subtract(0, 1.62, 0);
$newPos = $packet->position->round(4)->subtract(0, 1.62, 0);
if($this->forceMoveSync and $newPos->distanceSquared($curPos) > 1){ //Tolerate up to 1 block to avoid problems with client-sided physics when spawning in blocks
$this->session->getLogger()->debug("Got outdated pre-teleport movement, received " . $newPos . ", expected " . $curPos);