Player: fix weird behaviour when teleporting sleeping players

closes #4672
This commit is contained in:
Dylan K. Taylor 2022-05-21 20:08:12 +01:00
parent 688be0a404
commit c82dfef9b0
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -2373,6 +2373,7 @@ class Player extends Human implements CommandSender, ChunkListener, IPlayer{
if(parent::teleport($pos, $yaw, $pitch)){
$this->removeCurrentWindow();
$this->stopSleep();
$this->sendPosition($this->location, $this->location->yaw, $this->location->pitch, MovePlayerPacket::MODE_TELEPORT);
$this->broadcastMovement(true);
@ -2384,7 +2385,6 @@ class Player extends Human implements CommandSender, ChunkListener, IPlayer{
if($this->spawnChunkLoadCount !== -1){
$this->spawnChunkLoadCount = 0;
}
$this->stopSleep();
$this->blockBreakHandler = null;
//TODO: workaround for player last pos not getting updated