mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-09 03:06:55 +00:00
Add setReason() method to PlayerKickEvent
This commit is contained in:
committed by
Dylan K. Taylor
parent
2994d0f3ae
commit
bfcef2ab6b
@ -3177,6 +3177,7 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
|
||||
public function kick(string $reason = "", bool $isAdmin = true) : bool{
|
||||
$this->server->getPluginManager()->callEvent($ev = new PlayerKickEvent($this, $reason, $this->getLeaveMessage()));
|
||||
if(!$ev->isCancelled()){
|
||||
$reason = $ev->getReason();
|
||||
$message = $reason;
|
||||
if($isAdmin){
|
||||
if(!$this->isBanned()){
|
||||
|
Reference in New Issue
Block a user