Fixed glitching on respawn due to player 1.62 position offset

This commit is contained in:
Dylan K. Taylor 2017-06-21 11:27:20 +01:00
parent 0f79b19fdc
commit e9c46da7f0

View File

@ -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(){