mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-29 14:49:59 +00:00
Send spawn position after respawn on death, fixes #2976
This commit is contained in:
parent
9ec609d025
commit
49f34ec524
@ -731,6 +731,15 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
|
|||||||
if($this->server->getUpdater()->hasUpdate() and $this->hasPermission(Server::BROADCAST_CHANNEL_ADMINISTRATIVE)){
|
if($this->server->getUpdater()->hasUpdate() and $this->hasPermission(Server::BROADCAST_CHANNEL_ADMINISTRATIVE)){
|
||||||
$this->server->getUpdater()->showPlayerUpdate($this);
|
$this->server->getUpdater()->showPlayerUpdate($this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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->setChannel(Network::CHANNEL_WORLD_EVENTS));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user