mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-12 12:55:21 +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{
|
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
|
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);
|
$this->sendPosition($this, null, null, MovePlayerPacket::MODE_RESET);
|
||||||
|
@ -547,9 +547,9 @@ class NetworkBinaryStream extends BinaryStream{
|
|||||||
*/
|
*/
|
||||||
public function getVector3() : Vector3{
|
public function getVector3() : Vector3{
|
||||||
return new Vector3(
|
return new Vector3(
|
||||||
$this->getRoundedLFloat(4),
|
$this->getLFloat(),
|
||||||
$this->getRoundedLFloat(4),
|
$this->getLFloat(),
|
||||||
$this->getRoundedLFloat(4)
|
$this->getLFloat()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user