mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-13 01:09:44 +00:00
Fixed glitching on respawn due to player 1.62 position offset
This commit is contained in:
parent
0f79b19fdc
commit
e9c46da7f0
@ -886,11 +886,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
||||
|
||||
$pos = $ev->getRespawnPosition();
|
||||
|
||||
$pk = new RespawnPacket();
|
||||
$pk->x = $pos->x;
|
||||
$pk->y = $pos->y;
|
||||
$pk->z = $pos->z;
|
||||
$this->dataPacket($pk);
|
||||
$this->sendRespawnPacket($pos);
|
||||
|
||||
$this->sendPlayStatus(PlayStatusPacket::PLAYER_SPAWN);
|
||||
|
||||
@ -930,17 +926,20 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
||||
}
|
||||
|
||||
if($this->getHealth() <= 0){
|
||||
$pk = new RespawnPacket();
|
||||
$pos = $this->getSpawn();
|
||||
$pk->x = $pos->x;
|
||||
$pk->y = $pos->y;
|
||||
$pk->z = $pos->z;
|
||||
$this->dataPacket($pk);
|
||||
$this->sendRespawnPacket($this->getSpawn());
|
||||
}
|
||||
|
||||
$this->joined = true;
|
||||
}
|
||||
|
||||
protected function sendRespawnPacket(Vector3 $pos){
|
||||
$pk = new RespawnPacket();
|
||||
$pk->x = $pos->x;
|
||||
$pk->y = $pos->y + $this->baseOffset;
|
||||
$pk->z = $pos->z;
|
||||
$this->dataPacket($pk);
|
||||
}
|
||||
|
||||
protected function orderChunks(){
|
||||
if($this->connected === false or $this->viewDistance === -1){
|
||||
return false;
|
||||
@ -3796,12 +3795,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
||||
|
||||
parent::kill();
|
||||
|
||||
$pk = new RespawnPacket();
|
||||
$pos = $this->getSpawn();
|
||||
$pk->x = $pos->x;
|
||||
$pk->y = $pos->y;
|
||||
$pk->z = $pos->z;
|
||||
$this->dataPacket($pk);
|
||||
$this->sendRespawnPacket($this->getSpawn());
|
||||
}
|
||||
|
||||
protected function callDeathEvent(){
|
||||
|
Loading…
x
Reference in New Issue
Block a user