mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-12 12:55:21 +00:00
Player: fix weird behaviour when teleporting sleeping players
closes #4672
This commit is contained in:
parent
688be0a404
commit
c82dfef9b0
@ -2373,6 +2373,7 @@ class Player extends Human implements CommandSender, ChunkListener, IPlayer{
|
|||||||
if(parent::teleport($pos, $yaw, $pitch)){
|
if(parent::teleport($pos, $yaw, $pitch)){
|
||||||
|
|
||||||
$this->removeCurrentWindow();
|
$this->removeCurrentWindow();
|
||||||
|
$this->stopSleep();
|
||||||
|
|
||||||
$this->sendPosition($this->location, $this->location->yaw, $this->location->pitch, MovePlayerPacket::MODE_TELEPORT);
|
$this->sendPosition($this->location, $this->location->yaw, $this->location->pitch, MovePlayerPacket::MODE_TELEPORT);
|
||||||
$this->broadcastMovement(true);
|
$this->broadcastMovement(true);
|
||||||
@ -2384,7 +2385,6 @@ class Player extends Human implements CommandSender, ChunkListener, IPlayer{
|
|||||||
if($this->spawnChunkLoadCount !== -1){
|
if($this->spawnChunkLoadCount !== -1){
|
||||||
$this->spawnChunkLoadCount = 0;
|
$this->spawnChunkLoadCount = 0;
|
||||||
}
|
}
|
||||||
$this->stopSleep();
|
|
||||||
$this->blockBreakHandler = null;
|
$this->blockBreakHandler = null;
|
||||||
|
|
||||||
//TODO: workaround for player last pos not getting updated
|
//TODO: workaround for player last pos not getting updated
|
||||||
|
Loading…
x
Reference in New Issue
Block a user