mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-16 02:38:54 +00:00
Player: Improved hardcore death handling
it's now possible to cancel the banning by cancelling PlayerKickEvent. In addition, the disconnect message will now properly explain why the player is banned instead of just saying 'You have been banned', and also banned-players.txt will show 'Died in hardcore mode' as the reason instead of being completely blank (seriously, we couldn't tell the difference between real bans and hardcore bans????)
This commit is contained in:
parent
5e44d5f75e
commit
9969c928a8
@ -2174,7 +2174,9 @@ class Player extends Human implements CommandSender, ChunkListener, IPlayer{
|
||||
|
||||
public function respawn() : void{
|
||||
if($this->server->isHardcore()){
|
||||
$this->setBanned(true);
|
||||
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");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user