player will not be able to move while sleeping

This commit is contained in:
GameHerobrine 2023-10-08 20:19:12 +03:00
parent 37b3c02396
commit 070755ba8e

View file

@ -1504,11 +1504,10 @@ class Player{
} }
break; break;
case ProtocolInfo::MOVE_PLAYER_PACKET: case ProtocolInfo::MOVE_PLAYER_PACKET:
if($this->spawned === false){ if($this->spawned === false){
break; break;
} }
if($this->isSleeping) break;
if(($this->entity instanceof Entity) and $packet->messageIndex > $this->lastMovement){ if(($this->entity instanceof Entity) and $packet->messageIndex > $this->lastMovement){
$this->lastMovement = $packet->messageIndex; $this->lastMovement = $packet->messageIndex;
$newPos = new Vector3($packet->x, $packet->y, $packet->z); $newPos = new Vector3($packet->x, $packet->y, $packet->z);