mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-21 08:17:34 +00:00
Merge commit 141fbde6604da5001b73db0dae86fc6f397939e0
This commit is contained in:
commit
804fb3f603
@ -759,7 +759,7 @@ class Player extends Human implements CommandSender, ChunkListener, IPlayer{
|
||||
|
||||
if($this->getHealth() <= 0){
|
||||
$this->logger->debug("Quit while dead, forcing respawn");
|
||||
$this->respawn();
|
||||
$this->actuallyRespawn();
|
||||
}
|
||||
}
|
||||
|
||||
@ -2100,10 +2100,6 @@ class Player extends Human implements CommandSender, ChunkListener, IPlayer{
|
||||
}
|
||||
|
||||
public function respawn() : void{
|
||||
if($this->respawnLocked){
|
||||
return;
|
||||
}
|
||||
$this->respawnLocked = true;
|
||||
if($this->server->isHardcore()){
|
||||
if($this->kick("You have been banned because you died in hardcore mode")){ //this allows plugins to prevent the ban by cancelling PlayerKickEvent
|
||||
$this->server->getNameBans()->addBan($this->getName(), "Died in hardcore mode");
|
||||
@ -2111,6 +2107,15 @@ class Player extends Human implements CommandSender, ChunkListener, IPlayer{
|
||||
return;
|
||||
}
|
||||
|
||||
$this->actuallyRespawn();
|
||||
}
|
||||
|
||||
protected function actuallyRespawn() : void{
|
||||
if($this->respawnLocked){
|
||||
return;
|
||||
}
|
||||
$this->respawnLocked = true;
|
||||
|
||||
$this->logger->debug("Waiting for spawn terrain generation for respawn");
|
||||
$spawn = $this->getSpawn();
|
||||
$spawn->getWorld()->orderChunkPopulation($spawn->getFloorX() >> Chunk::COORD_BIT_SIZE, $spawn->getFloorZ() >> Chunk::COORD_BIT_SIZE, null)->onCompletion(
|
||||
|
Loading…
x
Reference in New Issue
Block a user