mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-06 01:51:51 +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){
|
if($this->getHealth() <= 0){
|
||||||
$this->logger->debug("Quit while dead, forcing respawn");
|
$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{
|
public function respawn() : void{
|
||||||
if($this->respawnLocked){
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
$this->respawnLocked = true;
|
|
||||||
if($this->server->isHardcore()){
|
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
|
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");
|
$this->server->getNameBans()->addBan($this->getName(), "Died in hardcore mode");
|
||||||
@ -2111,6 +2107,15 @@ class Player extends Human implements CommandSender, ChunkListener, IPlayer{
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$this->actuallyRespawn();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function actuallyRespawn() : void{
|
||||||
|
if($this->respawnLocked){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$this->respawnLocked = true;
|
||||||
|
|
||||||
$this->logger->debug("Waiting for spawn terrain generation for respawn");
|
$this->logger->debug("Waiting for spawn terrain generation for respawn");
|
||||||
$spawn = $this->getSpawn();
|
$spawn = $this->getSpawn();
|
||||||
$spawn->getWorld()->orderChunkPopulation($spawn->getFloorX() >> Chunk::COORD_BIT_SIZE, $spawn->getFloorZ() >> Chunk::COORD_BIT_SIZE, null)->onCompletion(
|
$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