mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-21 08:17:34 +00:00
NetworkBinaryStream: do not round vectors directly on reading
fixes #3199
This commit is contained in:
parent
2dc3cf8162
commit
5056754cea
@ -2238,7 +2238,7 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
|
||||
}
|
||||
|
||||
public function handleMovePlayer(MovePlayerPacket $packet) : bool{
|
||||
$newPos = $packet->position->subtract(0, $this->baseOffset, 0);
|
||||
$newPos = $packet->position->round(4)->subtract(0, $this->baseOffset, 0);
|
||||
|
||||
if($this->isTeleporting and $newPos->distanceSquared($this) > 1){ //Tolerate up to 1 block to avoid problems with client-sided physics when spawning in blocks
|
||||
$this->sendPosition($this, null, null, MovePlayerPacket::MODE_RESET);
|
||||
|
@ -547,9 +547,9 @@ class NetworkBinaryStream extends BinaryStream{
|
||||
*/
|
||||
public function getVector3() : Vector3{
|
||||
return new Vector3(
|
||||
$this->getRoundedLFloat(4),
|
||||
$this->getRoundedLFloat(4),
|
||||
$this->getRoundedLFloat(4)
|
||||
$this->getLFloat(),
|
||||
$this->getLFloat(),
|
||||
$this->getLFloat()
|
||||
);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user